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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4819 - (show annotations)
Tue Apr 1 03:50:23 2014 UTC (5 years, 5 months ago) by caltinay
File size: 1617 byte(s)
Pattern shared ptrs

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 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 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17
18 /****************************************************************************/
19
20 /* Paso: SparseMatrix : */
21 /* sets the values of the sparse matrix to a value */
22
23 /****************************************************************************/
24
25 /* Author: Lutz Gross, l.gross@uq.edu.au */
26
27 /****************************************************************************/
28
29 #include "Paso.h"
30 #include "SparseMatrix.h"
31
32 namespace paso {
33
34 void SparseMatrix_setValues(SparseMatrix* in, double value)
35 {
36 index_t index_offset=(in->type & MATRIX_FORMAT_OFFSET1 ? 1:0);
37 dim_t i,j;
38 index_t iptr;
39 if (!in->pattern->isEmpty()) {
40 #pragma omp parallel for private(i,iptr,j) schedule(static)
41 for (i=0; i < in->pattern->numOutput; ++i) {
42 for (iptr=(in->pattern->ptr[i])-index_offset;iptr<(in->pattern->ptr[i+1])-index_offset;++iptr) {
43 for (j=0;j<(in->block_size);++j) in->val[iptr*(in->block_size)+j]=value;
44 }
45 }
46 }
47 }
48
49 } // namespace paso

Properties

Name Value
svn:mergeinfo /branches/amg_from_3530/paso/src/SparseMatrix_setValues.cpp:3531-3826 /branches/lapack2681/paso/src/SparseMatrix_setValues.cpp:2682-2741 /branches/pasowrap/paso/src/SparseMatrix_setValues.cpp:3661-3674 /branches/py3_attempt2/paso/src/SparseMatrix_setValues.cpp:3871-3891 /branches/restext/paso/src/SparseMatrix_setValues.cpp:2610-2624 /branches/ripleygmg_from_3668/paso/src/SparseMatrix_setValues.cpp:3669-3791 /branches/stage3.0/paso/src/SparseMatrix_setValues.cpp:2569-2590 /branches/symbolic_from_3470/paso/src/SparseMatrix_setValues.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/paso/src/SparseMatrix_setValues.cpp:3517-3974 /release/3.0/paso/src/SparseMatrix_setValues.cpp:2591-2601 /trunk/paso/src/SparseMatrix_setValues.cpp:4257-4344 /trunk/ripley/test/python/paso/src/SparseMatrix_setValues.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26