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

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

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

revision 3311 by gross, Mon Oct 25 04:33:31 2010 UTC revision 3312 by gross, Tue Oct 26 07:54:58 2010 UTC
# Line 32  Line 32 
32    
33  Paso_Pattern* Paso_Pattern_alloc(int type, dim_t numOutput, dim_t numInput, index_t* ptr, index_t* index) {  Paso_Pattern* Paso_Pattern_alloc(int type, dim_t numOutput, dim_t numInput, index_t* ptr, index_t* index) {
34    Paso_Pattern *out=NULL;    Paso_Pattern *out=NULL;
35    index_t index_offset=(type & PATTERN_FORMAT_OFFSET1 ? 1:0);    index_t index_offset=(type & MATRIX_FORMAT_OFFSET1 ? 1:0);
36    index_t loc_min_index,loc_max_index,min_index=index_offset,max_index=index_offset-1;    index_t loc_min_index,loc_max_index,min_index=index_offset,max_index=index_offset-1;
37    dim_t i;    dim_t i;
38    Esys_resetError();    Esys_resetError();
# Line 42  Paso_Pattern* Paso_Pattern_alloc(int typ Line 42  Paso_Pattern* Paso_Pattern_alloc(int typ
42       {       {
43          loc_min_index=index_offset;          loc_min_index=index_offset;
44          loc_max_index=index_offset-1;          loc_max_index=index_offset-1;
45          if (type & PATTERN_FORMAT_OFFSET1) {          if (type & MATRIX_FORMAT_OFFSET1) {
46             #pragma omp for schedule(static)             #pragma omp for schedule(static)
47             for (i=0;i<numOutput;++i) {             for (i=0;i<numOutput;++i) {
48                 if (ptr[i]<ptr[i+1]) {                 if (ptr[i]<ptr[i+1]) {
# Line 185  Paso_Pattern* Paso_Pattern_fromIndexList Line 185  Paso_Pattern* Paso_Pattern_fromIndexList
185                for(i=n0;i<n;++i) {                for(i=n0;i<n;++i) {
186                    Paso_IndexList_toArray(&index_list[i],&index[ptr[i-n0]],range_min,range_max,index_offset);                    Paso_IndexList_toArray(&index_list[i],&index[ptr[i-n0]],range_min,range_max,index_offset);
187                }                }
188                out=Paso_Pattern_alloc(PATTERN_FORMAT_DEFAULT,n-n0,range_max+index_offset,ptr,index);                out=Paso_Pattern_alloc(MATRIX_FORMAT_DEFAULT,n-n0,range_max+index_offset,ptr,index);
189         }         }
190    }    }
191    if (! Esys_noError()) {    if (! Esys_noError()) {

Legend:
Removed from v.3311  
changed lines
  Added in v.3312

  ViewVC Help
Powered by ViewVC 1.1.26