Changeset 5b13774 in tol


Ignore:
Timestamp:
Aug 26, 2009, 9:50:42 AM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
0fcdd1d
Parents:
b4b5301
Message:

Enabling warning message of inefficient use when matrices are converted to dense

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1248 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/vmatrix_type/vmat_io.cpp

    rb4b5301 r5b13774  
    7676}
    7777
    78 //#define DO_WARN_INEF_USE
     78#define DO_WARN_INEF_USE
     79#ifdef DO_WARN_INEF_USE
     80  #define DO_WARN_INEF_USE_all2bRd
     81//#define DO_WARN_INEF_USEall_all2cRs
     82//#define DO_WARN_INEF_USE_2cRt
     83#endif
    7984
    8085
    … …  
    9499////////////////////////////////////////////////////////////////////////////////
    95100{
    96 #ifdef DO_WARN_INEF_USE
     101#ifdef DO_WARN_INEF_USE_2cRt
    97102  static double minStoredCells_ = 1000.0;
    98103  double storedCells = a.StoredCells();
    … …  
    113118////////////////////////////////////////////////////////////////////////////////
    114119{
    115 #ifdef DO_WARN_INEF_USE
     120#ifdef DO_WARN_INEF_USEall_all2cRs
    116121  static double minStoredCells_ = 1000.0;
    117122  double storedCells = a.StoredCells();
    … …  
    119124  {
    120125    warn_inefUse(I2("Converting to","Convirtiendo matriz a")+
    121             " Blas.R.Sparse "+CodeName(a.code_)+" "+
     126            " Cholmod.R.Sparse "+CodeName(a.code_)+" "+
    122127            I2("to apply","para aplicar")+" "+fName+" "+
    123128            I2("to a virtual matrix","a una matriz virtual")+
    … …  
    132137////////////////////////////////////////////////////////////////////////////////
    133138{
    134 #ifdef DO_WARN_INEF_USE
     139#ifdef DO_WARN_INEF_USE_all2bRd
    135140  static double minLostCells_ = 1000.0;
     141  int    r = a.Rows();
     142  int    c = a.Columns();
    136143  double storedCells = a.StoredCells();
    137   double denseCells  = a.Rows()*a.Columns();
     144  double denseCells  = r*c;
    138145  double lostCells   = denseCells-storedCells;
    139   if(lostCells>=minLostCells_)
     146  if( ((r>1)&&(c>1)) && (lostCells>=minLostCells_) )
    140147  {
    141148    double memKbLost = (lostCells*sizeof(double))/1024.0;
    … …  
    144151      I2("to apply","para aplicar")+" "+fName+" "+
    145152      I2("to a virtual matrix","a una matriz virtual")+
    146       " "+CodeName(a.code_)+"("+a.Rows()+"x"+a.Columns()+")"+" "+
     153      " "+CodeName(a.code_)+"("+r+"x"+c+")"+" "+
    147154      I2("with","con")+" "+storedCells+
    148155      I2("stored cells","celdas almacendas")+".\n"+
Note: See TracChangeset for help on using the changeset viewer.