示例#1
0
/* Load in an problem by copying the arguments (the constraints on the
   rows are given by lower and upper bounds). If a pointer is NULL then the
   following values are the default:
   <ul>
   <li> <code>colub</code>: all columns have upper bound infinity
   <li> <code>collb</code>: all columns have lower bound 0 
   <li> <code>rowub</code>: all rows have upper bound infinity
   <li> <code>rowlb</code>: all rows have lower bound -infinity
   <li> <code>obj</code>: all variables have 0 objective coefficient
      </ul>
*/
void 
CoinSnapshot::loadProblem(const CoinPackedMatrix& matrix,
			  const double* collb, const double* colub,   
			  const double* obj,
			  const double* rowlb, const double* rowub,
			  bool makeRowCopy)
{
  // Keep scalars (apart from objective value etc)
  gutsOfDestructor(3+8);
  numRows_ = matrix.getNumRows();
  numCols_ = matrix.getNumCols();
  numElements_ = matrix.getNumElements();
  owned_.matrixByCol = 1;
  matrixByCol_ = new CoinPackedMatrix(matrix);
  if (makeRowCopy) {
    owned_.matrixByRow = 1;
    CoinPackedMatrix * matrixByRow = new CoinPackedMatrix(matrix);
    matrixByRow->reverseOrdering();
    matrixByRow_ = matrixByRow;
  }
  colLower_ = CoinCopyOfArray(collb,numCols_,0.0);
  colUpper_ = CoinCopyOfArray(colub,numCols_,infinity_);
  objCoefficients_ = CoinCopyOfArray(obj,numCols_,0.0);
  rowLower_ = CoinCopyOfArray(rowlb,numRows_,-infinity_);
  rowUpper_ = CoinCopyOfArray(rowub,numRows_,infinity_);
  // do rhs as well
  createRightHandSide();
}
示例#2
0
//----------------------------------------------------------------
// Assignment operator 
//-------------------------------------------------------------------
OsiCuts &
OsiCuts::operator=(const OsiCuts& rhs)
{
  if (this != &rhs) {
    gutsOfDestructor();
    gutsOfCopy( rhs );
  }
  return *this;
}
示例#3
0
//----------------------------------------------------------------
// Assignment operator 
//-------------------------------------------------------------------
CoinSnapshot &
CoinSnapshot::operator=(const CoinSnapshot& rhs)
{
  if (this != &rhs) {
    gutsOfDestructor(15);
    gutsOfCopy(rhs);
  }
  return *this;
}
示例#4
0
 void
  TMINLPLinObj::setTminlp(SmartPtr<TMINLP> tminlp){
     gutsOfDestructor();
     tminlp_ = tminlp;
     int n,m, nnz_jac, nnz_h;
     Ipopt::TNLP::IndexStyleEnum index_style;
     tminlp_->get_nlp_info(n, m , nnz_jac, nnz_h, index_style);
     offset_ = index_style == Ipopt::TNLP::FORTRAN_STYLE;
     n_ = n+1;
     m_ = m+1;
     nnz_jac_ = nnz_jac + n + 1;
 }
 //@{
 /// Get rid of all memory
 inline void clearArrays() override
 { gutsOfDestructor();}
 //@{
 /// Get rid of all memory
 inline void clearArrays()
 { gutsOfDestructor();}
示例#7
0
 TMINLPLinObj::~TMINLPLinObj(){
 gutsOfDestructor();}
示例#8
0
//-------------------------------------------------------------------
// Destructor 
//-------------------------------------------------------------------
OsiCuts::~OsiCuts ()
{
  gutsOfDestructor();
}
示例#9
0
//-------------------------------------------------------------------
// Destructor 
//-------------------------------------------------------------------
CoinSnapshot::~CoinSnapshot ()
{
  gutsOfDestructor(15);
}
示例#10
0
//-------------------------------------------------------------------
// Copy constructor 
//-------------------------------------------------------------------
CoinSnapshot::CoinSnapshot (const CoinSnapshot & rhs) 
{
  gutsOfDestructor(13);
  gutsOfCopy(rhs);
}
示例#11
0
//-------------------------------------------------------------------
// Default Constructor 
//-------------------------------------------------------------------
CoinSnapshot::CoinSnapshot () 
{
  gutsOfDestructor(13);
}
示例#12
0
 ~StartPointReader()
 {
   gutsOfDestructor();
 }