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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1315 - (hide annotations)
Tue Sep 25 02:41:13 2007 UTC (12 years, 5 months ago) by ksteube
File MIME type: text/plain
File size: 1491 byte(s)
Copied more files from MPI branch to trunk

1 ksteube 1315
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