~vcs-imports/escript-finley/trunk

« back to all changes in this revision

Viewing changes to paso/src/Pattern.c

  • Committer: jfenwick
  • Date: 2010-10-11 01:48:14 UTC
  • Revision ID: svn-v4:77569008-7704-0410-b7a0-a92fef0b09fd:trunk:3259
Merging dudley and scons updates from branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
  index_t index_offset=(type & PATTERN_FORMAT_OFFSET1 ? 1:0);
36
36
  index_t loc_min_index,loc_max_index,min_index=index_offset,max_index=index_offset-1;
37
37
  dim_t i;
38
 
  Paso_resetError();
 
38
  Esys_resetError();
39
39
 
40
40
  if (type & PATTERN_FORMAT_SYM) {
41
 
    Paso_setError(TYPE_ERROR,"Paso_Pattern_alloc: symmetric matrix pattern is not supported yet");
 
41
    Esys_setError(TYPE_ERROR,"Paso_Pattern_alloc: symmetric matrix pattern is not supported yet");
42
42
    return NULL;
43
43
  }
44
44
  if (ptr!=NULL && index != NULL) {
80
80
        }
81
81
    }
82
82
    if ( (min_index<index_offset) || (max_index>=numInput+index_offset) ) {
83
 
      Paso_setError(TYPE_ERROR,"Paso_Pattern_alloc: Pattern index out of range.");
 
83
      Esys_setError(TYPE_ERROR,"Paso_Pattern_alloc: Pattern index out of range.");
84
84
      return NULL;
85
85
    }
86
86
  }
87
87
  out=MEMALLOC(1,Paso_Pattern);
88
 
  if (! Paso_checkPtr(out)) {
 
88
  if (! Esys_checkPtr(out)) {
89
89
      out->type=type;
90
90
      out->reference_counter=1;
91
91
      out->numOutput=numOutput;
168
168
  Paso_IndexList* index_list=NULL;
169
169
 
170
170
  index_list=TMPMEMALLOC(A->numOutput,Paso_IndexList);
171
 
  if (! Paso_checkPtr(index_list)) {
 
171
  if (! Esys_checkPtr(index_list)) {
172
172
        #pragma omp parallel for private(i) schedule(static)
173
173
        for(i=0;i<A->numOutput;++i) {
174
174
             index_list[i].extension=NULL;
215
215
  Paso_IndexList* index_list=NULL;
216
216
 
217
217
 index_list=TMPMEMALLOC(A->numOutput,Paso_IndexList);
218
 
   if (! Paso_checkPtr(index_list)) {
 
218
   if (! Esys_checkPtr(index_list)) {
219
219
        #pragma omp parallel for private(i) schedule(static)
220
220
        for(i=0;i<A->numOutput;++i) {
221
221
             index_list[i].extension=NULL;
281
281
     /* if in->index is full check the extension */
282
282
     if (in->extension==NULL) {
283
283
        in->extension=TMPMEMALLOC(1,Paso_IndexList);
284
 
        if (Paso_checkPtr(in->extension)) return;
 
284
        if (Esys_checkPtr(in->extension)) return;
285
285
        in->extension->n=0;
286
286
        in->extension->extension=NULL;
287
287
     }
347
347
   Paso_Pattern* out=NULL;
348
348
 
349
349
   ptr=MEMALLOC(n+1-n0,index_t);
350
 
   if (! Paso_checkPtr(ptr) ) {
 
350
   if (! Esys_checkPtr(ptr) ) {
351
351
       /* get the number of connections per row */
352
352
       #pragma omp parallel for private(i) schedule(static)
353
353
       for(i=n0;i<n;++i) {
363
363
       ptr[n-n0]=s;
364
364
       /* fill index */
365
365
       index=MEMALLOC(ptr[n-n0],index_t);
366
 
       if (! Paso_checkPtr(index)) {
 
366
       if (! Esys_checkPtr(index)) {
367
367
              #pragma omp parallel for private(i) schedule(static) 
368
368
              for(i=n0;i<n;++i) {
369
369
                  Paso_IndexList_toArray(&index_list[i],&index[ptr[i-n0]],range_min,range_max,index_offset);
371
371
              out=Paso_Pattern_alloc(PATTERN_FORMAT_DEFAULT,n-n0,range_max+index_offset,ptr,index);
372
372
       }
373
373
  }
374
 
  if (! Paso_noError()) {
 
374
  if (! Esys_noError()) {
375
375
        MEMFREE(ptr);
376
376
        MEMFREE(index);
377
377
        Paso_Pattern_free(out);
387
387
    
388
388
     if (A->main_iptr == NULL) {
389
389
         A->main_iptr=MEMALLOC(n,index_t);
390
 
         if (! Paso_checkPtr(A->main_iptr) ) {
 
390
         if (! Esys_checkPtr(A->main_iptr) ) {
391
391
             #pragma omp parallel 
392
392
             {
393
393
                 /* identify the main diagonals */
427
427
   if (A->coloring == NULL) {
428
428
      
429
429
      A->coloring=MEMALLOC(n,index_t);
430
 
      if ( ! Paso_checkPtr(A->coloring)) {
 
430
      if ( ! Esys_checkPtr(A->coloring)) {
431
431
         Paso_Pattern_color(A,&(A->numColors),A->coloring);
432
 
         if (! Paso_noError()) {
 
432
         if (! Esys_noError()) {
433
433
            MEMFREE(A->coloring);
434
434
         }
435
435
      }