/[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 1388 - (show annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 8 months ago) by trankine
File MIME type: text/plain
File size: 1491 byte(s)
And get the *(&(*&(* name right
1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 /**************************************************************/
17
18 /* Paso: SparseMatrix : */
19 /* sets the values of the sparse matrix to a value */
20
21 /**************************************************************/
22
23 /* Copyrights by ACcESS Australia 2003,2004,2005,2006, 2007 */
24 /* Author: gross@access.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