- Timestamp:
- Sep 16, 2002 1:54:29 AM (17 years ago)
- Location:
- branches/devel-1
- Files:
-
- 1 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-1/ClpDualRowDantzig.cpp
r2 r19 9 9 #include "ClpSimplex.hpp" 10 10 #include "ClpDualRowDantzig.hpp" 11 #include " OsiIndexedVector.hpp"11 #include "CoinIndexedVector.hpp" 12 12 13 13 //############################################################################# … … 86 86 */ 87 87 void 88 ClpDualRowDantzig::updatePrimalSolution( 89 OsiIndexedVector * primalUpdate, 88 ClpDualRowDantzig::updatePrimalSolution(CoinIndexedVector * primalUpdate, 90 89 double primalRatio, 91 90 double & objectiveChange) -
branches/devel-1/ClpDualRowPivot.cpp
r2 r19 66 66 67 67 void 68 ClpDualRowPivot::updateWeights( OsiIndexedVector * input,69 OsiIndexedVector * spare,70 OsiIndexedVector * updatedColumn)68 ClpDualRowPivot::updateWeights(CoinIndexedVector * input, 69 CoinIndexedVector * spare, 70 CoinIndexedVector * updatedColumn) 71 71 { 72 72 } -
branches/devel-1/ClpDualRowSteepest.cpp
r17 r19 9 9 #include "ClpSimplex.hpp" 10 10 #include "ClpDualRowSteepest.hpp" 11 #include " OsiIndexedVector.hpp"11 #include "CoinIndexedVector.hpp" 12 12 #include "ClpFactorization.hpp" 13 13 #include "CoinHelperFunctions.hpp" 14 #include < stdio.h>14 #include <cstdio> 15 15 16 16 //############################################################################# … … 43 43 model_ = rhs.model_; 44 44 if (rhs.infeasible_) { 45 infeasible_= new OsiIndexedVector(rhs.infeasible_);45 infeasible_= new CoinIndexedVector(rhs.infeasible_); 46 46 } else { 47 47 infeasible_=NULL; … … 56 56 } 57 57 if (rhs.alternateWeights_) { 58 alternateWeights_= new OsiIndexedVector(rhs.alternateWeights_);58 alternateWeights_= new CoinIndexedVector(rhs.alternateWeights_); 59 59 } else { 60 60 alternateWeights_=NULL; 61 61 } 62 62 if (rhs.savedWeights_) { 63 savedWeights_= new OsiIndexedVector(rhs.savedWeights_);63 savedWeights_= new CoinIndexedVector(rhs.savedWeights_); 64 64 } else { 65 65 savedWeights_=NULL; … … 94 94 delete savedWeights_; 95 95 if (rhs.infeasible_!=NULL) { 96 infeasible_= new OsiIndexedVector(rhs.infeasible_);96 infeasible_= new CoinIndexedVector(rhs.infeasible_); 97 97 } else { 98 98 infeasible_=NULL; … … 107 107 } 108 108 if (rhs.alternateWeights_!=NULL) { 109 alternateWeights_= new OsiIndexedVector(rhs.alternateWeights_);109 alternateWeights_= new CoinIndexedVector(rhs.alternateWeights_); 110 110 } else { 111 111 alternateWeights_=NULL; 112 112 } 113 113 if (rhs.savedWeights_!=NULL) { 114 savedWeights_= new OsiIndexedVector(rhs.savedWeights_);114 savedWeights_= new CoinIndexedVector(rhs.savedWeights_); 115 115 } else { 116 116 savedWeights_=NULL; … … 153 153 // Updates weights 154 154 void 155 ClpDualRowSteepest::updateWeights( OsiIndexedVector * input,156 OsiIndexedVector * spare,157 OsiIndexedVector * updatedColumn)155 ClpDualRowSteepest::updateWeights(CoinIndexedVector * input, 156 CoinIndexedVector * spare, 157 CoinIndexedVector * updatedColumn) 158 158 { 159 159 // clear other region … … 172 172 { 173 173 int numberRows = model_->numberRows(); 174 OsiIndexedVector * temp = new OsiIndexedVector();174 CoinIndexedVector * temp = new CoinIndexedVector(); 175 175 temp->reserve(numberRows+ 176 176 model_->factorization()->maximumPivots()); … … 265 265 void 266 266 ClpDualRowSteepest::updatePrimalSolution( 267 OsiIndexedVector * primalUpdate,267 CoinIndexedVector * primalUpdate, 268 268 double primalRatio, 269 269 double & objectiveChange) … … 352 352 delete alternateWeights_; 353 353 weights_ = new double[numberRows]; 354 alternateWeights_ = new OsiIndexedVector();354 alternateWeights_ = new CoinIndexedVector(); 355 355 // enough space so can use it for factorization 356 356 alternateWeights_->reserve(numberRows+ … … 362 362 } 363 363 } else { 364 OsiIndexedVector * temp = new OsiIndexedVector();364 CoinIndexedVector * temp = new CoinIndexedVector(); 365 365 temp->reserve(numberRows+ 366 366 model_->factorization()->maximumPivots()); … … 387 387 } 388 388 // create saved weights (not really indexedvector) 389 savedWeights_ = new OsiIndexedVector();389 savedWeights_ = new CoinIndexedVector(); 390 390 savedWeights_->reserve(numberRows); 391 391 … … 428 428 // set up infeasibilities 429 429 if (!infeasible_) { 430 infeasible_ = new OsiIndexedVector();430 infeasible_ = new CoinIndexedVector(); 431 431 infeasible_->reserve(numberRows); 432 432 } -
branches/devel-1/ClpFactorization.cpp
r15 r19 19 19 // Default Constructor 20 20 //------------------------------------------------------------------- 21 ClpFactorization::ClpFactorization () 22 : OsiFactorization() 23 { 24 } 21 ClpFactorization::ClpFactorization () : 22 CoinFactorization() {} 25 23 26 24 //------------------------------------------------------------------- 27 25 // Copy constructor 28 26 //------------------------------------------------------------------- 29 ClpFactorization::ClpFactorization (const ClpFactorization & rhs) 30 : OsiFactorization(rhs) 31 { 32 33 } 27 ClpFactorization::ClpFactorization (const ClpFactorization & rhs) : 28 CoinFactorization(rhs) {} 34 29 35 ClpFactorization::ClpFactorization (const OsiFactorization & rhs) 36 : OsiFactorization(rhs) 37 { 38 39 } 30 ClpFactorization::ClpFactorization (const CoinFactorization & rhs) : 31 CoinFactorization(rhs) {} 40 32 41 33 //------------------------------------------------------------------- 42 34 // Destructor 43 35 //------------------------------------------------------------------- 44 ClpFactorization::~ClpFactorization () 45 { 46 } 36 ClpFactorization::~ClpFactorization () {} 47 37 48 38 //---------------------------------------------------------------- … … 53 43 { 54 44 if (this != &rhs) { 55 OsiFactorization::operator=(rhs);45 CoinFactorization::operator=(rhs); 56 46 } 57 47 return *this; … … 70 60 areaFactor_ = areaFactor; 71 61 int numberBasic = 0; 72 OsiBigIndex numberElements=0;62 ClpBigIndex numberElements=0; 73 63 int numberRowBasic=0; 74 64 -
branches/devel-1/ClpMessage.cpp
r15 r19 61 61 /* Constructor */ 62 62 ClpMessage::ClpMessage(Language language) : 63 OsiMessages(sizeof(us_english)/sizeof(Clp_message))63 CoinMessages(sizeof(us_english)/sizeof(Clp_message)) 64 64 { 65 65 language_=language; … … 68 68 69 69 while (message->internalNumber!=CLP_DUMMY_END) { 70 OsiOneMessage oneMessage(message->externalNumber,message->detail,71 message->message);72 addMessage(message->internalNumber,oneMessage);73 message ++;70 CoinOneMessage oneMessage(message->externalNumber,message->detail, 71 message->message); 72 addMessage(message->internalNumber,oneMessage); 73 message ++; 74 74 } 75 75 -
branches/devel-1/ClpModel.cpp
r17 r19 6 6 #endif 7 7 8 #include <math.h> 8 #include <cmath> 9 #include <cassert> 10 #include <cfloat> 11 #include <string> 12 #include <cstdio> 13 #include <iostream> 14 15 #include <time.h> 16 #include <sys/times.h> 17 #include <sys/resource.h> 18 #include <unistd.h> 9 19 10 20 #include "CoinHelperFunctions.hpp" 11 21 #include "ClpModel.hpp" 12 22 #include "ClpPackedMatrix.hpp" 13 #include " OsiIndexedVector.hpp"14 #include " OsiMpsReader.hpp"23 #include "CoinIndexedVector.hpp" 24 #include "CoinMpsIO.hpp" 15 25 #include "ClpMessage.hpp" 16 #include <cassert> 17 #include <cfloat> 18 19 #include <string> 20 #include <stdio.h> 21 #include <iostream> 22 #include <time.h> 23 #include <sys/times.h> 24 #include <sys/resource.h> 25 #include <unistd.h> 26 26 27 // This returns a non const array filled with input from scalar 27 28 // or actual array … … 96 97 integerType_(NULL) 97 98 { 98 intParam_[ OsiMaxNumIteration] = 9999999;99 intParam_[ OsiMaxNumIterationHotStart] = 9999999;100 101 dblParam_[ OsiDualObjectiveLimit] = DBL_MAX;102 dblParam_[ OsiPrimalObjectiveLimit] = DBL_MAX;103 dblParam_[ OsiDualTolerance] = 1e-7;104 dblParam_[ OsiPrimalTolerance] = 1e-7;105 dblParam_[ OsiObjOffset] = 0.0;106 107 strParam_[ OsiProbName] = "OsiDefaultName";108 handler_ = new OsiMessageHandler();99 intParam_[ClpMaxNumIteration] = 9999999; 100 intParam_[ClpMaxNumIterationHotStart] = 9999999; 101 102 dblParam_[ClpDualObjectiveLimit] = DBL_MAX; 103 dblParam_[ClpPrimalObjectiveLimit] = DBL_MAX; 104 dblParam_[ClpDualTolerance] = 1e-7; 105 dblParam_[ClpPrimalTolerance] = 1e-7; 106 dblParam_[ClpObjOffset] = 0.0; 107 108 strParam_[ClpProbName] = "ClpDefaultName"; 109 handler_ = new CoinMessageHandler(); 109 110 handler_->setLogLevel(2); 110 111 messages_ = ClpMessage(); … … 156 157 { 157 158 if (value>0.0&&value<1.0e10) 158 dblParam_[ OsiPrimalTolerance]=value;159 dblParam_[ClpPrimalTolerance]=value; 159 160 } 160 161 void ClpModel::setDualTolerance( double value) 161 162 { 162 163 if (value>0.0&&value<1.0e10) 163 dblParam_[ OsiDualTolerance]=value;164 dblParam_[ClpDualTolerance]=value; 164 165 } 165 166 void ClpModel::setOptimizationDirection( int value) … … 226 227 } else { 227 228 // later may want to keep as unknown class 228 OsiPackedMatrix matrix2;229 CoinPackedMatrix matrix2; 229 230 matrix2.reverseOrderedCopyOf(*matrix.getPackedMatrix()); 230 231 matrix.releasePackedMatrix(); … … 233 234 } 234 235 void 235 ClpModel::loadProblem ( const OsiPackedMatrix& matrix,236 ClpModel::loadProblem ( const CoinPackedMatrix& matrix, 236 237 const double* collb, const double* colub, 237 238 const double* obj, … … 244 245 matrix_=new ClpPackedMatrix(matrix); 245 246 } else { 246 OsiPackedMatrix matrix2;247 CoinPackedMatrix matrix2; 247 248 matrix2.reverseOrderedCopyOf(matrix); 248 249 matrix_=new ClpPackedMatrix(matrix2); … … 261 262 gutsOfLoadModel(numrows, numcols, 262 263 collb, colub, obj, rowlb, rowub, rowObjective); 263 OsiPackedMatrix matrix(true,numrows,numcols,start[numcols],264 CoinPackedMatrix matrix(true,numrows,numcols,start[numcols], 264 265 value,index,start,NULL); 265 266 matrix_ = new ClpPackedMatrix(matrix); … … 307 308 defaultHandler_ = rhs.defaultHandler_; 308 309 if (defaultHandler_) 309 handler_ = new OsiMessageHandler(*rhs.handler_);310 handler_ = new CoinMessageHandler(*rhs.handler_); 310 311 else 311 312 handler_ = rhs.handler_; 312 313 messages_ = rhs.messages_; 313 intParam_[ OsiMaxNumIteration] = rhs.intParam_[OsiMaxNumIteration];314 intParam_[ OsiMaxNumIterationHotStart] =315 rhs.intParam_[ OsiMaxNumIterationHotStart];316 317 dblParam_[ OsiDualObjectiveLimit] = rhs.dblParam_[OsiDualObjectiveLimit];318 dblParam_[ OsiPrimalObjectiveLimit] = rhs.dblParam_[OsiPrimalObjectiveLimit];319 dblParam_[ OsiDualTolerance] = rhs.dblParam_[OsiDualTolerance];320 dblParam_[ OsiPrimalTolerance] = rhs.dblParam_[OsiPrimalTolerance];321 dblParam_[ OsiObjOffset] = rhs.dblParam_[OsiObjOffset];322 323 strParam_[ OsiProbName] = rhs.strParam_[OsiProbName];314 intParam_[ClpMaxNumIteration] = rhs.intParam_[ClpMaxNumIteration]; 315 intParam_[ClpMaxNumIterationHotStart] = 316 rhs.intParam_[ClpMaxNumIterationHotStart]; 317 318 dblParam_[ClpDualObjectiveLimit] = rhs.dblParam_[ClpDualObjectiveLimit]; 319 dblParam_[ClpPrimalObjectiveLimit] = rhs.dblParam_[ClpPrimalObjectiveLimit]; 320 dblParam_[ClpDualTolerance] = rhs.dblParam_[ClpDualTolerance]; 321 dblParam_[ClpPrimalTolerance] = rhs.dblParam_[ClpPrimalTolerance]; 322 dblParam_[ClpObjOffset] = rhs.dblParam_[ClpObjOffset]; 323 324 strParam_[ClpProbName] = rhs.strParam_[ClpProbName]; 324 325 325 326 objectiveValue_=rhs.objectiveValue_; … … 442 443 443 444 bool 444 ClpModel::setIntParam( OsiIntParam key, int value)445 ClpModel::setIntParam(ClpIntParam key, int value) 445 446 { 446 447 switch (key) { 447 case OsiMaxNumIteration:448 case ClpMaxNumIteration: 448 449 if (value < 0) 449 450 return false; 450 451 break; 451 case OsiMaxNumIterationHotStart:452 case ClpMaxNumIterationHotStart: 452 453 if (value < 0) 453 454 return false; 454 455 break; 455 case OsiLastIntParam:456 case ClpLastIntParam: 456 457 return false; 457 458 } … … 463 464 464 465 bool 465 ClpModel::setDblParam( OsiDblParam key, double value)466 ClpModel::setDblParam(ClpDblParam key, double value) 466 467 { 467 468 468 469 switch (key) { 469 case OsiDualObjectiveLimit:470 case ClpDualObjectiveLimit: 470 471 break; 471 472 472 case OsiPrimalObjectiveLimit:473 case ClpPrimalObjectiveLimit: 473 474 break; 474 475 475 case OsiDualTolerance:476 case ClpDualTolerance: 476 477 if (value<=0.0||value>1.0e10) 477 478 return false; 478 479 break; 479 480 480 case OsiPrimalTolerance:481 case ClpPrimalTolerance: 481 482 if (value<=0.0||value>1.0e10) 482 483 return false; 483 484 break; 484 485 485 case OsiObjOffset:486 case ClpObjOffset: 486 487 break; 487 488 488 case OsiLastDblParam:489 case ClpLastDblParam: 489 490 return false; 490 491 } … … 496 497 497 498 bool 498 ClpModel::setStrParam( OsiStrParam key, const std::string & value)499 ClpModel::setStrParam(ClpStrParam key, const std::string & value) 499 500 { 500 501 501 502 switch (key) { 502 case OsiProbName:503 case ClpProbName: 503 504 break; 504 505 505 case OsiLastStrParam:506 case ClpLastStrParam: 506 507 return false; 507 508 } … … 723 724 // Pass in Message handler (not deleted at end) 724 725 void 725 ClpModel::passInMessageHandler( OsiMessageHandler * handler)726 ClpModel::passInMessageHandler(CoinMessageHandler * handler) 726 727 { 727 728 defaultHandler_=false; … … 730 731 // Set language 731 732 void 732 ClpModel::newLanguage( OsiMessages::Language language)733 ClpModel::newLanguage(CoinMessages::Language language) 733 734 { 734 735 messages_ = ClpMessage(language); … … 753 754 } else { 754 755 handler_->message(CLP_UNABLE_OPEN,messages_) 755 <<fileName<< OsiMessageEol;756 <<fileName<<CoinMessageEol; 756 757 return -1; 757 758 } 758 759 } 759 OsiMpsReaderm;760 CoinMpsIO m; 760 761 double time1 = cpuTime(),time2; 761 762 int status=m.readMps(fileName,""); … … 772 773 } 773 774 // set problem name 774 setStrParam( OsiProbName,m.getProblemName());775 setStrParam(ClpProbName,m.getProblemName()); 775 776 // do names 776 777 if (keepNames) { … … 795 796 lengthNames_=0; 796 797 } 797 setDblParam( OsiObjOffset,m.objectiveOffset());798 setDblParam(ClpObjOffset,m.objectiveOffset()); 798 799 time2 = cpuTime(); 799 800 handler_->message(CLP_IMPORT_RESULT,messages_) 800 801 <<fileName 801 <<time2-time1<< OsiMessageEol;802 <<time2-time1<<CoinMessageEol; 802 803 } else { 803 804 // errors 804 805 handler_->message(CLP_IMPORT_ERRORS,messages_) 805 <<status<<fileName<< OsiMessageEol;806 <<status<<fileName<<CoinMessageEol; 806 807 } 807 808 … … 811 812 { 812 813 double limit = 0.0; 813 getDblParam( OsiPrimalObjectiveLimit, limit);814 getDblParam(ClpPrimalObjectiveLimit, limit); 814 815 if (limit > 1e30) { 815 816 // was not ever set … … 832 833 833 834 double limit = 0.0; 834 getDblParam( OsiDualObjectiveLimit, limit);835 getDblParam(ClpDualObjectiveLimit, limit); 835 836 if (limit > 1e30) { 836 837 // was not ever set -
branches/devel-1/ClpNonLinearCost.cpp
r8 r19 8 8 #include <iostream> 9 9 10 #include "CoinIndexedVector.hpp" 11 10 12 #include "ClpNonLinearCost.hpp" 11 13 #include "ClpSimplex.hpp" 12 #include "OsiIndexedVector.hpp"13 14 14 15 //############################################################################# … … 447 448 } 448 449 void 449 ClpNonLinearCost::goBackAll(const OsiIndexedVector * update)450 ClpNonLinearCost::goBackAll(const CoinIndexedVector * update) 450 451 { 451 452 assert (model_!=NULL); … … 502 503 for costs. 503 504 On input array is empty (but indices exist). On exit just 504 changed costs will be stored as normal OsiIndexedVector505 changed costs will be stored as normal CoinIndexedVector 505 506 */ 506 507 void 507 ClpNonLinearCost::checkChanged(int numberInArray, OsiIndexedVector * update)508 ClpNonLinearCost::checkChanged(int numberInArray, CoinIndexedVector * update) 508 509 { 509 510 assert (model_!=NULL); -
branches/devel-1/ClpPackedMatrix.cpp
r17 r19 6 6 #endif 7 7 8 #include <cstdio> 9 10 #include "CoinIndexedVector.hpp" 11 #include "CoinHelperFunctions.hpp" 12 8 13 #include "ClpSimplex.hpp" 9 14 #include "ClpFactorization.hpp" 10 #include "OsiIndexedVector.hpp"11 #include "CoinHelperFunctions.hpp"12 #include <stdio.h>13 15 // at end to get min/max! 14 16 #include "ClpPackedMatrix.hpp" … … 35 37 : ClpMatrixBase(rhs) 36 38 { 37 matrix_ = new OsiPackedMatrix(*(rhs.matrix_));39 matrix_ = new CoinPackedMatrix(*(rhs.matrix_)); 38 40 39 41 } … … 42 44 // assign matrix (for space reasons) 43 45 //------------------------------------------------------------------- 44 ClpPackedMatrix::ClpPackedMatrix ( OsiPackedMatrix * rhs)46 ClpPackedMatrix::ClpPackedMatrix (CoinPackedMatrix * rhs) 45 47 : ClpMatrixBase() 46 48 { … … 50 52 } 51 53 52 ClpPackedMatrix::ClpPackedMatrix (const OsiPackedMatrix & rhs)54 ClpPackedMatrix::ClpPackedMatrix (const CoinPackedMatrix & rhs) 53 55 : ClpMatrixBase() 54 56 { 55 matrix_ = new OsiPackedMatrix(rhs);57 matrix_ = new CoinPackedMatrix(rhs); 56 58 setType(1); 57 59 … … 75 77 ClpMatrixBase::operator=(rhs); 76 78 delete matrix_; 77 matrix_ = new OsiPackedMatrix(*(rhs.matrix_));79 matrix_ = new CoinPackedMatrix(*(rhs.matrix_)); 78 80 } 79 81 return *this; … … 92 94 { 93 95 ClpPackedMatrix * copy = new ClpPackedMatrix(); 94 copy->matrix_= new OsiPackedMatrix();96 copy->matrix_= new CoinPackedMatrix(); 95 97 copy->matrix_->reverseOrderedCopyOf(*matrix_); 96 98 copy->matrix_->removeGaps(); … … 207 209 void 208 210 ClpPackedMatrix::transposeTimes(const ClpSimplex * model, double scalar, 209 const OsiIndexedVector * rowArray,210 OsiIndexedVector * y,211 OsiIndexedVector * columnArray) const211 const CoinIndexedVector * rowArray, 212 CoinIndexedVector * y, 213 CoinIndexedVector * columnArray) const 212 214 { 213 215 columnArray->clear(); … … 393 395 void 394 396 ClpPackedMatrix::subsetTransposeTimes(const ClpSimplex * model, 395 const OsiIndexedVector * rowArray,396 const OsiIndexedVector * y,397 OsiIndexedVector * columnArray) const397 const CoinIndexedVector * rowArray, 398 const CoinIndexedVector * y, 399 CoinIndexedVector * columnArray) const 398 400 { 399 401 columnArray->clear(); … … 450 452 /* Returns number of elements in basis 451 453 column is basic if entry >=0 */ 452 OsiBigIndex454 ClpBigIndex 453 455 ClpPackedMatrix::numberInBasis(const int * columnIsBasic) const 454 456 { … … 456 458 int numberColumns = getNumCols(); 457 459 const int * columnLength = matrix_->getVectorLengths(); 458 OsiBigIndex numberElements=0;460 ClpBigIndex numberElements=0; 459 461 for (i=0;i<numberColumns;i++) { 460 462 if (columnIsBasic[i]>=0) { … … 465 467 } 466 468 // Fills in basis (Returns number of elements and updates numberBasic) 467 OsiBigIndex469 ClpBigIndex 468 470 ClpPackedMatrix::fillBasis(const ClpSimplex * model, 469 471 const int * columnIsBasic, int & numberBasic, … … 478 480 int i; 479 481 int numberColumns = getNumCols(); 480 OsiBigIndex numberElements=0;482 ClpBigIndex numberElements=0; 481 483 if (!rowScale) { 482 484 // no scaling … … 576 578 model->messageHandler()->message(CLP_PACKEDSCALE_INITIAL,*model->messagesPointer()) 577 579 <<smallest<<largest 578 << OsiMessageEol;580 <<CoinMessageEol; 579 581 if (smallest>=0.5&&largest<=2.0) { 580 582 // don't bother scaling 581 583 model->messageHandler()->message(CLP_PACKEDSCALE_FORGET,*model->messagesPointer()) 582 << OsiMessageEol;584 <<CoinMessageEol; 583 585 delete [] rowScale; 584 586 delete [] usefulRow; … … 633 635 <<overallSmallest 634 636 <<overallLargest 635 << OsiMessageEol;637 <<CoinMessageEol; 636 638 // skip last column round 637 639 if (numberPass==1) … … 681 683 <<overallSmallest 682 684 <<overallLargest 683 << OsiMessageEol;685 <<CoinMessageEol; 684 686 685 687 delete [] usefulRow; … … 711 713 } 712 714 } 713 /* Unpacks a column into an OsiIndexedvector715 /* Unpacks a column into an CoinIndexedvector 714 716 Note that model is NOT const. Bounds and objective could 715 717 be modified if doing column generation */ 716 718 void 717 ClpPackedMatrix::unpack(ClpSimplex * model, OsiIndexedVector * rowArray,719 ClpPackedMatrix::unpack(ClpSimplex * model,CoinIndexedVector * rowArray, 718 720 int iColumn) const 719 721 { … … 739 741 } 740 742 } 741 /* Adds multiple of a column into an OsiIndexedvector743 /* Adds multiple of a column into an CoinIndexedvector 742 744 You can use quickAdd to add to vector */ 743 745 void 744 ClpPackedMatrix::add(const ClpSimplex * model, OsiIndexedVector * rowArray,746 ClpPackedMatrix::add(const ClpSimplex * model,CoinIndexedVector * rowArray, 745 747 int iColumn, double multiplier) const 746 748 { -
branches/devel-1/ClpPrimalColumnDantzig.cpp
r15 r19 6 6 #endif 7 7 8 #include <cstdio> 9 10 #include "CoinIndexedVector.hpp" 8 11 9 12 #include "ClpSimplex.hpp" 10 13 #include "ClpPrimalColumnDantzig.hpp" 11 #include "OsiIndexedVector.hpp"12 14 #include "ClpFactorization.hpp" 13 15 #include "ClpPackedMatrix.hpp" 14 #include <stdio.h> 16 15 17 //############################################################################# 16 18 // Constructors / Destructor / Assignment … … 57 59 // Returns pivot column, -1 if none 58 60 int 59 ClpPrimalColumnDantzig::pivotColumn( OsiIndexedVector * updates,60 OsiIndexedVector * spareRow1,61 OsiIndexedVector * spareRow2,62 OsiIndexedVector * spareColumn1,63 OsiIndexedVector * spareColumn2)61 ClpPrimalColumnDantzig::pivotColumn(CoinIndexedVector * updates, 62 CoinIndexedVector * spareRow1, 63 CoinIndexedVector * spareRow2, 64 CoinIndexedVector * spareColumn1, 65 CoinIndexedVector * spareColumn2) 64 66 { 65 67 assert(model_); -
branches/devel-1/ClpPrimalColumnPivot.cpp
r2 r19 62 62 63 63 void 64 ClpPrimalColumnPivot::updateWeights( OsiIndexedVector * input)64 ClpPrimalColumnPivot::updateWeights(CoinIndexedVector * input) 65 65 { 66 66 } -
branches/devel-1/ClpPrimalColumnSteepest.cpp
r17 r19 9 9 #include "ClpSimplex.hpp" 10 10 #include "ClpPrimalColumnSteepest.hpp" 11 #include " OsiIndexedVector.hpp"11 #include "CoinIndexedVector.hpp" 12 12 #include "ClpFactorization.hpp" 13 13 #include "ClpMessage.hpp" … … 52 52 devex_ = rhs.devex_; 53 53 if (rhs.infeasible_) { 54 infeasible_= new OsiIndexedVector(rhs.infeasible_);54 infeasible_= new CoinIndexedVector(rhs.infeasible_); 55 55 } else { 56 56 infeasible_=NULL; … … 73 73 } 74 74 if (rhs.alternateWeights_) { 75 alternateWeights_= new OsiIndexedVector(rhs.alternateWeights_);75 alternateWeights_= new CoinIndexedVector(rhs.alternateWeights_); 76 76 } else { 77 77 alternateWeights_=NULL; … … 114 114 savedWeights_ = NULL; 115 115 if (rhs.infeasible_!=NULL) { 116 infeasible_= new OsiIndexedVector(rhs.infeasible_);116 infeasible_= new CoinIndexedVector(rhs.infeasible_); 117 117 } else { 118 118 infeasible_=NULL; … … 134 134 } 135 135 if (rhs.alternateWeights_!=NULL) { 136 alternateWeights_= new OsiIndexedVector(rhs.alternateWeights_);136 alternateWeights_= new CoinIndexedVector(rhs.alternateWeights_); 137 137 } else { 138 138 alternateWeights_=NULL; … … 146 146 // Returns pivot column, -1 if none 147 147 int 148 ClpPrimalColumnSteepest::pivotColumn( OsiIndexedVector * updates,149 OsiIndexedVector * spareRow1,150 OsiIndexedVector * spareRow2,151 OsiIndexedVector * spareColumn1,152 OsiIndexedVector * spareColumn2)148 ClpPrimalColumnSteepest::pivotColumn(CoinIndexedVector * updates, 149 CoinIndexedVector * spareRow1, 150 CoinIndexedVector * spareRow2, 151 CoinIndexedVector * spareColumn1, 152 CoinIndexedVector * spareColumn2) 153 153 { 154 154 assert(model_); … … 606 606 delete alternateWeights_; 607 607 weights_ = new double[numberRows+numberColumns]; 608 alternateWeights_ = new OsiIndexedVector();608 alternateWeights_ = new CoinIndexedVector(); 609 609 // enough space so can use it for factorization 610 610 alternateWeights_->reserve(numberRows+ … … 636 636 // set up infeasibilities 637 637 if (!infeasible_) { 638 infeasible_ = new OsiIndexedVector();638 infeasible_ = new CoinIndexedVector(); 639 639 infeasible_->reserve(numberColumns+numberRows); 640 640 } … … 738 738 } 739 739 void 740 ClpPrimalColumnSteepest::updateWeights( OsiIndexedVector * input)740 ClpPrimalColumnSteepest::updateWeights(CoinIndexedVector * input) 741 741 { 742 742 int number=input->getNumElements(); … … 828 828 *model_->messagesPointer()) 829 829 <<oldDevex<<devex_ 830 << OsiMessageEol;830 <<CoinMessageEol; 831 831 initializeWeights(); 832 832 } … … 841 841 ClpPrimalColumnSteepest::checkAccuracy(int sequence, 842 842 double relativeTolerance, 843 OsiIndexedVector * rowArray1,844 OsiIndexedVector * rowArray2)843 CoinIndexedVector * rowArray1, 844 CoinIndexedVector * rowArray2) 845 845 { 846 846 model_->unpack(rowArray1,sequence); … … 912 912 } 913 913 } else { 914 OsiIndexedVector * temp = new OsiIndexedVector();914 CoinIndexedVector * temp = new CoinIndexedVector(); 915 915 temp->reserve(numberRows+ 916 916 model_->factorization()->maximumPivots()); -
branches/devel-1/ClpSimplex.cpp
r17 r19 15 15 #include "ClpFactorization.hpp" 16 16 #include "ClpPackedMatrix.hpp" 17 #include " OsiIndexedVector.hpp"18 #include " OsiWarmStartBasis.hpp"17 #include "CoinIndexedVector.hpp" 18 #include "CoinWarmStartBasis.hpp" 19 19 #include "ClpDualRowDantzig.hpp" 20 20 #include "ClpDualRowSteepest.hpp" … … 197 197 <<nonLinearCost_->changeInCost() 198 198 <<nonLinearCost_->numberInfeasibilities() 199 << OsiMessageEol;199 <<CoinMessageEol; 200 200 } 201 201 if (valuesPass) { … … 256 256 <<largestPrimalError_ 257 257 <<largestDualError_ 258 << OsiMessageEol;258 <<CoinMessageEol; 259 259 return 0; 260 260 } … … 265 265 266 266 //work space 267 OsiIndexedVector * workSpace = rowArray_[0];267 CoinIndexedVector * workSpace = rowArray_[0]; 268 268 269 269 double * array = new double [numberRows_]; … … 365 365 double slackValue = factorization_->slackValue(); 366 366 //work space 367 OsiIndexedVector * workSpace = rowArray_[0];367 CoinIndexedVector * workSpace = rowArray_[0]; 368 368 369 369 double * array = new double [numberRows_]; … … 838 838 handler_->message(CLP_SIMPLEX_BADFACTOR,messages_) 839 839 <<status 840 << OsiMessageEol;840 <<CoinMessageEol; 841 841 return -1; 842 842 } else if (!solveType) { … … 874 874 <<directionIn_<<theta_ 875 875 <<dualOut_<<dualIn_<<alpha_ 876 << OsiMessageEol;876 <<CoinMessageEol; 877 877 if (getStatus(sequenceIn_)==ClpSimplex::isFree) { 878 878 handler_->message(CLP_SIMPLEX_FREEIN,messages_) 879 879 <<sequenceIn_ 880 << OsiMessageEol;880 <<CoinMessageEol; 881 881 } 882 882 // change of incoming … … 981 981 handler_->printing(algorithm_<0)<<theta_<<dualOut_; 982 982 handler_->printing(algorithm_>0)<<dualIn_<<theta_; 983 handler_->message()<< OsiMessageEol;983 handler_->message()<<CoinMessageEol; 984 984 985 985 if (numberIterations_>=maximumIterations_) … … 1228 1228 rowArray_[i]=NULL; 1229 1229 if (rhs.rowArray_[i]) 1230 rowArray_[i] = new OsiIndexedVector(*rhs.rowArray_[i]);1230 rowArray_[i] = new CoinIndexedVector(*rhs.rowArray_[i]); 1231 1231 columnArray_[i]=NULL; 1232 1232 if (rhs.columnArray_[i]) 1233 columnArray_[i] = new OsiIndexedVector(*rhs.columnArray_[i]);1233 columnArray_[i] = new CoinIndexedVector(*rhs.columnArray_[i]); 1234 1234 } 1235 1235 if (rhs.status_) { … … 1554 1554 */ 1555 1555 void 1556 ClpSimplex::unpack( OsiIndexedVector * rowArray)1556 ClpSimplex::unpack(CoinIndexedVector * rowArray) 1557 1557 { 1558 1558 rowArray->clear(); … … 1566 1566 } 1567 1567 void 1568 ClpSimplex::unpack( OsiIndexedVector * rowArray,int sequence)1568 ClpSimplex::unpack(CoinIndexedVector * rowArray,int sequence) 1569 1569 { 1570 1570 rowArray->clear(); … … 1632 1632 // clean up any mismatches on infinity 1633 1633 for (i=0;i<numberColumns_;i++) { 1634 if (columnLowerWork_[i]<- 1.0e30)1634 if (columnLowerWork_[i]<-CLP_INFINITY) 1635 1635 columnLowerWork_[i] = -DBL_MAX; 1636 if (columnUpperWork_[i]> 1.0e30)1636 if (columnUpperWork_[i]>CLP_INFINITY) 1637 1637 columnUpperWork_[i] = DBL_MAX; 1638 1638 } … … 1713 1713 for (iRow=0;iRow<4;iRow++) { 1714 1714 if (!rowArray_[iRow]) { 1715 rowArray_[iRow]=new OsiIndexedVector();1715 rowArray_[iRow]=new CoinIndexedVector(); 1716 1716 int length =numberRows_+factorization_->maximumPivots(); 1717 1717 if (iRow==3) … … 1723 1723 for (iColumn=0;iColumn<2;iColumn++) { 1724 1724 if (!columnArray_[iColumn]) { 1725 columnArray_[iColumn]=new OsiIndexedVector();1725 columnArray_[iColumn]=new CoinIndexedVector(); 1726 1726 columnArray_[iColumn]->reserve(numberColumns_); 1727 1727 } … … 1821 1821 // Sets up basis 1822 1822 void 1823 ClpSimplex::setBasis ( const OsiWarmStartBasis & basis)1823 ClpSimplex::setBasis ( const CoinWarmStartBasis & basis) 1824 1824 { 1825 1825 // transform basis to status arrays … … 1828 1828 /* 1829 1829 get status arrays 1830 OsiWarmStartBasis would seem to have overheads and we will need1830 CoinWarmStartBasis would seem to have overheads and we will need 1831 1831 extra bits anyway. 1832 1832 */ … … 1834 1834 memset(status_,0,(numberColumns_+numberRows_)*sizeof(char)); 1835 1835 } 1836 OsiWarmStartBasis basis2 = basis;1836 CoinWarmStartBasis basis2 = basis; 1837 1837 // resize if necessary 1838 1838 basis2.resize(numberRows_,numberColumns_); … … 1855 1855 } 1856 1856 // Warm start 1857 OsiWarmStartBasis1857 CoinWarmStartBasis 1858 1858 ClpSimplex::getBasis() const 1859 1859 { 1860 1860 int iRow,iColumn; 1861 OsiWarmStartBasis basis;1861 CoinWarmStartBasis basis; 1862 1862 basis.setSize(numberColumns_,numberRows_); 1863 1863 … … 1865 1865 for (iRow=0;iRow<numberRows_;iRow++) { 1866 1866 basis.setArtifStatus(iRow, 1867 ( OsiWarmStartBasis::Status) getRowStatus(iRow));1867 (CoinWarmStartBasis::Status) getRowStatus(iRow)); 1868 1868 } 1869 1869 for (iColumn=0;iColumn<numberColumns_;iColumn++) { 1870 1870 basis.setStructStatus(iColumn, 1871 ( OsiWarmStartBasis::Status) getColumnStatus(iColumn));1871 (CoinWarmStartBasis::Status) getColumnStatus(iColumn)); 1872 1872 } 1873 1873 } … … 1932 1932 1933 1933 // Get a row copy in standard format 1934 OsiPackedMatrix copy;1934 CoinPackedMatrix copy; 1935 1935 copy.reverseOrderedCopyOf(*matrix()); 1936 1936 // get matrix data pointers … … 2120 2120 handler_->message(CLP_SIMPLEX_BOUNDTIGHTEN,messages_) 2121 2121 <<totalTightened 2122 << OsiMessageEol;2122 <<CoinMessageEol; 2123 2123 // Set bounds slightly loose 2124 2124 for (iColumn=0;iColumn<numberColumns_;iColumn++) { … … 2145 2145 handler_->message(CLP_SIMPLEX_INFEASIBILITIES,messages_) 2146 2146 <<numberInfeasible 2147 << OsiMessageEol;2147 <<CoinMessageEol; 2148 2148 // restore column bounds 2149 2149 memcpy(columnLower_,saveLower,numberColumns_*sizeof(double)); … … 2197 2197 typedef struct { 2198 2198 double optimizationDirection; 2199 double dblParam[ OsiLastDblParam];2199 double dblParam[ClpLastDblParam]; 2200 2200 double objectiveValue; 2201 2201 double dualBound; … … 2207 2207 int numberRows; 2208 2208 int numberColumns; 2209 int intParam[ OsiLastIntParam];2209 int intParam[ClpLastIntParam]; 2210 2210 int numberIterations; 2211 2211 int problemStatus; … … 2252 2252 // Fill in scalars 2253 2253 scalars.optimizationDirection = optimizationDirection_; 2254 memcpy(scalars.dblParam, dblParam_, OsiLastDblParam * sizeof(double));2254 memcpy(scalars.dblParam, dblParam_,ClpLastDblParam * sizeof(double)); 2255 2255 scalars.objectiveValue = objectiveValue_; 2256 2256 scalars.dualBound = dualBound_; … … 2262 2262 scalars.numberRows = numberRows_; 2263 2263 scalars.numberColumns = numberColumns_; 2264 memcpy(scalars.intParam, intParam_, OsiLastIntParam * sizeof(double));2264 memcpy(scalars.intParam, intParam_,ClpLastIntParam * sizeof(double)); 2265 2265 scalars.numberIterations = numberIterations_; 2266 2266 scalars.problemStatus = problemStatus_; … … 2285 2285 // strings 2286 2286 int length; 2287 for (i=0;i< OsiLastStrParam;i++) {2287 for (i=0;i<ClpLastStrParam;i++) { 2288 2288 length = strParam_[i].size(); 2289 2289 numberWritten = fwrite(&length,sizeof(int),1,fp); … … 2445 2445 // Fill in scalars 2446 2446 optimizationDirection_ = scalars.optimizationDirection; 2447 memcpy(dblParam_, scalars.dblParam, OsiLastDblParam * sizeof(double));2447 memcpy(dblParam_, scalars.dblParam, ClpLastDblParam * sizeof(double)); 2448 2448 objectiveValue_ = scalars.objectiveValue; 2449 2449 dualBound_ = scalars.dualBound; … … 2455 2455 numberRows_ = scalars.numberRows; 2456 2456 numberColumns_ = scalars.numberColumns; 2457 memcpy(intParam_, scalars.intParam, OsiLastIntParam * sizeof(double));2457 memcpy(intParam_, scalars.intParam,ClpLastIntParam * sizeof(double)); 2458 2458 numberIterations_ = scalars.numberIterations; 2459 2459 problemStatus_ = scalars.problemStatus; … … 2470 2470 // strings 2471 2471 int length; 2472 for (i=0;i< OsiLastStrParam;i++) {2472 for (i=0;i<ClpLastStrParam;i++) { 2473 2473 numberRead = fread(&length,sizeof(int),1,fp); 2474 2474 if (numberRead!=1) … … 2608 2608 return 1; 2609 2609 // assign matrix 2610 OsiPackedMatrix * matrix = new OsiPackedMatrix();2610 CoinPackedMatrix * matrix = new CoinPackedMatrix(); 2611 2611 matrix->assignMatrix(true, numberRows_, numberColumns_, 2612 2612 length, elements, indices, starts, lengths); -
branches/devel-1/ClpSimplexDual.cpp
r17 r19 97 97 #include "ClpSimplexDual.hpp" 98 98 #include "ClpFactorization.hpp" 99 #include " OsiPackedMatrix.hpp"100 #include " OsiIndexedVector.hpp"101 #include " OsiWarmStartBasis.hpp"99 #include "CoinPackedMatrix.hpp" 100 #include "CoinIndexedVector.hpp" 101 #include "CoinWarmStartBasis.hpp" 102 102 #include "ClpDualRowDantzig.hpp" 103 103 #include "ClpMessage.hpp" … … 237 237 238 238 algorithm_ = -1; 239 dualTolerance_=dblParam_[ OsiDualTolerance];240 primalTolerance_=dblParam_[ OsiPrimalTolerance];239 dualTolerance_=dblParam_[ClpDualTolerance]; 240 primalTolerance_=dblParam_[ClpPrimalTolerance]; 241 241 242 242 // put in standard form (and make row copy) … … 266 266 handler_->message(CLP_SINGULARITIES,messages_) 267 267 <<factorizationStatus 268 << OsiMessageEol;268 <<CoinMessageEol; 269 269 270 270 // If user asked for perturbation - do it … … 342 342 handler_->message(CLP_SIMPLEX_FINISHED+problemStatus_,messages_) 343 343 <<objectiveValue() 344 << OsiMessageEol;344 <<CoinMessageEol; 345 345 // Restore any saved stuff 346 346 perturbation_ = savePerturbation; … … 442 442 handler_->message(CLP_SIMPLEX_PIVOTROW,messages_) 443 443 <<pivotRow_ 444 << OsiMessageEol;444 <<CoinMessageEol; 445 445 // check accuracy of weights 446 446 dualRowPivot_->checkAccuracy(); … … 475 475 <<btranAlpha 476 476 <<alpha_ 477 << OsiMessageEol;477 <<CoinMessageEol; 478 478 dualRowPivot_->unrollWeights(); 479 479 if (factorization_->pivots()) { … … 492 492 handler_->message(CLP_SIMPLEX_FLAG,messages_) 493 493 <<x<<sequenceWithin(sequenceOut_) 494 << OsiMessageEol;494 <<CoinMessageEol; 495 495 setFlagged(sequenceOut_); 496 496 lastBadIteration_ = numberIterations_; // say be more cautious … … 584 584 handler_->message(CLP_SIMPLEX_FLAG,messages_) 585 585 <<x<<sequenceWithin(sequenceOut_) 586 << OsiMessageEol;586 <<CoinMessageEol; 587 587 setFlagged(sequenceOut_); 588 588 lastBadIteration_ = numberIterations_; // say be more cautious … … 691 691 The output vector has movement (row length array) */ 692 692 int 693 ClpSimplexDual::updateDualsInDual( OsiIndexedVector * rowArray,694 OsiIndexedVector * columnArray,695 OsiIndexedVector * outputArray,693 ClpSimplexDual::updateDualsInDual(CoinIndexedVector * rowArray, 694 CoinIndexedVector * columnArray, 695 CoinIndexedVector * outputArray, 696 696 double theta, 697 697 double & objectiveChange) … … 915 915 int 916 916 ClpSimplexDual::changeBounds(bool initialize, 917 OsiIndexedVector * outputArray,917 CoinIndexedVector * outputArray, 918 918 double & changeCost) 919 919 { … … 1046 1046 */ 1047 1047 void 1048 ClpSimplexDual::dualColumn( OsiIndexedVector * rowArray,1049 OsiIndexedVector * columnArray,1050 OsiIndexedVector * spareArray,1051 OsiIndexedVector * spareArray2)1048 ClpSimplexDual::dualColumn(CoinIndexedVector * rowArray, 1049 CoinIndexedVector * columnArray, 1050 CoinIndexedVector * spareArray, 1051 CoinIndexedVector * spareArray2) 1052 1052 { 1053 1053 double * work; … … 1633 1633 } 1634 1634 if (thisIncrease) { 1635 newTolerance = dualTolerance_+1.0e-4*dblParam_[ OsiDualTolerance];1635 newTolerance = dualTolerance_+1.0e-4*dblParam_[ClpDualTolerance]; 1636 1636 } 1637 1637 … … 1647 1647 Returns -3 if not, 2 if is unbounded */ 1648 1648 int 1649 ClpSimplexDual::checkUnbounded( OsiIndexedVector * ray,1650 OsiIndexedVector * spare,1649 ClpSimplexDual::checkUnbounded(CoinIndexedVector * ray, 1650 CoinIndexedVector * spare, 1651 1651 double changeCost) 1652 1652 { … … 1792 1792 <<numberDualInfeasibilities_- 1793 1793 numberDualInfeasibilitiesWithoutFree_; 1794 handler_->message()<< OsiMessageEol;1794 handler_->message()<<CoinMessageEol; 1795 1795 while (problemStatus_<=-3) { 1796 1796 bool cleanDuals=false; … … 1805 1805 handler_->message(CLP_DUAL_BOUNDS,messages_) 1806 1806 <<dualBound_ 1807 << OsiMessageEol;1807 <<CoinMessageEol; 1808 1808 // save solution in case unbounded 1809 1809 CoinDisjointCopyN(columnActivityWork_,numberColumns_, … … 1827 1827 if (lastCleaned<numberIterations_) { 1828 1828 handler_->message(CLP_SIMPLEX_GIVINGUP,messages_) 1829 << OsiMessageEol;1829 <<CoinMessageEol; 1830 1830 } 1831 1831 } … … 1862 1862 handler_->message(CLP_DUAL_CHECKB,messages_) 1863 1863 <<dualBound_ 1864 << OsiMessageEol;1864 <<CoinMessageEol; 1865 1865 numberChangedBounds=changeBounds(false,NULL,changeCost); 1866 1866 if (numberChangedBounds<=0||dualBound_>1.0e20|| … … 1884 1884 lastCleaned=numberIterations_; 1885 1885 handler_->message(CLP_DUAL_ORIGINAL,messages_) 1886 << OsiMessageEol;1886 <<CoinMessageEol; 1887 1887 1888 1888 perturbation_=102; // stop any perturbations … … 1962 1962 */ 1963 1963 void 1964 ClpSimplexDual::flipBounds( OsiIndexedVector * rowArray,1965 OsiIndexedVector * columnArray,1964 ClpSimplexDual::flipBounds(CoinIndexedVector * rowArray, 1965 CoinIndexedVector * columnArray, 1966 1966 double change) 1967 1967 { … … 2116 2116 handler_->message(CLP_SIMPLEX_PERTURB,messages_) 2117 2117 <<perturbation 2118 << OsiMessageEol;2118 <<CoinMessageEol; 2119 2119 for (iRow=0;iRow<numberRows_;iRow++) { 2120 2120 double value = perturbation; … … 2197 2197 handler_->message(CLP_SINGULARITIES,messages_) 2198 2198 <<factorizationStatus 2199 << OsiMessageEol;2199 <<CoinMessageEol; 2200 2200 if (saveSparse) { 2201 2201 // use default at present … … 2436 2436 { 2437 2437 algorithm_ = -1; 2438 dualTolerance_=dblParam_[ OsiDualTolerance];2439 primalTolerance_=dblParam_[ OsiPrimalTolerance];2438 dualTolerance_=dblParam_[ClpDualTolerance]; 2439 primalTolerance_=dblParam_[ClpPrimalTolerance]; 2440 2440 2441 2441 // save dual bound … … 2509 2509 if (!alwaysFinish&&returnCode<1) { 2510 2510 double limit = 0.0; 2511 getDblParam( OsiDualObjectiveLimit, limit);2511 getDblParam(ClpDualObjectiveLimit, limit); 2512 2512 if(objectiveValue()*optimizationDirection_<limit|| 2513 2513 numberAtFakeBound()) { -
branches/devel-1/ClpSimplexPrimal.cpp
r17 r19 88 88 #include "ClpFactorization.hpp" 89 89 #include "ClpNonLinearCost.hpp" 90 #include " OsiPackedMatrix.hpp"91 #include " OsiIndexedVector.hpp"92 #include " OsiWarmStartBasis.hpp"90 #include "CoinPackedMatrix.hpp" 91 #include "CoinIndexedVector.hpp" 92 #include "CoinWarmStartBasis.hpp" 93 93 #include "ClpPrimalColumnPivot.hpp" 94 94 #include "ClpMessage.hpp" … … 218 218 219 219 algorithm_ = +1; 220 primalTolerance_=dblParam_[ OsiPrimalTolerance];221 dualTolerance_=dblParam_[ OsiDualTolerance];220 primalTolerance_=dblParam_[ClpPrimalTolerance]; 221 dualTolerance_=dblParam_[ClpDualTolerance]; 222 222 223 223 // put in standard form (and make row copy) … … 283 283 handler_->message(CLP_SINGULARITIES,messages_) 284 284 <<totalNumberThrownOut 285 << OsiMessageEol;285 <<CoinMessageEol; 286 286 287 287 problemStatus_ = -1; … … 369 369 handler_->message(CLP_SIMPLEX_FINISHED+problemStatus_,messages_) 370 370 <<objectiveValue() 371 << OsiMessageEol;371 <<CoinMessageEol; 372 372 // Restore any saved stuff 373 373 perturbation_ = savePerturbation; … … 505 505 handler_->message(CLP_SIMPLEX_FLAG,messages_) 506 506 <<x<<sequenceWithin(sequenceIn_) 507 << OsiMessageEol;507 <<CoinMessageEol; 508 508 setFlagged(sequenceIn_); 509 509 lastBadIteration_ = numberIterations_; // say be more cautious … … 523 523 handler_->message(CLP_PRIMAL_DJ,messages_) 524 524 <<saveDj<<dualIn_ 525 << OsiMessageEol;525 <<CoinMessageEol; 526 526 if(saveNumber != numberIterations_) { 527 527 problemStatus_=-2; // factorize now … … 538 538 handler_->message(CLP_SIMPLEX_FLAG,messages_) 539 539 <<x<<sequenceWithin(sequenceIn_) 540 << OsiMessageEol;540 <<CoinMessageEol; 541 541 setFlagged(sequenceIn_); 542 542 lastBadIteration_ = numberIterations_; // say be more cautious … … 570 570 handler_->message(CLP_SIMPLEX_FLAG,messages_) 571 571 <<x<<sequenceWithin(sequenceIn_) 572 << OsiMessageEol;572 <<CoinMessageEol; 573 573 setFlagged(sequenceIn_); 574 574 lastBadIteration_ = numberIterations_; // say be more cautious … … 720 720 <<numberDualInfeasibilities_- 721 721 numberDualInfeasibilitiesWithoutFree_; 722 handler_->message()<< OsiMessageEol;722 handler_->message()<<CoinMessageEol; 723 723 assert (primalFeasible()); 724 724 // we may wish to say it is optimal even if infeasible … … 764 764 handler_->message(CLP_PRIMAL_WEIGHT,messages_) 765 765 <<infeasibilityCost_ 766 << OsiMessageEol;766 <<CoinMessageEol; 767 767 // put back original bounds and then check 768 768 createRim(7); … … 779 779 handler_->message(CLP_PRIMAL_OPTIMAL,messages_) 780 780 <<primalTolerance_ 781 << OsiMessageEol;781 <<CoinMessageEol; 782 782 if (numberTimesOptimal_<4) { 783 783 numberTimesOptimal_++; … … 789 789 lastCleaned=numberIterations_; 790 790 handler_->message(CLP_PRIMAL_ORIGINAL,messages_) 791 << OsiMessageEol;792 primalTolerance_=dblParam_[ OsiPrimalTolerance];791 <<CoinMessageEol; 792 primalTolerance_=dblParam_[ClpPrimalTolerance]; 793 793 794 794 // put back original bounds and then check … … 801 801 if (lastCleaned<numberIterations_) { 802 802 handler_->message(CLP_SIMPLEX_GIVINGUP,messages_) 803 << OsiMessageEol;803 <<CoinMessageEol; 804 804 } 805 805 } … … 818 818 handler_->message(CLP_PRIMAL_WEIGHT,messages_) 819 819 <<infeasibilityCost_ 820 << OsiMessageEol;820 <<CoinMessageEol; 821 821 // put back original bounds and then check 822 822 createRim(7); … … 867 867 */ 868 868 void 869 ClpSimplexPrimal::primalRow( OsiIndexedVector * rowArray,870 OsiIndexedVector * rhsArray,871 OsiIndexedVector * spareArray,872 OsiIndexedVector * spareArray2,869 ClpSimplexPrimal::primalRow(CoinIndexedVector * rowArray, 870 CoinIndexedVector * rhsArray, 871 CoinIndexedVector * spareArray, 872 CoinIndexedVector * spareArray2, 873 873 int valuesPass) 874 874 { … … 1274 1274 */ 1275 1275 void 1276 ClpSimplexPrimal::primalColumn( OsiIndexedVector * updates,1277 OsiIndexedVector * spareRow1,1278 OsiIndexedVector * spareRow2,1279 OsiIndexedVector * spareColumn1,1280 OsiIndexedVector * spareColumn2)1276 ClpSimplexPrimal::primalColumn(CoinIndexedVector * updates, 1277 CoinIndexedVector * spareRow1, 1278 CoinIndexedVector * spareRow2, 1279 CoinIndexedVector * spareColumn1, 1280 CoinIndexedVector * spareColumn2) 1281 1281 { 1282 1282 sequenceIn_ = primalColumnPivot_->pivotColumn(updates,spareRow1, … … 1301 1301 */ 1302 1302 int 1303 ClpSimplexPrimal::updatePrimalsInPrimal( OsiIndexedVector * rowArray,1303 ClpSimplexPrimal::updatePrimalsInPrimal(CoinIndexedVector * rowArray, 1304 1304 double theta, 1305 1305 double & objectiveChange) -
branches/devel-1/Makefile
r18 r19 5 5 # highest level of optimization the compiler supports. If want something in 6 6 # between then specify the exact level you want, e.g., -O1 or -O2 7 OptLevel := -O2 8 #OptLevel := -g 9 # I seem to need this at present 10 #OPTFLAG := -O2 11 #OPTFLAG := -g 7 #OptLevel := -O2 8 OptLevel := -g 9 12 10 ifeq ($(OptLevel),-g) 13 11 CXXFLAGS += -DCLP_DEBUG … … 38 36 ############################################################################## 39 37 # The location of the customized Makefiles 40 export MakefileDir := ../Common/make 38 export CoinDir = $(shell cd ..; pwd) 39 export MakefileDir := $(CoinDir)/Makefiles 41 40 include ${MakefileDir}/Makefile.coin 42 41 include ${MakefileDir}/Makefile.location 43 # This modification seems to be needed 44 export ExtraIncDir := ../Osi/include45 export ExtraLibDir :=46 export ExtraLibName := 47 export ExtraDefine :=42 43 export ExtraIncDir := ${CoinIncDir} ${zlibIncDir} ${bzlibIncDir} 44 export ExtraLibDir := ${CoinLibDir} ${zlibLibDir} ${bzlibLibDir} 45 export ExtraLibName := ${CoinLibName} ${zlibLibName} ${bzlibLibName} 46 export ExtraDefine := ${CoinDefine} ${zlibDefine} ${bzlibDefine} 48 47 49 48 export LibType OptLevel LIBNAME LIBSRC … … 55 54 .PHONY: default install libClp library clean doc 56 55 56 default: install 57 57 58 unitTest : install 58 59 (cd Test && ${MAKE} unitTest) 59 60 60 default: install 61 62 install clean doc library: % : 61 install clean doc: % : 63 62 $(MAKE) -f ${MakefileDir}/Makefile.lib $* 64 63 65 64 libClp: 65 (cd $(CoinDir)/Coin && $(MAKE)) 66 66 $(MAKE) -f ${MakefileDir}/Makefile.lib library -
branches/devel-1/Test/ClpMain.cpp
r18 r19 7 7 8 8 #include <cassert> 9 #include <cstdio> 10 #include <cmath> 11 #include <cfloat> 12 #include <string> 13 #include <iostream> 14 15 #include <time.h> 16 #include <sys/times.h> 17 #include <sys/resource.h> 18 #include <unistd.h> 19 9 20 #define CLPVERSION "0.92" 10 21 22 //#include "CoinPackedMatrix.hpp" 23 //#include "CoinPackedVector.hpp" 24 #include "CoinWarmStartBasis.hpp" 25 #include "CoinMpsIO.hpp" 26 11 27 #include "ClpFactorization.hpp" 12 #include "OsiMpsReader.hpp"13 28 #include "ClpSimplex.hpp" 14 29 #include "ClpDualRowSteepest.hpp" … … 16 31 #include "ClpPrimalColumnSteepest.hpp" 17 32 #include "ClpPrimalColumnDantzig.hpp" 18 #include "OsiPackedMatrix.hpp"19 #include "OsiPackedVector.hpp"20 #include "OsiWarmStartBasis.hpp"21 33 // For Branch and bound 22 #include "OsiClpSolverInterface.hpp" 23 #include "OsiCuts.hpp" 24 #include "OsiRowCut.hpp" 25 #include "OsiColCut.hpp" 26 #include "OsiOsiMessage.hpp" 27 28 #include <stdio.h> 29 30 #include <cmath> 31 #include <cfloat> 32 33 #include <string> 34 #include <iostream> 35 #include <time.h> 36 #include <sys/times.h> 37 #include <sys/resource.h> 38 #include <unistd.h> 34 // #include "OsiClpSolverInterface.hpp" 35 // #include "OsiCuts.hpp" 36 // #include "OsiRowCut.hpp" 37 // #include "OsiColCut.hpp" 38 39 39 #ifdef DMALLOC 40 40 #include "dmalloc.h" … … 1157 1157 if (!status||(status>0&&allowImportErrors)) { 1158 1158 // I don't think there is any need for this but .. 1159 OsiWarmStartBasis allSlack;1159 CoinWarmStartBasis allSlack; 1160 1160 goodModels[iModel]=true; 1161 1161 models[iModel].setBasis(allSlack); … … 1190 1190 } 1191 1191 if (canOpen) { 1192 // get OsiClp stuff1193 OsiClpSolverInterface m(models+iModel);1194 1192 // Convert names 1195 1193 int iRow; … … 1209 1207 strdup(models[iModel].columnName(iColumn).c_str()); 1210 1208 } 1211 m.writeMps(fileName.c_str(), 1212 (const char **) rowNames, 1213 (const char **) columnNames); 1209 1210 ClpSimplex& m = models[iModel]; 1211 CoinMpsIO writer; 1212 writer.setMpsData(*m.matrix(), CLP_INFINITY, 1213 m.getColLower(), m.getColUpper(), 1214 m.getObjCoefficients(), 1215 (const char*) 0 /*integrality*/, 1216 m.getRowLower(), m.getRowUpper(), 1217 columnNames, rowNames); 1218 writer.writeMps(fileName.c_str()); 1214 1219 for (iRow=0;iRow<numberRows;iRow++) { 1215 1220 free(rowNames[iRow]); … … 1220 1225 } 1221 1226 delete [] columnNames; 1222 m.releaseClp();1223 1227 time2 = cpuTime(); 1224 1228 totalTime += time2-time1; -
branches/devel-1/Test/Makefile
r18 r19 8 8 ############################################################################## 9 9 # The location of the customized Makefiles 10 export MakefileDir := $(CoinDir)/Common/make 10 # also inherited from the parent Makefile 11 export CoinDir = $(shell cd ../..; pwd) 12 export MakefileDir := $(CoinDir)/Makefiles 11 13 include ${MakefileDir}/Makefile.coin 12 14 include ${MakefileDir}/Makefile.location 13 15 14 IncDir := 15 IncDir += ${OsiSolverIncDir} 16 IncDir += ${OsiIncDir} 17 IncDir += ${ClpIncDir} 18 IncDir += ${zlibIncDir} 19 IncDir += ${bzlibIncDir} 20 21 LibDir := 22 LibDir += ${OsiLibDir} 23 LibDir += ${ClpLibDir} 24 LibDir += ${zlibLibDir} 25 LibDir += ${bzlibLibDir} 26 27 LibName := 28 LibName += ${OsiLibName} 29 LibName += ${ClpLibName} 30 LibName += ${zlibLibName} 31 LibName += ${bzlibLibName} 32 33 Define := 34 Define += ${ClpDefine} 35 Define += ${OsiDefine} 36 Define += ${zlibDefine} 37 Define += ${bzlibDefine} 16 IncDir := ${ClpIncDir} ${CoinIncDir} ${bzlibIncDir} ${zlibIncDir} 17 LibDir := ${ClpLibDir} ${CoinLibDir} ${bzlibLibDir} ${zlibLibDir} 18 LibName := ${ClpLibName} ${CoinLibName} ${bzlibLibName} ${zlibLibName} 19 Define := ${ClpDefine} ${CoinDefine} ${bzlibDefine} ${zlibDefine} 38 20 39 21 ############################################################################## … … 45 27 CXXFLAGS += -DOSI_DEBUG 46 28 endif 29 30 TESTSRC := ClpMain.cpp 31 TESTSRC += unitTest.cpp 47 32 48 33 ############################################################################### … … 63 48 LIBDIRS := ${LibDir} 64 49 LIBS := ${LibName} 65 LIBS += libOsiClp66 50 67 51 LDFLAGS := $(addprefix -L,$(LIBDIRS)) … … 76 60 ############################################################################### 77 61 78 TESTSRC := ClpMain.cpp79 TESTSRC += unitTest.cpp80 62 TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o)) 81 63 TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d)) -
branches/devel-1/Test/unitTest.cpp
r2 r19 7 7 8 8 #include <cassert> 9 #include <cstdio> 10 #include <cmath> 11 #include <cfloat> 12 #include <string> 13 #include <iostream> 14 15 #include <time.h> 16 #include <sys/times.h> 17 #include <sys/resource.h> 18 #include <unistd.h> 19 20 #include "CoinMpsIO.hpp" 21 #include "CoinPackedMatrix.hpp" 22 #include "CoinPackedVector.hpp" 23 #include "CoinWarmStartBasis.hpp" 9 24 10 25 #include "ClpFactorization.hpp" 11 #include "OsiMpsReader.hpp"12 26 #include "ClpSimplex.hpp" 13 27 #include "ClpDualRowSteepest.hpp" … … 15 29 #include "ClpPrimalColumnSteepest.hpp" 16 30 #include "ClpPrimalColumnDantzig.hpp" 17 #include "OsiPackedMatrix.hpp" 18 #include "OsiPackedVector.hpp" 19 #include "OsiWarmStartBasis.hpp" 20 #include <stdio.h> 21 22 #include <cmath> 23 #include <cfloat> 24 25 #include <string> 26 #include <iostream> 27 #include <time.h> 28 #include <sys/times.h> 29 #include <sys/resource.h> 30 #include <unistd.h> 31 #include "ClpParameters.hpp" 31 32 32 33 //############################################################################# … … 243 244 // Read data mps file, 244 245 std::string fn = netlibDir+mpsName[m]; 245 OsiMpsReadermps;246 CoinMpsIO mps; 246 247 mps.readMps(fn.c_str(),"mps"); 247 248 ClpSimplex solution=empty; … … 264 265 solution.setDualRowPivotAlgorithm(steep); 265 266 #endif 266 solution.setDblParam( OsiObjOffset,mps.objectiveOffset());267 solution.setDblParam(ClpObjOffset,mps.objectiveOffset()); 267 268 solution.dual(); 268 269 } else { … … 279 280 solution.setInfeasibilityCost(1.0e6); 280 281 #endif 281 solution.setDblParam( OsiObjOffset,mps.objectiveOffset());282 solution.setDblParam(ClpObjOffset,mps.objectiveOffset()); 282 283 solution.primal(); 283 284 } … … 285 286 { 286 287 double soln = solution.objectiveValue(); 287 OsiRelFltEq eq(objValueTol[m]);288 CoinRelFltEq eq(objValueTol[m]); 288 289 std::cerr <<soln <<", " <<objValue[m] <<" diff "<< 289 290 soln-objValue[m]<<std::endl; … … 319 320 { 320 321 321 OsiRelFltEq eq(0.000001);322 CoinRelFltEq eq(0.000001); 322 323 323 324 { … … 330 331 int rows[11]={0,2,-1,-1,0,1,2,0,1,2}; 331 332 double elements[11]={7.0,2.0,1.0e10,1.0e10,-2.0,1.0,-2.0,1,1,1}; 332 OsiPackedMatrix matrix(true,3,5,8,elements,rows,start,length);333 CoinPackedMatrix matrix(true,3,5,8,elements,rows,start,length); 333 334 334 335 // rim data … … 343 344 int colBasis1[5]={1,1,-1,-1,1}; 344 345 int i; 345 OsiWarmStartBasis warm;346 CoinWarmStartBasis warm; 346 347 warm.setSize(5,3); 347 348 for (i=0;i<3;i++) { 348 349 if (rowBasis1[i]<0) { 349 warm.setArtifStatus(i, OsiWarmStartBasis::atLowerBound);350 warm.setArtifStatus(i,CoinWarmStartBasis::atLowerBound); 350 351 } else { 351 warm.setArtifStatus(i, OsiWarmStartBasis::basic);352 warm.setArtifStatus(i,CoinWarmStartBasis::basic); 352 353 } 353 354 } 354 355 for (i=0;i<5;i++) { 355 356 if (colBasis1[i]<0) { 356 warm.setStructStatus(i, OsiWarmStartBasis::atLowerBound);357 warm.setStructStatus(i,CoinWarmStartBasis::atLowerBound); 357 358 } else { 358 warm.setStructStatus(i, OsiWarmStartBasis::basic);359 warm.setStructStatus(i,CoinWarmStartBasis::basic); 359 360 } 360 361 } … … 401 402 } 402 403 { 403 OsiMpsReaderm;404 CoinMpsIO m; 404 405 std::string fn = mpsDir+"exmip1"; 405 406 m.readMps(fn.c_str(),"mps"); … … 412 413 // test steepest edge 413 414 { 414 OsiMpsReaderm;415 CoinMpsIO m; 415 416 std::string fn = netlibDir+"finnis"; 416 417 m.readMps(fn.c_str(),"mps"); … … 430 431 ClpDualRowSteepest steep; 431 432 solution.setDualRowPivotAlgorithm(steep); 432 solution.setDblParam( OsiObjOffset,m.objectiveOffset());433 solution.setDblParam(ClpObjOffset,m.objectiveOffset()); 433 434 solution.dual(); 434 435 } 435 436 // test normal solution 436 437 { 437 OsiMpsReaderm;438 CoinMpsIO m; 438 439 std::string fn = netlibDir+"afiro"; 439 440 m.readMps(fn.c_str(),"mps"); … … 461 462 int numberColumns = solution.numberColumns(); 462 463 int numberRows = solution.numberRows(); 463 OsiPackedVector colsol(numberColumns,solution.primalColumnSolution());464 CoinPackedVector colsol(numberColumns,solution.primalColumnSolution()); 464 465 double * objective = solution.objective(); 465 466 double objValue = colsol.dotProduct(objective); 466 OsiRelFltEq eq(1.0e-8);467 CoinRelFltEq eq(1.0e-8); 467 468 assert(eq(objValue,-4.6475314286e+02)); 468 469 double * lower = solution.columnLower(); … … 501 502 CoinDisjointCopyN(solution.dualRowSolution(),numberRows,rowObjective); 502 503 CoinDisjointCopyN(solution.dualColumnSolution(),numberColumns,objective); 503 OsiWarmStartBasis basis;504 CoinWarmStartBasis basis; 504 505 solution.setBasis(basis); 505 506 solution.dual(); … … 511 512 // test unbounded 512 513 { 513 OsiMpsReaderm;514 CoinMpsIO m; 514 515 std::string fn = netlibDir+"brandy"; 515 516 m.readMps(fn.c_str(),"mps"); … … 583 584 // test infeasible 584 585 { 585 OsiMpsReaderm;586 CoinMpsIO m; 586 587 std::string fn = netlibDir+"brandy"; 587 588 m.readMps(fn.c_str(),"mps"); -
branches/devel-1/include/ClpDualRowDantzig.hpp
r2 r19 28 28 Computes change in objective function 29 29 */ 30 virtual void updatePrimalSolution( OsiIndexedVector * input,30 virtual void updatePrimalSolution(CoinIndexedVector * input, 31 31 double theta, 32 32 double & changeInObjective); -
branches/devel-1/include/ClpDualRowPivot.hpp
r17 r19 5 5 6 6 class ClpSimplex; 7 class OsiIndexedVector;7 class CoinIndexedVector; 8 8 9 9 //############################################################################# … … 28 28 29 29 /// Updates weights (may be empty) 30 virtual void updateWeights( OsiIndexedVector * input,31 OsiIndexedVector * spare,32 OsiIndexedVector * updatedColumn);30 virtual void updateWeights(CoinIndexedVector * input, 31 CoinIndexedVector * spare, 32 CoinIndexedVector * updatedColumn); 33 33 34 34 /** Updates primal solution (and maybe list of candidates) … … 38 38 means everything is always in sync 39 39 */ 40 virtual void updatePrimalSolution(OsiIndexedVector * input, 40 /* FIXME: this was pure virtul (=0). Why? */ 41 virtual void updatePrimalSolution(CoinIndexedVector * input, 41 42 double theta, 42 double & changeInObjective) = 0;43 double & changeInObjective) = 0; 43 44 /** Saves any weights round factorization as pivot rows may change 44 45 Will be empty unless steepest edge (will save model) -
branches/devel-1/include/ClpDualRowSteepest.hpp
r17 r19 14 14 */ 15 15 16 class OsiIndexedVector;16 class CoinIndexedVector; 17 17 18 18 class ClpDualRowSteepest : public ClpDualRowPivot { … … 27 27 28 28 /// Updates weights (may be empty) 29 virtual void updateWeights( OsiIndexedVector * input,30 OsiIndexedVector * spare,31 OsiIndexedVector * updatedColumn);29 virtual void updateWeights(CoinIndexedVector * input, 30 CoinIndexedVector * spare, 31 CoinIndexedVector * updatedColumn); 32 32 33 33 /** Updates primal solution (and maybe list of candidates) … … 35 35 Computes change in objective function 36 36 */ 37 virtual void updatePrimalSolution( OsiIndexedVector * input,37 virtual void updatePrimalSolution(CoinIndexedVector * input, 38 38 double theta, 39 39 double & changeInObjective); … … 97 97 double * weights_; 98 98 /// square of infeasibility array (just for infeasible rows) 99 OsiIndexedVector * infeasible_;99 CoinIndexedVector * infeasible_; 100 100 /// alternate weight array (so we can unroll) 101 OsiIndexedVector * alternateWeights_;101 CoinIndexedVector * alternateWeights_; 102 102 /// save weight array (so we can use checkpoint) 103 OsiIndexedVector * savedWeights_;103 CoinIndexedVector * savedWeights_; 104 104 //@} 105 105 }; -
branches/devel-1/include/ClpFactorization.hpp
r2 r19 9 9 #endif 10 10 11 #include " OsiFactorization.hpp"11 #include "CoinFactorization.hpp" 12 12 13 /** This just implements OsiFactorization when an ClpMatrixBase object13 /** This just implements CoinFactorization when an ClpMatrixBase object 14 14 is passed. It has no data. 15 15 */ … … 17 17 class ClpSimplex; 18 18 19 class ClpFactorization : public OsiFactorization {19 class ClpFactorization : public CoinFactorization { 20 20 21 21 public: … … 51 51 /** The copy constructor. */ 52 52 ClpFactorization(const ClpFactorization&); 53 /** The copy constructor from an OsiFactorization. */54 ClpFactorization(const OsiFactorization&);53 /** The copy constructor from an CoinFactorization. */ 54 ClpFactorization(const CoinFactorization&); 55 55 56 56 ClpFactorization& operator=(const ClpFactorization&); -
branches/devel-1/include/ClpMatrixBase.hpp
r2 r19 11 11 using std::max; 12 12 13 #include " OsiPackedMatrix.hpp"14 class OsiIndexedVector;13 #include "CoinPackedMatrix.hpp" 14 class CoinIndexedVector; 15 15 class ClpSimplex; 16 typedef int OsiBigIndex; // synchronize with OsiFactorization.hpp16 typedef int ClpBigIndex; 17 17 18 18 /** Abstract base class for Clp Matrices … … 34 34 /**@name Virtual methods that the derived classes must provide */ 35 35 //@{ 36 /// Return a complete OsiPackedMatrix37 virtual OsiPackedMatrix * getPackedMatrix() const = 0;36 /// Return a complete CoinPackedMatrix 37 virtual CoinPackedMatrix * getPackedMatrix() const = 0; 38 38 /** Whether the packed matrix is column major ordered or not. */ 39 39 virtual bool isColOrdered() const = 0; … … 71 71 /** Returns number of elements in basis 72 72 column is basic if entry >=0 */ 73 virtual OsiBigIndex numberInBasis(const int * columnIsBasic) const = 0;73 virtual ClpBigIndex numberInBasis(const int * columnIsBasic) const = 0; 74 74 /// Fills in basis (Returns number of elements and updates numberBasic) 75 virtual OsiBigIndex fillBasis(const ClpSimplex * model,75 virtual ClpBigIndex fillBasis(const ClpSimplex * model, 76 76 const int * columnIsBasic, int & numberBasic, 77 77 int * row, int * column, … … 83 83 { return 1;}; 84 84 85 /** Unpacks a column into an OsiIndexedvector85 /** Unpacks a column into an CoinIndexedvector 86 86 Note that model is NOT const. Bounds and objective could 87 87 be modified if doing column generation (just for this variable) */ 88 virtual void unpack(ClpSimplex * model, OsiIndexedVector * rowArray,88 virtual void unpack(ClpSimplex * model,CoinIndexedVector * rowArray, 89 89 int column) const =0; 90 90 /** Purely for column generation and similar ideas. Allows … … 95 95 { return 0;}; 96 96 97 /** Adds multiple of a column into an OsiIndexedvector97 /** Adds multiple of a column into an CoinIndexedvector 98 98 You can use quickAdd to add to vector */ 99 virtual void add(const ClpSimplex * model, OsiIndexedVector * rowArray,99 virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray, 100 100 int column, double multiplier) const =0; 101 /// Allow any parts of a created OsiPackedMatrix to be deleted101 /// Allow any parts of a created CoinPackedMatrix to be deleted 102 102 virtual void releasePackedMatrix() const {}; 103 103 //@} … … 132 132 Squashes small elements and knows about ClpSimplex */ 133 133 virtual void transposeTimes(const ClpSimplex * model, double scalar, 134 const OsiIndexedVector * x,135 OsiIndexedVector * y,136 OsiIndexedVector * z) const = 0;134 const CoinIndexedVector * x, 135 CoinIndexedVector * y, 136 CoinIndexedVector * z) const = 0; 137 137 /** Return <code>x *A in <code>z</code> but 138 138 just for indices in y. … … 140 140 Squashes small elements and knows about ClpSimplex */ 141 141 virtual void subsetTransposeTimes(const ClpSimplex * model, 142 const OsiIndexedVector * x,143 const OsiIndexedVector * y,144 OsiIndexedVector * z) const = 0;142 const CoinIndexedVector * x, 143 const CoinIndexedVector * y, 144 CoinIndexedVector * z) const = 0; 145 145 //@} 146 146 //@{ -
branches/devel-1/include/ClpMessage.hpp
r15 r19 12 12 */ 13 13 14 #include " OsiMessageHandler.hpp"14 #include "CoinMessageHandler.hpp" 15 15 enum CLP_Message 16 16 { … … 53 53 }; 54 54 55 class ClpMessage : public OsiMessages {55 class ClpMessage : public CoinMessages { 56 56 57 57 public: -
branches/devel-1/include/ClpModel.hpp
r18 r19 9 9 #include <vector> 10 10 #include <string> 11 // This is only in to use OsiDblParam etc 12 #include "OsiSolverInterface.hpp" 11 13 12 #include "ClpMatrixBase.hpp" 14 #include "OsiMessageHandler.hpp" 15 13 #include "CoinMessageHandler.hpp" 14 #include "ClpParameters.hpp" 15 16 #define CLP_INFINITY 1e30 16 17 17 18 /** This is the base class for Linear Models … … 34 35 */ 35 36 //@{ 36 /// Default constructor37 /// Default constructor 37 38 ClpModel ( ); 38 39 39 /// Copy constructor.40 ClpModel(const ClpModel &);41 /// Assignment operator. This copies the data40 /// Copy constructor. 41 ClpModel(const ClpModel &); 42 /// Assignment operator. This copies the data 42 43 ClpModel & operator=(const ClpModel & rhs); 43 /// Destructor44 ~ClpModel ( );44 /// Destructor 45 ~ClpModel ( ); 45 46 //@} 46 47 … … 63 64 const double* rowlb, const double* rowub, 64 65 const double * rowObjective=NULL); 65 void loadProblem ( const OsiPackedMatrix& matrix,66 void loadProblem ( const CoinPackedMatrix& matrix, 66 67 const double* collb, const double* colub, 67 68 const double* obj, … … 100 101 /**@name gets and sets */ 101 102 //@{ 102 /// Number of rows 103 inline int numberRows() const 104 { return numberRows_;}; 105 inline int getNumRows() const 106 { return numberRows_;}; 107 /// Number of columns 108 inline int getNumCols() const 109 { return numberColumns_;}; 110 inline int numberColumns() const 111 { return numberColumns_;}; 112 /// Primal tolerance to use 113 inline double primalTolerance() const 114 { return dblParam_[OsiPrimalTolerance];} ; 115 void setPrimalTolerance( double value) ; 116 /// Dual tolerance to use 117 inline double dualTolerance() const 118 { return dblParam_[OsiDualTolerance];} ; 119 void setDualTolerance( double value) ; 120 /// Number of iterations 121 inline int numberIterations() const 122 { return numberIterations_;}; 123 inline int getIterationCount() const 124 { return numberIterations_;}; 125 /// Maximum number of iterations 126 inline int maximumIterations() const 127 { return maximumIterations_;}; 128 void setMaximumIterations(int value); 129 /** Status of problem: 130 0 - optimal 131 1 - primal infeasible 132 2 - dual infeasible 133 3 - stopped on iterations etc 134 4 - stopped due to errors 135 */ 136 inline int status() const 137 { return problemStatus_;}; 138 /// Are there a numerical difficulties? 139 bool isAbandoned() const 140 { return problemStatus_==4;}; 141 /// Is optimality proven? 142 bool isProvenOptimal() const 143 { return problemStatus_==0;}; 144 /// Is primal infeasiblity proven? 145 bool isProvenPrimalInfeasible() const 146 { return problemStatus_==1;}; 147 /// Is dual infeasiblity proven? 148 bool isProvenDualInfeasible() const 149 { return problemStatus_==2;}; 150 /// Is the given primal objective limit reached? 151 bool isPrimalObjectiveLimitReached() const ; 152 /// Is the given dual objective limit reached? 153 bool isDualObjectiveLimitReached() const ; 154 /// Iteration limit reached? 155 bool isIterationLimitReached() const 156 { return problemStatus_==3;}; 157 /// Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore 158 inline int optimizationDirection() const 159 { return (int) optimizationDirection_;}; 160 inline double getObjSense() const 161 { return optimizationDirection_;}; 162 void setOptimizationDirection(int value); 163 /// Primal row solution 164 inline double * primalRowSolution() const 165 { return rowActivity_;} ; 166 inline const double * getRowActivity() const 167 { return rowActivity_;} ; 168 /// Primal column solution 169 inline double * primalColumnSolution() const 170 { return columnActivity_;} ; 171 inline const double * getColSolution() const 172 { return columnActivity_;} ; 173 /// Dual row solution 174 inline double * dualRowSolution() const 175 { return dual_;} ; 176 inline const double * getRowPrice() const 177 { return dual_;} ; 178 /// Reduced costs 179 inline double * dualColumnSolution() const 180 { return reducedCost_;} ; 181 inline const double * getReducedCost() const 182 { return reducedCost_;} ; 183 /// Row lower 184 inline double* rowLower() const 185 { return rowLower_;}; 186 inline const double* getRowLower() const 187 { return rowLower_;}; 188 /// Row upper 189 inline double* rowUpper() const 190 { return rowUpper_;}; 191 inline const double* getRowUpper() const 192 { return rowUpper_;}; 193 /// Objective 194 inline double * objective() const 195 { return objective_;}; 196 inline const double * getObjCoefficients() const 197 { return objective_;}; 198 /// Row Objective 199 inline double * rowObjective() const 200 { return rowObjective_;}; 201 inline const double * getRowObjCoefficients() const 202 { return rowObjective_;}; 203 /// Column Lower 204 inline double * columnLower() const 205 { return columnLower_;}; 206 inline const double * getColLower() const 207 { return columnLower_;}; 208 /// Column Upper 209 inline double * columnUpper() const 210 { return columnUpper_;}; 211 inline const double * getColUpper() const 212 { return columnUpper_;}; 213 /// Matrix (if not ClpPackedmatrix be careful about memory leak 214 inline OsiPackedMatrix * matrix() const 215 { return matrix_->getPackedMatrix();}; 216 /// Row Matrix 217 inline ClpMatrixBase * rowCopy() const 218 { return rowCopy_;}; 219 /// Clp Matrix 220 inline ClpMatrixBase * clpMatrix() const 221 { return matrix_;}; 222 /// Objective value 223 inline double objectiveValue() const 224 { return objectiveValue_*optimizationDirection_ - dblParam_[OsiObjOffset];}; 225 inline double getObjValue() const 226 { return objectiveValue_*optimizationDirection_ - dblParam_[OsiObjOffset];}; 227 /// Integer information 228 inline char * integerInformation() const 229 {return integerType_;}; 230 /** Infeasibility/unbounded ray (NULL returned if none/wrong) 231 Up to user to use delete [] on these arrays. */ 232 double * infeasibilityRay() const; 233 double * unboundedRay() const; 103 /// Number of rows 104 inline int numberRows() const { 105 return numberRows_; 106 } 107 inline int getNumRows() const { 108 return numberRows_; 109 } 110 /// Number of columns 111 inline int getNumCols() const { 112 return numberColumns_; 113 } 114 inline int numberColumns() const { 115 return numberColumns_; 116 } 117 /// Primal tolerance to use 118 inline double primalTolerance() const { 119 return dblParam_[ClpPrimalTolerance]; 120 } 121 void setPrimalTolerance( double value) ; 122 /// Dual tolerance to use 123 inline double dualTolerance() const { return dblParam_[ClpDualTolerance]; } 124 void setDualTolerance( double value) ; 125 /// Number of iterations 126 inline int numberIterations() const { return numberIterations_; } 127 inline int getIterationCount() const { return numberIterations_; } 128 /// Maximum number of iterations 129 inline int maximumIterations() const { return maximumIterations_; } 130 void setMaximumIterations(int value); 131 /** Status of problem: 132 0 - optimal 133 1 - primal infeasible 134 2 - dual infeasible 135 3 - stopped on iterations etc 136 4 - stopped due to errors 137 */ 138 inline int status() const { return problemStatus_; } 139 /// Are there a numerical difficulties? 140 bool isAbandoned() const { return problemStatus_==4; } 141 /// Is optimality proven? 142 bool isProvenOptimal() const { return problemStatus_==0; } 143 /// Is primal infeasiblity proven? 144 bool isProvenPrimalInfeasible() const { return problemStatus_==1; } 145 /// Is dual infeasiblity proven? 146 bool isProvenDualInfeasible() const { return problemStatus_==2; } 147 /// Is the given primal objective limit reached? 148 bool isPrimalObjectiveLimitReached() const ; 149 /// Is the given dual objective limit reached? 150 bool isDualObjectiveLimitReached() const ; 151 /// Iteration limit reached? 152 bool isIterationLimitReached() const { return problemStatus_==3; } 153 /// Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore 154 inline int optimizationDirection() const { 155 return (int) optimizationDirection_; 156 } 157 inline double getObjSense() const { return optimizationDirection_; } 158 void setOptimizationDirection(int value); 159 /// Primal row solution 160 inline double * primalRowSolution() const { return rowActivity_; } 161 inline const double * getRowActivity() const { return rowActivity_; } 162 /// Primal column solution 163 inline double * primalColumnSolution() const { return columnActivity_; } 164 inline const double * getColSolution() const { return columnActivity_; } 165 /// Dual row solution 166 inline double * dualRowSolution() const { return dual_; } 167 inline const double * getRowPrice() const { return dual_; } 168 /// Reduced costs 169 inline double * dualColumnSolution() const { return reducedCost_; } 170 inline const double * getReducedCost() const { return reducedCost_; } 171 /// Row lower 172 inline double* rowLower() const { return rowLower_; } 173 inline const double* getRowLower() const { return rowLower_; } 174 /// Row upper 175 inline double* rowUpper() const { return rowUpper_; } 176 inline const double* getRowUpper() const { return rowUpper_; } 177 /// Objective 178 inline double * objective() const { return objective_; } 179 inline const double * getObjCoefficients() const { return objective_; } 180 /// Row Objective 181 inline double * rowObjective() const { return rowObjective_; } 182 inline const double * getRowObjCoefficients() const { 183 return rowObjective_; 184 } 185 /// Column Lower 186 inline double * columnLower() const { return columnLower_; } 187 inline const double * getColLower() const { return columnLower_; } 188 /// Column Upper 189 inline double * columnUpper() const { return columnUpper_; } 190 inline const double * getColUpper() const { return columnUpper_; } 191 /// Matrix (if not ClpPackedmatrix be careful about memory leak 192 inline CoinPackedMatrix * matrix() const { 193 return matrix_->getPackedMatrix(); 194 } 195 /// Row Matrix 196 inline ClpMatrixBase * rowCopy() const { return rowCopy_; } 197 /// Clp Matrix 198 inline ClpMatrixBase * clpMatrix() const { return matrix_; } 199 /// Objective value 200 inline double objectiveValue() const { 201 return objectiveValue_*optimizationDirection_ - dblParam_[ClpObjOffset]; 202 } 203 inline double getObjValue() const { 204 return objectiveValue_*optimizationDirection_ - dblParam_[ClpObjOffset]; 205 } 206 /// Integer information 207 inline char * integerInformation() const { return integerType_; } 208 /** Infeasibility/unbounded ray (NULL returned if none/wrong) 209 Up to user to use delete [] on these arrays. */ 210 double * infeasibilityRay() const; 211 double * unboundedRay() const; 234 212 //@} 235 213 /**@name Message handling */ 236 214 //@{ 237 /// Pass in Message handler (not deleted at end) 238 void passInMessageHandler(OsiMessageHandler * handler); 239 /// Set language 240 void newLanguage(OsiMessages::Language language); 241 void setLanguage(OsiMessages::Language language) 242 {newLanguage(language);}; 243 /// Return handler 244 OsiMessageHandler * messageHandler() const 245 {return handler_;}; 246 /// Return messages 247 OsiMessages messages() const 248 {return messages_;}; 249 /// Return pointer to messages 250 OsiMessages * messagesPointer() 251 {return & messages_;}; 252 /// Log level 253 void setLogLevel(int value) 254 {handler_->setLogLevel(value);}; 255 int logLevel() const 256 { return handler_->logLevel();}; 257 /// length of names (0 means no names0 258 inline int lengthNames() const 259 {return lengthNames_;}; 260 /// Row names 261 const std::vector<std::string> * rowNames() const 262 {return &rowNames_;}; 263 const std::string rowName(int iRow) const 264 {return rowNames_[iRow];}; 265 /// Column names 266 const std::vector<std::string> * columnNames() const 267 {return &columnNames_;}; 268 const std::string columnName(int iColumn) const 269 {return columnNames_[iColumn];}; 215 /// Pass in Message handler (not deleted at end) 216 void passInMessageHandler(CoinMessageHandler * handler); 217 /// Set language 218 void newLanguage(CoinMessages::Language language); 219 void setLanguage(CoinMessages::Language language) { newLanguage(language); } 220 /// Return handler 221 CoinMessageHandler * messageHandler() const { return handler_; } 222 /// Return messages 223 CoinMessages messages() const { return messages_; } 224 /// Return pointer to messages 225 CoinMessages * messagesPointer() { return & messages_; } 226 /// Log level 227 void setLogLevel(int value) { handler_->setLogLevel(value); } 228 int logLevel() const { return handler_->logLevel(); } 229 /// length of names (0 means no names0 230 inline int lengthNames() const { return lengthNames_; } 231 /// Row names 232 const std::vector<std::string> * rowNames() const { 233 return &rowNames_; 234 } 235 const std::string& rowName(int iRow) const { 236 return rowNames_[iRow]; 237 } 238 /// Column names 239 const std::vector<std::string> * columnNames() const { 240 return &columnNames_; 241 } 242 const std::string& columnName(int iColumn) const { 243 return columnNames_[iColumn]; 244 } 270 245 //@} 271 246 … … 290 265 //@{ 291 266 /// Set an integer parameter 292 bool setIntParam( OsiIntParam key, int value) ;267 bool setIntParam(ClpIntParam key, int value) ; 293 268 /// Set an double parameter 294 bool setDblParam( OsiDblParam key, double value) ;269 bool setDblParam(ClpDblParam key, double value) ; 295 270 /// Set an string parameter 296 bool setStrParam( OsiStrParam key, const std::string & value);271 bool setStrParam(ClpStrParam key, const std::string & value); 297 272 // Get an integer parameter 298 inline bool getIntParam( OsiIntParam key, int& value) const {299 if (key!= OsiLastIntParam) {273 inline bool getIntParam(ClpIntParam key, int& value) const { 274 if (key!=ClpLastIntParam) { 300 275 value = intParam_[key]; 301 276 return true; … … 305 280 } 306 281 // Get an double parameter 307 inline bool getDblParam( OsiDblParam key, double& value) const {308 if (key!= OsiLastDblParam) {282 inline bool getDblParam(ClpDblParam key, double& value) const { 283 if (key!=ClpLastDblParam) { 309 284 value = dblParam_[key]; 310 285 return true; … … 314 289 } 315 290 // Get a string parameter 316 inline bool getStrParam( OsiStrParam key, std::string& value) const {317 if (key!= OsiLastStrParam) {291 inline bool getStrParam(ClpStrParam key, std::string& value) const { 292 if (key!=ClpLastStrParam) { 318 293 value = strParam_[key]; 319 294 return true; … … 381 356 double * ray_; 382 357 /// Array of integer parameters 383 int intParam_[ OsiLastIntParam];358 int intParam_[ClpLastIntParam]; 384 359 /// Array of double parameters 385 double dblParam_[ OsiLastDblParam];360 double dblParam_[ClpLastDblParam]; 386 361 /// Array of string parameters 387 std::string strParam_[ OsiLastStrParam];362 std::string strParam_[ClpLastStrParam]; 388 363 /// Objective value 389 364 double objectiveValue_; … … 395 370 int maximumIterations_; 396 371 /// Message handler 397 OsiMessageHandler * handler_;372 CoinMessageHandler * handler_; 398 373 /// Flag to say if default handler (so delete) 399 374 bool defaultHandler_; 400 375 /// Messages 401 OsiMessages messages_;376 CoinMessages messages_; 402 377 /// length of names (0 means no names) 403 378 int lengthNames_; -
branches/devel-1/include/ClpNonLinearCost.hpp
r8 r19 10 10 11 11 class ClpSimplex; 12 class OsiIndexedVector;12 class CoinIndexedVector; 13 13 14 14 /** Trivial class to deal with non linear costs … … 75 75 for costs. 76 76 On input array is empty (but indices exist). On exit just 77 changed costs will be stored as normal OsiIndexedVector77 changed costs will be stored as normal CoinIndexedVector 78 78 */ 79 void checkChanged(int numberInArray, OsiIndexedVector * update);79 void checkChanged(int numberInArray, CoinIndexedVector * update); 80 80 /** Goes through one bound for each variable. 81 81 If multiplier*work[iRow]>0 goes down, otherwise up. … … 96 96 At the end of this all temporary offsets are zero 97 97 */ 98 void goBackAll(const OsiIndexedVector * update);98 void goBackAll(const CoinIndexedVector * update); 99 99 /** Sets bounds and cost for one variable 100 100 Returns change in cost -
branches/devel-1/include/ClpPackedMatrix.hpp
r17 r19 22 22 /**@name Useful methods */ 23 23 //@{ 24 /// Return a complete OsiPackedMatrix25 virtual OsiPackedMatrix * getPackedMatrix() const { return matrix_;};24 /// Return a complete CoinPackedMatrix 25 virtual CoinPackedMatrix * getPackedMatrix() const { return matrix_;}; 26 26 /** Whether the packed matrix is column major ordered or not. */ 27 27 virtual bool isColOrdered() const { return matrix_->isColOrdered(); } … … 70 70 /** Returns number of elements in basis 71 71 column is basic if entry >=0 */ 72 virtual OsiBigIndex numberInBasis(const int * columnIsBasic) const ;72 virtual ClpBigIndex numberInBasis(const int * columnIsBasic) const ; 73 73 /// Fills in basis (Returns number of elements and updates numberBasic) 74 virtual OsiBigIndex fillBasis(const ClpSimplex * model,74 virtual ClpBigIndex fillBasis(const ClpSimplex * model, 75 75 const int * columnIsBasic, int & numberBasic, 76 76 int * row, int * column, … … 79 79 returns non-zero if no scaling done */ 80 80 virtual int scale(ClpSimplex * model) const ; 81 /** Unpacks a column into an OsiIndexedvector81 /** Unpacks a column into an CoinIndexedvector 82 82 Note that model is NOT const. Bounds and objective could 83 83 be modified if doing column generation */ 84 virtual void unpack(ClpSimplex * model, OsiIndexedVector * rowArray,84 virtual void unpack(ClpSimplex * model,CoinIndexedVector * rowArray, 85 85 int column) const ; 86 /** Adds multiple of a column into an OsiIndexedvector86 /** Adds multiple of a column into an CoinIndexedvector 87 87 You can use quickAdd to add to vector */ 88 virtual void add(const ClpSimplex * model, OsiIndexedVector * rowArray,88 virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray, 89 89 int column, double multiplier) const ; 90 /// Allow any parts of a created OsiPackedMatrix to be deleted90 /// Allow any parts of a created CoinPackedMatrix to be deleted 91 91 virtual void releasePackedMatrix() const { }; 92 92 //@} … … 118 118 Squashes small elements and knows about ClpSimplex */ 119 119 virtual void transposeTimes(const ClpSimplex * model, double scalar, 120 const OsiIndexedVector * x,121 OsiIndexedVector * y,122 OsiIndexedVector * z) const;120 const CoinIndexedVector * x, 121 CoinIndexedVector * y, 122 CoinIndexedVector * z) const; 123 123 /** Return <code>x *A in <code>z</code> but 124 124 just for indices in y. 125 125 Squashes small elements and knows about ClpSimplex */ 126 126 virtual void subsetTransposeTimes(const ClpSimplex * model, 127 const OsiIndexedVector * x,128 const OsiIndexedVector * y,129 OsiIndexedVector * z) const;127 const CoinIndexedVector * x, 128 const CoinIndexedVector * y, 129 CoinIndexedVector * z) const; 130 130 //@} 131 131 132 132 /**@name Other */ 133 133 //@{ 134 /// Returns OsiPackedMatrix (non const)135 inline OsiPackedMatrix * matrix() const { return matrix_;};134 /// Returns CoinPackedMatrix (non const) 135 inline CoinPackedMatrix * matrix() const { return matrix_;}; 136 136 //@} 137 137 … … 149 149 /** The copy constructor. */ 150 150 ClpPackedMatrix(const ClpPackedMatrix&); 151 /** The copy constructor from an OsiPackedMatrix. */152 ClpPackedMatrix(const OsiPackedMatrix&);151 /** The copy constructor from an CoinPackedMatrix. */ 152 ClpPackedMatrix(const CoinPackedMatrix&); 153 153 154 154 /** This takes over ownership (for space reasons) */ 155 ClpPackedMatrix( OsiPackedMatrix * matrix);155 ClpPackedMatrix(CoinPackedMatrix * matrix); 156 156 157 157 ClpPackedMatrix& operator=(const ClpPackedMatrix&); … … 166 166 //@{ 167 167 /// Data 168 OsiPackedMatrix * matrix_;168 CoinPackedMatrix * matrix_; 169 169 //@} 170 170 }; -
branches/devel-1/include/ClpPrimalColumnDantzig.hpp
r2 r19 26 26 Can just do full price if you really want to be slow 27 27 */ 28 virtual int pivotColumn( OsiIndexedVector * updates,29 OsiIndexedVector * spareRow1,30 OsiIndexedVector * spareRow2,31 OsiIndexedVector * spareColumn1,32 OsiIndexedVector * spareColumn2);28 virtual int pivotColumn(CoinIndexedVector * updates, 29 CoinIndexedVector * spareRow1, 30 CoinIndexedVector * spareRow2, 31 CoinIndexedVector * spareColumn1, 32 CoinIndexedVector * spareColumn2); 33 33 34 34 /// Just sets model -
branches/devel-1/include/ClpPrimalColumnPivot.hpp
r17 r19 5 5 6 6 class ClpSimplex; 7 class OsiIndexedVector;7 class CoinIndexedVector; 8 8 9 9 //############################################################################# … … 28 28 We can use other arrays to help updates 29 29 */ 30 virtual int pivotColumn( OsiIndexedVector * updates,31 OsiIndexedVector * spareRow1,32 OsiIndexedVector * spareRow2,33 OsiIndexedVector * spareColumn1,34 OsiIndexedVector * spareColumn2) = 0;30 virtual int pivotColumn(CoinIndexedVector * updates, 31 CoinIndexedVector * spareRow1, 32 CoinIndexedVector * spareRow2, 33 CoinIndexedVector * spareColumn1, 34 CoinIndexedVector * spareColumn2) = 0; 35 35 36 36 /// Updates weights - part 1 (may be empty) 37 virtual void updateWeights( OsiIndexedVector * input);37 virtual void updateWeights(CoinIndexedVector * input); 38 38 39 39 /** Saves any weights round factorization as pivot rows may change -
branches/devel-1/include/ClpPrimalColumnSteepest.hpp
r17 r19 15 15 */ 16 16 17 class OsiIndexedVector;17 class CoinIndexedVector; 18 18 19 19 class ClpPrimalColumnSteepest : public ClpPrimalColumnPivot { … … 27 27 updateArray has cost updates (also use pivotRow_ from last iteration) 28 28 */ 29 virtual int pivotColumn( OsiIndexedVector * updates,30 OsiIndexedVector * spareRow1,31 OsiIndexedVector * spareRow2,32 OsiIndexedVector * spareColumn1,33 OsiIndexedVector * spareColumn2);29 virtual int pivotColumn(CoinIndexedVector * updates, 30 CoinIndexedVector * spareRow1, 31 CoinIndexedVector * spareRow2, 32 CoinIndexedVector * spareColumn1, 33 CoinIndexedVector * spareColumn2); 34 34 35 35 /// Updates weights - part 1 - also checks accuracy 36 virtual void updateWeights( OsiIndexedVector * input);36 virtual void updateWeights(CoinIndexedVector * input); 37 37 38 38 /// Checks accuracy - just for debug 39 39 void checkAccuracy(int sequence,double relativeTolerance, 40 OsiIndexedVector * rowArray1,41 OsiIndexedVector * rowArray2);40 CoinIndexedVector * rowArray1, 41 CoinIndexedVector * rowArray2); 42 42 43 43 /// Initialize weights … … 108 108 double * weights_; 109 109 /// square of infeasibility array (just for infeasible columns) 110 OsiIndexedVector * infeasible_;110 CoinIndexedVector * infeasible_; 111 111 /// alternate weight array (so we can unroll) 112 OsiIndexedVector * alternateWeights_;112 CoinIndexedVector * alternateWeights_; 113 113 /// save weight array (so we can use checkpoint) 114 114 double * savedWeights_; -
branches/devel-1/include/ClpSimplex.hpp
r17 r19 18 18 class ClpPrimalColumnPivot; 19 19 class ClpFactorization; 20 class OsiWarmStartBasis;21 class OsiIndexedVector;20 class CoinWarmStartBasis; 21 class CoinIndexedVector; 22 22 class ClpNonLinearCost; 23 23 … … 46 46 public: 47 47 48 /// enums for status of various sorts (matches OsiWarmStartBasis)48 /// enums for status of various sorts (matches CoinWarmStartBasis) 49 49 enum Status { 50 50 isFree = 0x00, … … 89 89 int primal(int ifValuesPass=0); 90 90 /// Sets up working basis as a copy of input 91 void setBasis( const OsiWarmStartBasis & basis);91 void setBasis( const CoinWarmStartBasis & basis); 92 92 /// Passes in factorization 93 93 void setFactorization( ClpFactorization & factorization); … … 174 174 { return numberPrimalInfeasibilities_;} ; 175 175 /// Warm start 176 OsiWarmStartBasis getBasis() const;176 CoinWarmStartBasis getBasis() const; 177 177 /** Save model to file, returns 0 if success. This is designed for 178 178 use outside algorithms so does not save iterating arrays etc. … … 219 219 Also applies scaling if needed 220 220 */ 221 void unpack( OsiIndexedVector * rowArray);221 void unpack(CoinIndexedVector * rowArray); 222 222 /** 223 223 Unpacks one column of the matrix into indexed array … … 225 225 Also applies scaling if needed 226 226 */ 227 void unpack( OsiIndexedVector * rowArray,int sequence);227 void unpack(CoinIndexedVector * rowArray,int sequence); 228 228 229 229 /** … … 535 535 double * objectiveWork_; 536 536 /// Useful row length arrays 537 OsiIndexedVector * rowArray_[6];537 CoinIndexedVector * rowArray_[6]; 538 538 /// Useful column length arrays 539 OsiIndexedVector * columnArray_[6];539 CoinIndexedVector * columnArray_[6]; 540 540 /// Alpha (pivot element) 541 541 double alpha_; -
branches/devel-1/include/ClpSimplexDual.hpp
r17 r19 148 148 The output vector has movement of primal 149 149 solution (row length array) */ 150 int updateDualsInDual( OsiIndexedVector * rowArray,151 OsiIndexedVector * columnArray,152 OsiIndexedVector * outputArray,150 int updateDualsInDual(CoinIndexedVector * rowArray, 151 CoinIndexedVector * columnArray, 152 CoinIndexedVector * outputArray, 153 153 double theta, 154 154 double & objectiveChange); … … 157 157 If change >0.0 then value in array >0.0 => from lower to upper 158 158 */ 159 void flipBounds( OsiIndexedVector * rowArray,160 OsiIndexedVector * columnArray,159 void flipBounds(CoinIndexedVector * rowArray, 160 CoinIndexedVector * columnArray, 161 161 double change); 162 162 /** … … 170 170 variables are being flipped 171 171 */ 172 void dualColumn( OsiIndexedVector * rowArray,173 OsiIndexedVector * columnArray,174 OsiIndexedVector * spareArray,175 OsiIndexedVector * spareArray2);172 void dualColumn(CoinIndexedVector * rowArray, 173 CoinIndexedVector * columnArray, 174 CoinIndexedVector * spareArray, 175 CoinIndexedVector * spareArray2); 176 176 /** 177 177 Chooses dual pivot row … … 189 189 and cost of change vector 190 190 */ 191 int changeBounds(bool initialize, OsiIndexedVector * outputArray,191 int changeBounds(bool initialize,CoinIndexedVector * outputArray, 192 192 double & changeCost); 193 193 /** As changeBounds but just changes new bounds for a single variable. … … 198 198 /** Checks if tentative optimal actually means unbounded in dual 199 199 Returns -3 if not, 2 if is unbounded */ 200 int checkUnbounded( OsiIndexedVector * ray,OsiIndexedVector * spare,200 int checkUnbounded(CoinIndexedVector * ray,CoinIndexedVector * spare, 201 201 double changeCost); 202 202 /** Refactorizes if necessary -
branches/devel-1/include/ClpSimplexPrimal.hpp
r17 r19 140 140 After rowArray will have cost changes for use next iteration 141 141 */ 142 int updatePrimalsInPrimal( OsiIndexedVector * rowArray,142 int updatePrimalsInPrimal(CoinIndexedVector * rowArray, 143 143 double theta, 144 144 double & objectiveChange); … … 152 152 If valuesPass non-zero then compute dj for direction 153 153 */ 154 void primalRow( OsiIndexedVector * rowArray,155 OsiIndexedVector * rhsArray,156 OsiIndexedVector * spareArray,157 OsiIndexedVector * spareArray2,154 void primalRow(CoinIndexedVector * rowArray, 155 CoinIndexedVector * rhsArray, 156 CoinIndexedVector * spareArray, 157 CoinIndexedVector * spareArray2, 158 158 int valuesPass); 159 159 /** … … 164 164 For easy problems we can just choose one of the first columns we look at 165 165 */ 166 void primalColumn( OsiIndexedVector * updateArray,167 OsiIndexedVector * spareRow1,168 OsiIndexedVector * spareRow2,169 OsiIndexedVector * spareColumn1,170 OsiIndexedVector * spareColumn2);166 void primalColumn(CoinIndexedVector * updateArray, 167 CoinIndexedVector * spareRow1, 168 CoinIndexedVector * spareRow2, 169 CoinIndexedVector * spareColumn1, 170 CoinIndexedVector * spareColumn2); 171 171 172 172 /** Checks if tentative optimal actually means unbounded in primal 173 173 Returns -3 if not, 2 if is unbounded */ 174 int checkUnbounded( OsiIndexedVector * ray,OsiIndexedVector * spare,174 int checkUnbounded(CoinIndexedVector * ray,CoinIndexedVector * spare, 175 175 double changeCost); 176 176 /** Refactorizes if necessary
Note: See TracChangeset
for help on using the changeset viewer.