/[escript]/trunk/paso/src/SparseMatrix_setValues.c
ViewVC logotype

Contents of /trunk/paso/src/SparseMatrix_setValues.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (show annotations)
Thu Sep 25 23:11:13 2008 UTC (11 years ago) by ksteube
File MIME type: text/plain
File size: 1393 byte(s)
Copyright updated in all files

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 /**************************************************************/
16
17 /* Paso: SparseMatrix : */
18 /* sets the values of the sparse matrix to a value */
19
20 /**************************************************************/
21
22 /* Author: gross@access.edu.au */
23
24 /**************************************************************/
25
26 #include "Paso.h"
27 #include "SparseMatrix.h"
28
29 /**************************************************************/
30
31 void Paso_SparseMatrix_setValues(Paso_SparseMatrix* in,double value) {
32 index_t index_offset=(in->type & MATRIX_FORMAT_OFFSET1 ? 1:0);
33 dim_t i,j;
34 index_t iptr;
35 if (! Paso_Pattern_isEmpty(in->pattern)) {
36 #pragma omp parallel for private(i,iptr,j) schedule(static)
37 for (i=0;i< in->pattern->numOutput;++i) {
38 for (iptr=(in->pattern->ptr[i])-index_offset;iptr<(in->pattern->ptr[i+1])-index_offset;++iptr) {
39 for (j=0;j<(in->block_size);++j) in->val[iptr*(in->block_size)+j]=value;
40 }
41 }
42 }
43 }

  ViewVC Help
Powered by ViewVC 1.1.26