/[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 432 by gross, Fri Jan 13 07:38:54 2006 UTC revision 1028 by gross, Wed Mar 14 00:15:24 2007 UTC
# Line 1  Line 1 
1  /* $Id$ */  /* $Id$ */
2    
3    /*
4    ********************************************************************************
5    *               Copyright   2006 by ACcESS MNRF                                *
6    *                                                                              *
7    *                 http://www.access.edu.au                                     *
8    *           Primary Business: Queensland, Australia                            *
9    *     Licensed under the Open Software License version 3.0             *
10    *        http://www.opensource.org/licenses/osl-3.0.php                        *
11    ********************************************************************************
12    */
13    
14  /**************************************************************/  /**************************************************************/
15    
16  /* Paso: SystemMatrixPatternPattern */  /* Paso: SystemMatrixPatternPattern */
# Line 20  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 27  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);

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

  ViewVC Help
Powered by ViewVC 1.1.26