/[escript]/branches/doubleplusgood/paso/src/SparseMatrix_setValues.cpp
ViewVC logotype

Contents of /branches/doubleplusgood/paso/src/SparseMatrix_setValues.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4261 - (show annotations)
Wed Feb 27 06:09:33 2013 UTC (6 years, 9 months ago) by jfenwick
File size: 1612 byte(s)
Initial all c++ build.
But ... there are now reinterpret_cast<>'s
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16
17 /************************************************************************************/
18
19 /* Paso: SparseMatrix : */
20 /* sets the values of the sparse matrix to a value */
21
22 /************************************************************************************/
23
24 /* Author: Lutz Gross, l.gross@uq.edu.au */
25
26 /************************************************************************************/
27
28 #include "Paso.h"
29 #include "SparseMatrix.h"
30
31 /************************************************************************************/
32
33 void Paso_SparseMatrix_setValues(Paso_SparseMatrix* in,double value) {
34 index_t index_offset=(in->type & MATRIX_FORMAT_OFFSET1 ? 1:0);
35 dim_t i,j;
36 index_t iptr;
37 if (! Paso_Pattern_isEmpty(in->pattern)) {
38 #pragma omp parallel for private(i,iptr,j) schedule(static)
39 for (i=0;i< in->pattern->numOutput;++i) {
40 for (iptr=(in->pattern->ptr[i])-index_offset;iptr<(in->pattern->ptr[i+1])-index_offset;++iptr) {
41 for (j=0;j<(in->block_size);++j) in->val[iptr*(in->block_size)+j]=value;
42 }
43 }
44 }
45 }

  ViewVC Help
Powered by ViewVC 1.1.26