/[escript]/trunk/paso/src/SparseMatrix_getSubmatrix.cpp
ViewVC logotype

Diff of /trunk/paso/src/SparseMatrix_getSubmatrix.cpp

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

revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC revision 3642 by caltinay, Thu Oct 27 03:41:51 2011 UTC
# Line 29  Line 29 
29    
30  /**************************************************************  /**************************************************************
31    
32      returns the submatrix of A where rows are gathered by index row_list      Returns the submatrix of A where rows are gathered by index row_list
33      and columns are selected by non-negative values of new_col_index.      and columns are selected by non-negative values of new_col_index.
34      if new_col_index[i]>-1 new_col_index[i] gives the column of i in      If new_col_index[i]>-1 new_col_index[i] gives the column of i in
35      the returned submatrix      the returned submatrix.
   
36  */  */
37    
38    
# Line 45  Paso_SparseMatrix* Paso_SparseMatrix_get Line 44  Paso_SparseMatrix* Paso_SparseMatrix_get
44        int type=A->type;        int type=A->type;
45        Esys_resetError();        Esys_resetError();
46        if (A->type & MATRIX_FORMAT_CSC) {        if (A->type & MATRIX_FORMAT_CSC) {
47            Esys_setError(TYPE_ERROR,"gathering submatrices supports CSR matrix format only.");            Esys_setError(TYPE_ERROR, "Paso_SparseMatrix_getSubmatrix: gathering submatrices supports CSR matrix format only.");
48        } else {        } else {
49           sub_pattern=Paso_Pattern_getSubpattern(A->pattern,n_row_sub,n_col_sub,row_list,new_col_index);           sub_pattern=Paso_Pattern_getSubpattern(A->pattern,n_row_sub,n_col_sub,row_list,new_col_index);
50           if (Esys_noError()) {           if (Esys_noError()) {
# Line 95  Paso_SparseMatrix* Paso_SparseMatrix_get Line 94  Paso_SparseMatrix* Paso_SparseMatrix_get
94                    }                    }
95              }              }
96              else {              else {
97                    Esys_setError(VALUE_ERROR,"Requested and actual block sizes do not match.");                    Esys_setError(VALUE_ERROR, "Paso_SparseMatrix_getBlock: Requested and actual block sizes do not match.");
98              }              }
99        }        }
100        else if (blocksize==2) {        else if (blocksize==2) {
# Line 116  Paso_SparseMatrix* Paso_SparseMatrix_get Line 115  Paso_SparseMatrix* Paso_SparseMatrix_get
115                    }                    }
116              }              }
117              else {              else {
118                    Esys_setError(VALUE_ERROR,"Requested and actual block sizes do not match.");                    Esys_setError(VALUE_ERROR,"Paso_SparseMatrix_getBlock: Requested and actual block sizes do not match.");
119              }              }
120        }        }
121        else if (blocksize==3) {        else if (blocksize==3) {
# Line 145  Paso_SparseMatrix* Paso_SparseMatrix_get Line 144  Paso_SparseMatrix* Paso_SparseMatrix_get
144                    }                    }
145              }              }
146              else {              else {
147                    Esys_setError(VALUE_ERROR,"Requested and actual block sizes do not match.");                    Esys_setError(VALUE_ERROR,"Paso_SparseMatrix_getBlock: Requested and actual block sizes do not match.");
148              }              }
149        }        }
150                            
151           return  out;           return out;
152  }  }

Legend:
Removed from v.3259  
changed lines
  Added in v.3642

  ViewVC Help
Powered by ViewVC 1.1.26