Changeset 658


Ignore:
Timestamp:
Aug 21, 2005 3:30:31 AM (15 years ago)
Author:
forrest
Message:

bug fix

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpPlusMinusOneMatrix.cpp

    r570 r658  
    77#include "CoinPragma.hpp"
    88#include "CoinIndexedVector.hpp"
     9#include "CoinPackedVector.hpp"
    910#include "CoinHelperFunctions.hpp"
    1011
     
    19131914    startNegative_=temp;
    19141915  }
    1915 
    1916  
    1917 }
     1916}
     1917#ifndef SLIM_CLP
     1918/* Append a set of rows/columns to the end of the matrix. Returns number of errors
     1919   i.e. if any of the new rows/columns contain an index that's larger than the
     1920   number of columns-1/rows-1 (if numberOther>0) or duplicates
     1921   If 0 then rows, 1 if columns */
     1922int
     1923ClpPlusMinusOneMatrix::appendMatrix(int number, int type,
     1924                                    const CoinBigIndex * starts, const int * index,
     1925                                    const double * element, int numberOther)
     1926{
     1927  int numberErrors=0;
     1928  // make into CoinPackedVector
     1929  CoinPackedVectorBase ** vectors=
     1930    new CoinPackedVectorBase * [number];
     1931  int iVector;
     1932  for (iVector=0;iVector<number;iVector++) {
     1933    int iStart = starts[iVector];
     1934    vectors[iVector] =
     1935      new CoinPackedVector(starts[iVector+1]-iStart,
     1936                           index+iStart,element+iStart);
     1937  }
     1938  if (type==0) {
     1939    // rows
     1940    appendRows(number,vectors);
     1941  } else {
     1942    // columns
     1943    appendCols(number,vectors);
     1944  }
     1945  for (iVector=0;iVector<number;iVector++)
     1946    delete vectors[iVector];
     1947  delete [] vectors;
     1948  return numberErrors;
     1949}
     1950#endif
  • trunk/include/ClpPlusMinusOneMatrix.hpp

    r563 r658  
    5757  /// Append Rows
    5858  virtual void appendRows(int number, const CoinPackedVectorBase * const * rows);
     59#ifndef SLIM_CLP
     60  /** Append a set of rows/columns to the end of the matrix. Returns number of errors
     61      i.e. if any of the new rows/columns contain an index that's larger than the
     62      number of columns-1/rows-1 (if numberOther>0) or duplicates
     63      If 0 then rows, 1 if columns */
     64  virtual int appendMatrix(int number, int type,
     65                           const CoinBigIndex * starts, const int * index,
     66                           const double * element, int numberOther=-1);
     67#endif
    5968  /** Returns a new matrix in reverse order without gaps */
    6069  virtual ClpMatrixBase * reverseOrderedCopy() const;
Note: See TracChangeset for help on using the changeset viewer.