From b0da18e6ca2a867184bcae718e4a3902d424d730 Mon Sep 17 00:00:00 2001 From: Miles Lubin Date: Sat, 23 Feb 2019 22:04:36 -0500 Subject: [PATCH 1/3] clarify when NONBASIC_AT_* should be used --- src/attributes.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/attributes.jl b/src/attributes.jl index bafc410f40..119383290f 100644 --- a/src/attributes.jl +++ b/src/attributes.jl @@ -560,6 +560,12 @@ Possible values are: * `NONBASIC_AT_UPPER`: element is not in the basis and is at its upper bound * `SUPER_BASIC`: element is not in the basis but is also not at one of its bounds + +Note: `NONBASIC_AT_LOWER` and `NONBASIC_AT_UPPER` should be used only for +constraints with the `Interval` set. In this case they are necessary to +distinguish which side of the constraint is active. One-sided constraints +(e.g., `LessThan` and `GreaterThan`) should use `NONBASIC` instead of the +`NONBASIC_AT_*` values. """ @enum(BasisStatusCode, BASIC, NONBASIC, NONBASIC_AT_LOWER, NONBASIC_AT_UPPER, SUPER_BASIC) From 9f1f77b25cc6b08eb6fbca719d5d2711038116cf Mon Sep 17 00:00:00 2001 From: Miles Lubin Date: Sat, 23 Feb 2019 22:33:13 -0500 Subject: [PATCH 2/3] discuss variable statuses also --- src/attributes.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/attributes.jl b/src/attributes.jl index 119383290f..f03a8f0bea 100644 --- a/src/attributes.jl +++ b/src/attributes.jl @@ -562,10 +562,10 @@ Possible values are: bounds Note: `NONBASIC_AT_LOWER` and `NONBASIC_AT_UPPER` should be used only for -constraints with the `Interval` set. In this case they are necessary to -distinguish which side of the constraint is active. One-sided constraints -(e.g., `LessThan` and `GreaterThan`) should use `NONBASIC` instead of the -`NONBASIC_AT_*` values. +constraints with the `Interval` set and for `VariableBasisStatus`. In these +cases they are necessary to distinguish which side of the constraint or +variable bound is active. One-sided constraints (e.g., `LessThan` and +`GreaterThan`) should use `NONBASIC` instead of the `NONBASIC_AT_*` values. """ @enum(BasisStatusCode, BASIC, NONBASIC, NONBASIC_AT_LOWER, NONBASIC_AT_UPPER, SUPER_BASIC) From 7731e59a69d195f1f534559a9aee0fd415ed037c Mon Sep 17 00:00:00 2001 From: Miles Lubin Date: Sun, 24 Feb 2019 16:29:52 -0500 Subject: [PATCH 3/3] remove VariableBasisStatus --- docs/src/apireference.md | 6 +++--- src/attributes.jl | 24 ++++++++++-------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/docs/src/apireference.md b/docs/src/apireference.md index cf05def978..bb3523e83b 100644 --- a/docs/src/apireference.md +++ b/docs/src/apireference.md @@ -133,8 +133,9 @@ ResultStatusCode ### Basis Status -The `BasisStatus` attribute of a variable or constraint describes its status with respect to a basis, if one is known. -The value of the attribute is of type `BasisStatusCode`. +The `BasisStatus` attribute of a constraint describes its status with respect to +a basis, if one is known. The value of the attribute is of type +`BasisStatusCode`. ```@docs BasisStatusCode @@ -165,7 +166,6 @@ Calls to `get` and `set` should include as an argument a single `VariableIndex` VariableName VariablePrimalStart VariablePrimal -VariableBasisStatus ``` ### Constraints diff --git a/src/attributes.jl b/src/attributes.jl index f03a8f0bea..6fd594177a 100644 --- a/src/attributes.jl +++ b/src/attributes.jl @@ -541,17 +541,10 @@ struct VariablePrimal <: AbstractVariableAttribute end VariablePrimal() = VariablePrimal(1) -""" - VariableBasisStatus() - -A variable attribute for the `BasisStatusCode` of some variable, with respect to an available optimal solution basis. -""" -struct VariableBasisStatus <: AbstractVariableAttribute end - """ BasisStatusCode -An Enum of possible values for the `VariableBasisStatus` and `ConstraintBasisStatus` attributes. +An Enum of possible values for the `ConstraintBasisStatus` attribute. This explains the status of a given element with respect to an optimal solution basis. Possible values are: * `BASIC`: element is in the basis @@ -562,10 +555,10 @@ Possible values are: bounds Note: `NONBASIC_AT_LOWER` and `NONBASIC_AT_UPPER` should be used only for -constraints with the `Interval` set and for `VariableBasisStatus`. In these -cases they are necessary to distinguish which side of the constraint or -variable bound is active. One-sided constraints (e.g., `LessThan` and -`GreaterThan`) should use `NONBASIC` instead of the `NONBASIC_AT_*` values. +constraints with the `Interval`. In this case cases they are necessary to +distinguish which side of the constraint. One-sided constraints (e.g., +`LessThan` and `GreaterThan`) should use `NONBASIC` instead of the +`NONBASIC_AT_*` values. """ @enum(BasisStatusCode, BASIC, NONBASIC, NONBASIC_AT_LOWER, NONBASIC_AT_UPPER, SUPER_BASIC) @@ -643,7 +636,11 @@ ConstraintDual() = ConstraintDual(1) """ ConstraintBasisStatus() -A constraint attribute for the `BasisStatusCode` of some constraint, with respect to an available optimal solution basis. +A constraint attribute for the `BasisStatusCode` of some constraint, with +respect to an available optimal solution basis. + +**For the basis status of a variable, query the corresponding `SingleVariable` +constraint that enforces the variable's bounds.** """ struct ConstraintBasisStatus <: AbstractConstraintAttribute end @@ -883,7 +880,6 @@ function is_set_by_optimize(::Union{ObjectiveValue, PrimalStatus, DualStatus, VariablePrimal, - VariableBasisStatus, ConstraintPrimal, ConstraintDual, ConstraintBasisStatus})