Changeset 2433
 Timestamp:
 Nov 22, 2018 7:19:01 AM (2 years ago)
 Location:
 trunk/Cbc/src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Cbc/src/Cbc_C_Interface.cpp
r2432 r2433 689 689 CbcGetProperty(int, getNumRows) 690 690 CbcGetProperty(int, getIterationCount) 691 692 /** Number of nonzero entries in a row */ 693 COINLIBAPI int COINLINKAGE 694 Cbc_getRowNz(Cbc_Model * model, int row) 695 { 696 const CoinPackedMatrix *cpmRow = model>model_>solver()>getMatrixByRow(); 697 return cpmRow>getVectorLengths()[row]; 698 } 699 700 /** Indices of variables that appear on this row */ 701 COINLIBAPI const int * COINLINKAGE 702 Cbc_getRowIndices(Cbc_Model * model, int row) 703 { 704 const CoinPackedMatrix *cpmRow = model>model_>solver()>getMatrixByRow(); 705 const CoinBigIndex *starts = cpmRow>getVectorStarts(); 706 const int *ridx = cpmRow>getIndices() + starts[row]; 707 return ridx; 708 } 709 710 /** Coefficients of variables that appear on this row */ 711 COINLIBAPI const double * COINLINKAGE 712 Cbc_getRowCoeffs(Cbc_Model * model, int row) 713 { 714 const CoinPackedMatrix *cpmRow = model>model_>solver()>getMatrixByRow(); 715 const CoinBigIndex *starts = cpmRow>getVectorStarts(); 716 const double *rcoef = cpmRow>getElements() + starts[row]; 717 return rcoef; 718 } 719 720 /** Right hand side of a row */ 721 COINLIBAPI double COINLINKAGE 722 Cbc_getRowRHS(Cbc_Model * model, int row) 723 { 724 return model>model_>solver()>getRightHandSide()[row]; 725 } 726 727 /** Sense a row */ 728 COINLIBAPI char COINLINKAGE 729 Cbc_getRowSense(Cbc_Model * model, int row) 730 { 731 return model>model_>solver()>getRowSense()[row]; 732 } 691 733 692 734 /** Are there a numerical difficulties? */ 
trunk/Cbc/src/Cbc_C_Interface.h
r2428 r2433 152 152 COINLIBAPI int COINLINKAGE 153 153 Cbc_getNumRows(Cbc_Model * model) 154 ; 155 /** Number of nonzero entries in a row */ 156 COINLIBAPI int COINLINKAGE 157 Cbc_getRowNz(Cbc_Model * model, int row) 158 ; 159 /** Indices of variables that appear on this row */ 160 COINLIBAPI const int * COINLINKAGE 161 Cbc_getRowIndices(Cbc_Model * model, int row) 162 ; 163 /** Coefficients of variables that appear on this row */ 164 COINLIBAPI const double * COINLINKAGE 165 Cbc_getRowCoeffs(Cbc_Model * model, int row) 166 ; 167 /** Right hand side of a row */ 168 COINLIBAPI double COINLINKAGE 169 Cbc_getRowRHS(Cbc_Model * model, int row) 170 ; 171 /** Sense a row */ 172 COINLIBAPI char COINLINKAGE 173 Cbc_getRowSense(Cbc_Model * model, int row) 154 174 ; 155 175 /** Number of variables in the model */
Note: See TracChangeset
for help on using the changeset viewer.