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

make api for master-only vars more simple #32

Open
svigerske opened this issue Feb 26, 2019 · 0 comments
Open

make api for master-only vars more simple #32

svigerske opened this issue Feb 26, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@svigerske
Copy link
Member

Issue created by migration from Trac.

Original creator: @mgalati13

Original creation time: 2010-08-02 02:26:53

CC: kmartin@chicagobooth.edu

Good question... It's actually a bit messy to deal with this because of the way the framework is designed.

I don't have any explicit (simple) examples of this and should probably add one. For now, you can look at MILPBlock which deals with this case. I call it "master-only vars".

Look at MILPBlock_DecompApp::createModelMasterOnlys2( ) as an example of how to deal with this. Essentially, I just need the LB and UB of the vars. But since the design is driven off the DecompConstraintSet object, you need to declare an empty object for each var. I should probably make this easier for the user by just asking for a list of them. I’ll add a ticket to fix that in future.

for(vit = masterOnlyCols.begin(); vit != masterOnlyCols.end(); vit++){
i = *vit;

  //THINK:
  //  what-if master-only var is integer and bound is not at integer

  DecompConstraintSet * model = new DecompConstraintSet();
  model->m_masterOnly      = true;
  model->m_masterOnlyIndex = i;
  model->m_masterOnlyLB    = colLB[i];
  model->m_masterOnlyUB    = colUB[i];
  //0=cont, 1=integer
  model->m_masterOnlyIsInt = integerVars[i] ? true : false;
  if(m_appParam.ColumnUB <  1.0e15)
     if(colUB[i] >  1.0e15)
        model->m_masterOnlyUB = m_appParam.ColumnUB;
  if(m_appParam.ColumnLB > -1.0e15)
     if(colLB[i] < -1.0e15)
        model->m_masterOnlyLB = m_appParam.ColumnLB;

  m_modelR.insert(make_pair(nBlocks, model));
  setModelRelax(model,
                "master_only" + UtilIntToStr(i), nBlocks);
  nBlocks++;

}

-----Original Message-----
From: Kipp Martin [mailto:kmartin@chicagobooth.edu]
Sent: Saturday, July 31, 2010 3:20 AM
To: Matthew Galati
Subject: Re: Dip Questions

Hi Matt:

In my application I have a set variables in the core constraints that do not
appear in any of the blocks. So something like this

min cx

s.t

A'x >= b1
A''x + By >= b2

I assume that this will not mess things up, correct?

Thanks

@svigerske svigerske added enhancement New feature or request minor labels Feb 26, 2019
@tkralphs tkralphs removed the minor label Jul 27, 2019
@tkralphs tkralphs self-assigned this Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants