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

Diff of /trunk/paso/src/SparseMatrix_addAbsRow.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2881 by jfenwick, Thu Jan 28 02:03:15 2010 UTC revision 3369 by gross, Fri Nov 19 06:26:11 2010 UTC
# Line 25  Line 25 
25  #include "Paso.h"  #include "Paso.h"
26  #include "SparseMatrix.h"  #include "SparseMatrix.h"
27    
28  void Paso_SparseMatrix_addAbsRow_CSR_OFFSET0(Paso_SparseMatrix* A, double* array) {  void Paso_SparseMatrix_addAbsRow_CSR_OFFSET0(const Paso_SparseMatrix* A, double* array) {
29     dim_t ir,irow,icb,irb;     dim_t ir,irow,icb,irb;
30     index_t iptr;     index_t iptr;
31     register double fac;     register double fac;
# Line 40  void Paso_SparseMatrix_addAbsRow_CSR_OFF Line 40  void Paso_SparseMatrix_addAbsRow_CSR_OFF
40            }            }
41            array[irow]+=fac;            array[irow]+=fac;
42          }          }
43       }
44    }
45    void Paso_SparseMatrix_maxAbsRow_CSR_OFFSET0(const Paso_SparseMatrix* A, double* array) {
46       dim_t ir,irow,icb,irb;
47       index_t iptr;
48       register double fac;
49       #pragma omp parallel for private(ir,irb,irow,fac,iptr,icb) schedule(static)
50       for (ir=0;ir< A->pattern->numOutput;ir++) {
51           for (irb=0;irb< A->row_block_size;irb++) {
52          irow=irb+A->row_block_size*ir;
53              fac=0.;
54          for (iptr=A->pattern->ptr[ir];iptr<A->pattern->ptr[ir+1]; iptr++) {
55              for (icb=0;icb< A->col_block_size;icb++)
56                     fac=MAX(fac,ABS(A->val[iptr*A->block_size+irb+A->row_block_size*icb]));
57              }
58              array[irow]+=fac;
59            }
60     }     }
61  }  }

Legend:
Removed from v.2881  
changed lines
  Added in v.3369

  ViewVC Help
Powered by ViewVC 1.1.26