Initializing help system before first use

# Inequality

A reference to an equation, inequality, or ranged row. More...

Inheritance diagram for xpress::objects::Inequality:

## Public Member Functions
auto | chgCoef (Variable const &v, double newCoef) -> Inequality &
| Change the coefficient for a variable in this row.
auto | chgCoef (Variable const &v1, Variable const &v2, double newCoef) -> Inequality &
| Change coefficient for a quadratic term in this row.
auto | chgCoefs (xpress::SizedArray< Variable const > const &v, xpress::SizedArray< double const > const &newCoef) -> Inequality &
| Change the coefficients for multiple variables in this row.
virtual auto | compareTo (Inequality const &other) const -> int final
auto | getCallbackDual () -> double
| Get the dual value value for this row from the solution associated with the current callback.
auto | getCallbackSlack () -> double
| Get the slack value for this row from the solution associated with the current callback.
auto | getDual () const -> double
| Get the current dual value value for this row.
virtual auto | getHashCode () const -> std::size_t final
virtual auto | getIndex () const -> int final
virtual auto | getIndexForProb (XpressProblem const *xprob) const -> int final
auto | getLhs () -> xpress::objects::Expression
| Get the left-hand side of this inequality.
virtual auto | getName () const -> std::string final
| Examples using `getName`:
virtual auto | getProblem () const -> xpress::objects::XpressProblem *final
auto | getRhs () -> double
| Get the right-hand side for this row.
auto | getRhsRange () -> double
| Get the right-hand side range for this row.
auto | getSlack () const -> double
| Get the current slack value for this row.
auto | getType () -> xpress::RowType
| Get the type for this row.
auto | getValue (xpress::SizedArray< double const > const &data) const -> double
| Get the value of this row from an array.
auto | setFormula (xpress::objects::FormulaExpression const &formula) -> Inequality &
| Set the formula for this inequality.
auto | setName (std::optional< std::string > newName) -> Inequality &
| Set the name of this inequality.
auto | setRhs (double newRhs) -> Inequality &
| Set the right-hand side for this row.
auto | setRhsRange (double newRange) -> Inequality &
| Set the right-hand side range for this row.
auto | setType (xpress::RowType newType) -> Inequality &
| Set the type for this row.
Public Member Functions inherited from xpress::objects::Index

## Detailed Description

A reference to an equation, inequality, or ranged row.

Since
  44.00

## Member Function Documentation

## chgCoef() [1/2]

auto xpress::objects::Inequality::chgCoef | ( | Variable const & | v,
|  | double | newCoef ) -> Inequality&
| inline

Change the coefficient for a variable in this row.

Examples using `chgCoef`:

- CuttingStock.cpp
- RecursiveFinancialPlanning.cpp

Parameters

  v | Variable for which to change the coefficient.
  newCoef | New coefficient.

Returns
  Always returns this instance.

Since
  44.00

## chgCoef() [2/2]

auto xpress::objects::Inequality::chgCoef | ( | Variable const & | v1,
|  | Variable const & | v2,
|  | double | newCoef ) -> Inequality&
| inline

Change coefficient for a quadratic term in this row.

If `v1` and `v2` are the same, then the diagonal coefficient for `(v1,v2)` is set to `newCoef`. Otherwise the off-diagonal coefficients for `(v1,v2)` and `(v2,v1)` to `newCoef`/2, each.

Examples using `chgCoef`:

- CuttingStock.cpp
- RecursiveFinancialPlanning.cpp

Parameters

  v1 | First variable in quadratic term.
  v2 | Second variable in quadratic term.
  newCoef | New coefficient for `v1` * `v2`.

Returns
  Always returns this instance.

Since
  47.00

## chgCoefs()

auto xpress::objects::Inequality::chgCoefs | ( | xpress::SizedArray< Variable const > const & | v,
|  | xpress::SizedArray< double const > const & | newCoef ) -> Inequality&
| inline

Change the coefficients for multiple variables in this row.

Parameters

  v | Variables for which to change the coefficient.
  newCoef | New coefficients.

Returns
  Always returns this instance.

Since
  44.00

## compareTo()

auto xpress::objects::Inequality::compareTo | ( | Inequality const & | other | ) | const -> int
| inline final virtual

Since
  44.00

## getCallbackDual()

auto xpress::objects::Inequality::getCallbackDual | ( |  | ) | -> double
| inline

Get the dual value value for this row from the solution associated with the current callback.

Note: This function uses `xpress::XPRSProblem#getCallbackDuals(bool *, Array<double> const &, int, int) const` under the hood.

Note: Calling this function for multiple rows is not efficient. If you need to get values for multiple rows then consider using `xpress::objects::XpressProblem#getCallbackDuals() const` to get the values for all rows and then use `getValue(SizedArray<double const> const &) const` to extract the value for a particular row.

Returns
  Dual value for this row.

Since
  44.00

## getCallbackSlack()

auto xpress::objects::Inequality::getCallbackSlack | ( |  | ) | -> double
| inline

Get the slack value for this row from the solution associated with the current callback.

Note: This function uses `xpress::XPRSProblem#getCallbackSlacks(bool *, Array<double> const &, int, int) const` under the hood.

Note: Calling this function for multiple rows is not efficient. If you need to get values for multiple rows then consider using `xpress::objects::XpressProblem#getCallbackSlacks() const` to get the values for all rows and then use `getValue(SizedArray<double const> const &) const` to extract the value for a particular row.

Returns
  Slack for this row.

Since
  44.00

## getDual()

auto xpress::objects::Inequality::getDual | ( |  | ) | const -> double
| inline

Get the current dual value value for this row.

Note: This function uses `xpress::XPRSProblem#getDuals(int *, Array<double> const &, int, int) const` under the hood. This is only valid to call if the `xpress::objects::XpressProblem` instance owning this row is currently not under optimization.

Note: Calling this function for multiple rows is not efficient. If you need to get values for multiple rows then consider using `xpress::objects::XpressProblem#getDuals() const` to get the values for all rows and then use `getValue(SizedArray<double const> const &) const` to extract the value for a particular row. This strategy is also valid from callbacks.

Returns
  Dual value for this row.

Since
  44.00

## getHashCode()

auto xpress::objects::Inequality::getHashCode | ( |  | ) | const -> std::size_t
| inline final virtual

Since
  44.00

## getIndex()

auto xpress::objects::Inequality::getIndex | ( |  | ) | const -> int
| inline final virtual

Since
  44.00

## getIndexForProb()

auto xpress::objects::Inequality::getIndexForProb | ( | XpressProblem const * | xprob | ) | const -> int
| inline final virtual

Since
  44.00

## getLhs()

auto xpress::objects::Inequality::getLhs | ( |  | ) | -> xpress::objects::Expression
| inline

Get the left-hand side of this inequality.

Returns
  The left-hand side of this inequality.

Since
  44.00

## getName()

auto xpress::objects::Inequality::getName | ( |  | ) | const -> std::string
| inline final virtual

Examples using `getName`:

- BinBurglar.cpp
- BoolVars.cpp
- ContractAllocation.cpp
- CuttingStock.cpp
- FolioHeuristic.cpp
- FolioIIS.cpp
- FolioInit.cpp
- FolioMip1.cpp
- FolioMip2.cpp
- FolioMipIIS.cpp
- FolioQC.cpp
- FolioQP.cpp
- PolygonObjects.cpp
- QuadraticProgramming.cpp
- RecursiveFinancialPlanning.cpp

Returns
  Name of this inequality.

Since
  44.00

## getProblem()

auto xpress::objects::Inequality::getProblem | ( |  | ) | const -> xpress::objects::XpressProblem *
| inline final virtual

Returns
  The problem to which this element belongs. This will be `nullptr` if the element was deleted.

Since
  44.00

## getRhs()

auto xpress::objects::Inequality::getRhs | ( |  | ) | -> double
| inline

Get the right-hand side for this row.

Queries the `xpress::objects::XpressProblem` instance to which this row belongs and returns the right-hand side from that instance.

Returns
  Right-hand side of this inequality.

Since
  44.00

## getRhsRange()

auto xpress::objects::Inequality::getRhsRange | ( |  | ) | -> double
| inline

Get the right-hand side range for this row.

Queries the `xpress::objects::XpressProblem` instance to which this row belongs and returns the right-hand side range from that instance.

Returns
  Right-hand side range of this inequality.

Since
  44.00

## getSlack()

auto xpress::objects::Inequality::getSlack | ( |  | ) | const -> double
| inline

Get the current slack value for this row.

Note: This function uses `xpress::XPRSProblem#getSlacks(int *, Array<double> const &, int, int) const` under the hood. This is only valid to call if the `xpress::objects::XpressProblem` instance owning this row is currently not under optimization.

Note: Calling this function for multiple rows is not efficient. If you need to get values for multiple rows then consider using `xpress::objects::XpressProblem#getSlacks() const` to get the values for all rows and then use `getValue(SizedArray<double const> const &) const` to extract the value for a particular row. This strategy is also valid from callbacks.

Examples using `getSlack`:

- Capbgt2l.cpp
- CapitalBudgeting.cpp

Returns
  Slack for this row.

Since
  44.00

## getType()

auto xpress::objects::Inequality::getType | ( |  | ) | -> xpress::RowType
| inline

Get the type for this row.

Queries the `xpress::objects::XpressProblem` instance to which this row belongs and returns the name obtained from that instance.

Returns
  Type of this inequality.

Since
  44.00

## getValue()

auto xpress::objects::Inequality::getValue | ( | xpress::SizedArray< double const > const & | data | ) | const -> double
| inline

Get the value of this row from an array.

The function assumes that `data` is an array that stores a value for each row in the underlying problem and returns the value from this array that corresponds to this row. `data` arrays can be obtained for example from `prob.getSlacks()` or `prob.getCallbackSlacks()`.

Examples using `getValue`:

- BinBurglar.cpp
- BoolVars.cpp
- Boxes02.cpp
- Capbgt2l.cpp
- Catenary.cpp
- ContractAllocation.cpp
- CuttingStock.cpp
- ELS.cpp
- ELSCut.cpp
- ELSManagedCuts.cpp
- FacilityLocationArray.cpp
- FacilityLocationCollection.cpp
- Folio.cpp
- FolioCB.cpp
- FolioHeuristic.cpp
- FolioInit.cpp
- FolioMip1.cpp
- FolioMip2.cpp
- FolioQC.cpp
- FolioQP.cpp
- GeneralConstraints.cpp
- Glidert.cpp
- MultipleKnapsack_Arrays.cpp
- MultipleKnapsack_Collections.cpp
- PiecewiseLinear.cpp
- PolygonObjects.cpp
- Pplan.cpp
- Pplan2.cpp
- ProductionPlanning_Index.cpp
- PurchasePWL.cpp
- PurchaseSOS2.cpp
- QuadraticProgramming.cpp
- RecursiveFinancialPlanning.cpp
- Sangraalind.cpp
- SpecialOrderedSets.cpp
- SpecialOrderedSetsQuadratic.cpp
- TravelingSalesPerson.cpp
- Wagon.cpp

Parameters

  data | Array data with data for this inequality.

Returns
  The value for this inequality in `data`.

Since
  44.00

## setFormula()

auto xpress::objects::Inequality::setFormula | ( | xpress::objects::FormulaExpression const & | formula | ) | -> Inequality&
| inline

Set the formula for this inequality.

Changes (only) the formula in this inequality to the specified formula. Any previously existing formula will be overwritten.

Parameters

  formula | The formula for this inequality.

Returns
  Always returns this instance.

Since
  47.00

## setName()

auto xpress::objects::Inequality::setName | ( | std::optional< std::string > | newName | ) | -> Inequality&
| inline

Set the name of this inequality.

Sets the name of this inequality in the problem instance that owns the object.

Examples using `setName`:

- Catenary.cpp
- ContractAllocation.cpp
- CuttingStock.cpp
- FolioIIS.cpp
- FolioInit.cpp
- FolioMip1.cpp
- FolioMipIIS.cpp
- FolioQC.cpp
- GeneralConstraints.cpp
- ProductionPlanning_Index.cpp
- RecursiveFinancialPlanning.cpp

Parameters

  newName | The name to be set.

Returns
  Always returns this instance.

Since
  44.00

## setRhs()

auto xpress::objects::Inequality::setRhs | ( | double | newRhs | ) | -> Inequality&
| inline

Set the right-hand side for this row.

Set the right-hand side in the `xpress::objects::XpressProblem` instance to which this row belongs.

Examples using `setRhs`:

- RecursiveFinancialPlanning.cpp

Parameters

  newRhs | New rhs.

Returns
  This row

Since
  44.00

## setRhsRange()

auto xpress::objects::Inequality::setRhsRange | ( | double | newRange | ) | -> Inequality&
| inline

Set the right-hand side range for this row.

Sets the right-hand side range value in the `xpress::objects::XpressProblem` instance to which this row belongs.

Parameters

  newRange | The range value for this row.

Returns
  This row.

Since
  44.00

## setType()

auto xpress::objects::Inequality::setType | ( | xpress::RowType | newType | ) | -> Inequality&
| inline

Set the type for this row.

Set the type in the `xpress::objects::XpressProblem` instance to which this row belongs.

Parameters

  newType | New type.

Returns
  This row

Since
  44.00

The documentation for this class was generated from the following file:

- xpress_objects.hpp

Parent Topic objects

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.