Changeset 13901


Ignore:
Timestamp:
11/07/12 16:23:29 (12 years ago)
Author:
Mathieu Morlighem
Message:

NEW: added printsparsity, very useful to debug memory allocation module

Location:
issm/trunk-jpl/src/c/shared/Elements
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/Elements/PrintArrays.cpp

    r12835 r13901  
    99                _printString_("   [ ");
    1010                for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
     11                _printLine_(" ]");
     12        } 
     13        _printLine_("");
     14}
     15void printsparsity(IssmPDouble* array,int lines,int cols){
     16        _printLine_("");
     17        for(int i=0;i<lines;i++){ 
     18                _printString_("   [ ");
     19                for(int j=0;j<cols;j++){
     20                        if(array[i*cols+j]!=0.0)
     21                         _printString_( " X");
     22                        else
     23                         _printString_( " .");
     24                }
    1125                _printLine_(" ]");
    1226        } 
  • issm/trunk-jpl/src/c/shared/Elements/elements.h

    r12835 r13901  
    4040void printarray(IssmPDouble* array,int lines,int cols=1);
    4141void printarray(int* array,int lines,int cols=1);
     42void printsparsity(IssmPDouble* array,int lines,int cols=1);
    4243void printbinary(int n);
    4344#endif //ifndef _SHARED_ELEMENTS_H_
Note: See TracChangeset for help on using the changeset viewer.