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

update linking related variable name and replace some binarySearch #128

Merged
merged 5 commits into from
Nov 12, 2023

Conversation

yuxies
Copy link

@yuxies yuxies commented Nov 8, 2023

  • Variable name change: sizeFixedInd to sizeLinkVars to match a earlier name change.
  • Update iterations for finding the linking variables to upper-level/first-stage only.
  • In MibSModel, move the "check linking variables are integers" block from readProblemData() to analyzeStructure(); it also fix a bug on indices.

Copy link
Member

@tkralphs tkralphs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pushed a commit to completely eliminate sizeLinkVars since it doesn't even make sense anymore. It was tracking the size of the vector of indices of the linking variable, but now varType_ always has size equal to the total number of variables.

src/MibSBilevel.cpp Show resolved Hide resolved
src/MibSModel.cpp Show resolved Hide resolved
src/MibSModel.cpp Outdated Show resolved Hide resolved
@yuxies yuxies changed the title update linking related variable name and search update linking related variable name and replace some binarySearch Nov 10, 2023
break;
}
}
}

for(i = 0; i < lCols; i++){
index = lColIndices[i];
varType_[i] = MibSVarLower;
varType_[index] = MibSVarLower;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this!

@tkralphs
Copy link
Member

Is this still a draft?

@yuxies
Copy link
Author

yuxies commented Nov 12, 2023

Update:

  • Reorganized analyzeStructure(}: use row or column indices to replace some binary searches.

Tested on both general and interdiction instances.

@yuxies yuxies marked this pull request as ready for review November 12, 2023 06:07
@tkralphs tkralphs merged commit 5bf384b into coin-or:stable/1.2 Nov 12, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants