Changeset 13914


Ignore:
Timestamp:
11/08/12 14:55:06 (12 years ago)
Author:
Mathieu Morlighem
Message:

NEW: printsparsity now prints number of non zero per row

File:
1 edited

Legend:

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

    r13901 r13914  
    1414}
    1515void printsparsity(IssmPDouble* array,int lines,int cols){
     16        int count;
    1617        _printLine_("");
    1718        for(int i=0;i<lines;i++){ 
    1819                _printString_("   [ ");
     20                count = 0;
    1921                for(int j=0;j<cols;j++){
    20                         if(array[i*cols+j]!=0.0)
    21                          _printString_( " X");
     22                        if(array[i*cols+j]!=0.0){
     23                                _printString_( " X"); count++;
     24                        }
    2225                        else
    2326                         _printString_( " .");
    2427                }
    25                 _printLine_(" ]");
     28                _printLine_(" ] "<<i<<" => "<<count);
    2629        } 
    2730        _printLine_("");
Note: See TracChangeset for help on using the changeset viewer.