Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Coin{Max,Min} by std::{max,min} #201

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cylp/cpp/IClpSimplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ void IClpSimplex::setVariableName(int varInd, char* name){
// columnNames_.reserve(numberColumns_);
// for (iColumn=0;iColumn<numberColumns_;iColumn++) {
// const char * name = m.columnName(iColumn);
// maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(name)));
// maxLength = std::max(maxLength,static_cast<unsigned int> (strlen(name)));
// columnNames_.push_back(name);
// }
lengthNames_=static_cast<int> (maxLength);
Expand Down Expand Up @@ -1162,7 +1162,7 @@ int IClpSimplex::primal (int ifValuesPass , int startFinishOptions)
double * saveLower = CoinCopyOfArray(rowLower_,numberRows_);
double * saveUpper = CoinCopyOfArray(rowUpper_,numberRows_);
for (int i=0;i<numberProblems;i++) {
int endColumn = CoinMin(startColumn+numberColumns,numberColumns_);
int endColumn = std::min(startColumn+numberColumns,numberColumns_);
CoinZeroN(ClpModel::rowActivity_,numberRows_);
for (int iColumn=startColumn;iColumn<endColumn;iColumn++) {
whichColumns[iColumn-startColumn]=iColumn;
Expand Down Expand Up @@ -1216,7 +1216,7 @@ int IClpSimplex::primal (int ifValuesPass , int startFinishOptions)
whichRows[iRow]=1000*startValue;
}
for (int i=0;i<numberProblems;i++) {
int endColumn = CoinMin(startColumn+numberColumns,numberColumns_);
int endColumn = std::min(startColumn+numberColumns,numberColumns_);
ClpSimplex * simplex = model[i];
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// this line changed from columnActivity_ to getColSolution because columnactivity in protected in ClpModel
Expand Down Expand Up @@ -1275,7 +1275,7 @@ int IClpSimplex::primal (int ifValuesPass , int startFinishOptions)
for (int iColumn=0;iColumn<numberColumns_;iColumn++) {
if (getColumnStatus(iColumn)==basic) {
double value = ClpModel::columnActivity_[iColumn];
value = CoinMin(value-columnLower_[iColumn],
value = std::min(value-columnLower_[iColumn],
columnUpper_[iColumn]-value);
away[numberBasic]=value;
whichColumns[numberBasic++]=iColumn;
Expand Down Expand Up @@ -1339,7 +1339,7 @@ int IClpSimplex::primal (int ifValuesPass , int startFinishOptions)
if ((matrix_->generalExpanded(this,4,dummy)&2)!=0&&(specialOptions_&8192)==0) {
double saveBound = dualBound_;
// upperOut_ has largest away from bound
dualBound_=CoinMin(CoinMax(2.0*upperOut_,1.0e8),dualBound_);
dualBound_=std::min(std::max(2.0*upperOut_,1.0e8),dualBound_);
returnCode = reinterpret_cast<ClpSimplexDual *> (this)->dual(0,startFinishOptions);
dualBound_=saveBound;
} else {
Expand Down
Loading
Loading