Changeset 1884035 in tol


Ignore:
Timestamp:
Mar 11, 2009, 3:45:51 PM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
f2ee099
Parents:
5caf40f
Message:

Ensuring subtype is triplet and items is not empty in method BVMat::MergeRows

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

File:
1 edited

Legend:

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

    r5caf40f r1884035  
    885885  BArray<BVMat*> a_(N);
    886886  BArray< BArray<int> > rowIndex(N);
    887   int ncol;
     887  int ncol=0;
    888888  for(n=0; n<N; n++)
    889889  {
    … …  
    914914      continue;
    915915    }
    916     a_[n] = a[n];
     916    if(a[n]->code_ == ESC_chlmRtriplet)
     917    {
     918      a_[n] = a[n];
     919    }
     920    else
     921    {
     922      a_[n] = new BVMat;
     923      a_[n]->Convert(*a[n], ESC_chlmRtriplet);
     924    }
    917925    if(!n) { ncol = a_[n]->s_.chlmRtriplet_->ncol; }
    918926    else if (ncol != a_[n]->s_.chlmRtriplet_->ncol)
    … …  
    920928      err_cannot_create(fName,
    921929        BText("Number of columns is not equal to previous for item number ")+(n+1));
    922       result = -4;
     930      result = -5;
    923931      continue;
    924932    }
    … …  
    930938      err_cannot_create(fName,
    931939        BText("Number of rows is not equal to card of row indexes at item number ")+(n+1));
    932       result = -5;
     940      result = -6;
    933941      continue;
    934     }
    935     if(a[n]->code_ != ESC_chlmRtriplet)
    936     {
    937       BVMat* a__ = new BVMat;
    938       a__->Convert(*a[n], ESC_chlmRtriplet);
    939       a_[n] = a__;
    940942    }
    941943    if(a_[n]->s_.chlmRtriplet_->nnz)
    … …  
    969971    }
    970972  }
    971   else
    972   {
     973  else if(N)
     974  {
     975    assert(ncol);
    973976    ChlmRTriplet(nrow, ncol, nzmax);
    974977    s_.chlmRtriplet_->nnz = nnz;
Note: See TracChangeset for help on using the changeset viewer.