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

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

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

revision 969 by ksteube, Tue Feb 13 23:02:23 2007 UTC revision 1028 by gross, Wed Mar 14 00:15:24 2007 UTC
# Line 31  Line 31 
31    
32  Paso_SystemMatrixPattern* Paso_SystemMatrixPattern_unrollBlocks(Paso_SystemMatrixPattern* pattern, \  Paso_SystemMatrixPattern* Paso_SystemMatrixPattern_unrollBlocks(Paso_SystemMatrixPattern* pattern, \
33                                             int type, dim_t row_block_size,dim_t col_block_size) {                                             int type, dim_t row_block_size,dim_t col_block_size) {
34      Paso_SystemMatrixPattern*out=NULL;
35      index_t *ptr=NULL,*index=NULL,iPtr;
36      dim_t i,j,k,l, block_size, new_n_ptr, new_len;
37    index_t index_offset_in=(pattern->type & PATTERN_FORMAT_OFFSET1 ? 1:0);    index_t index_offset_in=(pattern->type & PATTERN_FORMAT_OFFSET1 ? 1:0);
38    index_t index_offset_out=(type & PATTERN_FORMAT_OFFSET1 ? 1:0);    index_t index_offset_out=(type & PATTERN_FORMAT_OFFSET1 ? 1:0);
39        
# Line 38  Paso_SystemMatrixPattern* Paso_SystemMat Line 41  Paso_SystemMatrixPattern* Paso_SystemMat
41        Paso_setError(TYPE_ERROR,"Paso_SystemMatrixPattern_unrollBlocks: conversion between symmetric and non-symmetric is not implemented yet");        Paso_setError(TYPE_ERROR,"Paso_SystemMatrixPattern_unrollBlocks: conversion between symmetric and non-symmetric is not implemented yet");
42        return NULL;        return NULL;
43    }    }
   Paso_SystemMatrixPattern*out=NULL;  
   index_t *ptr=NULL,*index=NULL,iPtr;  
   dim_t i,j,k,l;  
44    Paso_resetError();    Paso_resetError();
45    dim_t block_size=row_block_size*col_block_size;    block_size=row_block_size*col_block_size;
46    dim_t new_n_ptr=(pattern->n_ptr)*row_block_size;    new_n_ptr=(pattern->n_ptr)*row_block_size;
47    dim_t new_len=(pattern->len)*block_size;    new_len=(pattern->len)*block_size;
48    
49    ptr=MEMALLOC(new_n_ptr+1,index_t);    ptr=MEMALLOC(new_n_ptr+1,index_t);
50    index=MEMALLOC(new_len,index_t);    index=MEMALLOC(new_len,index_t);
# Line 79  Paso_SystemMatrixPattern* Paso_SystemMat Line 79  Paso_SystemMatrixPattern* Paso_SystemMat
79          }          }
80       }       }
81       /* create return value */       /* create return value */
82       out=Paso_SystemMatrixPattern_alloc(type,new_n_ptr,ptr,index,pattern->MPIInfo);       out=Paso_SystemMatrixPattern_alloc(type,new_n_ptr,ptr,index);
83    }      }  
84    if (! Paso_noError()) {    if (! Paso_noError()) {
85       MEMFREE(index);       MEMFREE(index);

Legend:
Removed from v.969  
changed lines
  Added in v.1028

  ViewVC Help
Powered by ViewVC 1.1.26