Initializing help system before first use

# GeneralConstraintDefinition

Definition of a general constraint. More...

Inheritance diagram for xpress::objects::GeneralConstraintDefinition:

## Public Member Functions
template<typename Strm_variables , is-stream(Strm_variables) >
| GeneralConstraintDefinition (Variable resultant, xpress::GenConsType type, Strm_variables const &variables, std::optional< std::string > name)
| Create a general constraint description.
template<typename Strm_variables , typename Strm_value , is-stream(Strm_variables) , is-stream(Strm_value) >
| GeneralConstraintDefinition (Variable resultant, xpress::GenConsType type, Strm_variables const &variables, Strm_value const &value, std::optional< std::string > name)
| Create a general constraint description.
template<typename... VARIABLES, typename RestrictPack = typename std::enable_if<xpress::AllConvertible<Variable, VARIABLES...>::value>::type>
| GeneralConstraintDefinition (Variable resultant, xpress::GenConsType type, VARIABLES... variables)
| Create a general constraint description.
| GeneralConstraintDefinition (Variable resultant, xpress::GenConsType type, xpress::SizedArray< Variable const > const &variables)
| Create a general constraint description.
| GeneralConstraintDefinition (Variable resultant, xpress::GenConsType type, xpress::SizedArray< Variable const > const &variables, xpress::SizedArray< double const > const &values)
| Create a general constraint description.
auto | setName (std::optional< std::string > newName) -> GeneralConstraintDefinition &
| Set the name of the constraint.
Public Member Functions inherited from xpress::objects::ConstraintDefinition< GeneralConstraint >
virtual auto | getName () const -> std::optional< std::string >
| Get the name of this constraint.
virtual auto | setConstraintName (std::optional< std::string > newName) -> ConstraintDefinition< GeneralConstraint > &final
| Set the name of this constraint.

## Detailed Description

Definition of a general constraint.

Instances of this class describe a constraint that has not yet been added but can be added using `XpressProblem.addConstraint()` or `XpressProblem.addConstraints()`. Users should usually not have to deal with this class explicitly.

Since
  44.00

## Constructor & Destructor Documentation

## GeneralConstraintDefinition() [1/5]

template<typename Strm_variables , typename Strm_value , typename Strm_variablesIsStream , typename Strm_valueIsStream >

xpress::objects::GeneralConstraintDefinition::GeneralConstraintDefinition | ( | Variable | resultant,
|  | xpress::GenConsType | type,
|  | Strm_variables const & | variables,
|  | Strm_value const & | value,
|  | std::optional< std::string > | name )
| inline

Create a general constraint description.

In order to actually add this constraint to a problem you must use the problem's `addConstraint` function.

Parameters

  resultant | The resultant variable.
  type | Type of constraint.
  variables | The variables in the general constraint. May be `nullptr`.
  value | The values in the general constraint. May be `nullptr`.
  name | The name of the general constraint. May be `std::nullopt`.

Template Parameters

  Strm_variables | Something that supports `begin()` and `end()` and contains values of type `Variable`.
  Strm_value | Something that supports `begin()` and `end()` and contains values of type `double`.

Since
  44.00

## GeneralConstraintDefinition() [2/5]

template<typename Strm_variables , typename Strm_variablesIsStream >

xpress::objects::GeneralConstraintDefinition::GeneralConstraintDefinition | ( | Variable | resultant,
|  | xpress::GenConsType | type,
|  | Strm_variables const & | variables,
|  | std::optional< std::string > | name )
| inline

Create a general constraint description.

In order to actually add this constraint to a problem you must use the problem's `addConstraint` function.

Parameters

  resultant | The resultant variable.
  type | Type of constraint.
  variables | The variables in the general constraint. May be `nullptr`.
  name | Constraint name. May be `std::nullopt`.

Template Parameters

  Strm_variables | Something that supports `begin()` and `end()` and contains values of type `Variable`.

Since
  44.00

## GeneralConstraintDefinition() [3/5]

template<typename... VARIABLES, typename RestrictPack >

xpress::objects::GeneralConstraintDefinition::GeneralConstraintDefinition | ( | Variable | resultant,
|  | xpress::GenConsType | type,
|  | VARIABLES... | variables )
| inline

Create a general constraint description.

In order to actually add this constraint to a problem you must use the problem's `addConstraint` function.

Parameters

  resultant | The resultant variable.
  type | Type of constraint.
  variables | The variables in the general constraint. May be `nullptr`.

Since
  44.00

## GeneralConstraintDefinition() [4/5]

xpress::objects::GeneralConstraintDefinition::GeneralConstraintDefinition | ( | Variable | resultant,
|  | xpress::GenConsType | type,
|  | xpress::SizedArray< Variable const > const & | variables )
| inline

Create a general constraint description.

In order to actually add this constraint to a problem you must use the problem's `addConstraint` function.

Parameters

  resultant | The resultant variable.
  type | Type of constraint.
  variables | The variables in the general constraint. May be `nullptr`.

Since
  44.00

## GeneralConstraintDefinition() [5/5]

xpress::objects::GeneralConstraintDefinition::GeneralConstraintDefinition | ( | Variable | resultant,
|  | xpress::GenConsType | type,
|  | xpress::SizedArray< Variable const > const & | variables,
|  | xpress::SizedArray< double const > const & | values )
| inline

Create a general constraint description.

In order to actually add this constraint to a problem you must use the problem's `addConstraint` function.

Parameters

  resultant | The resultant variable.
  type | Type of constraint.
  variables | The variables in the general constraint. May be `nullptr`.
  values | The values in the general constraint. May be `nullptr`.

Since
  44.00

## Member Function Documentation

## setName()

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

Set the name of the constraint.

This is the same as `ConstraintDefinition#setConstraintName(std::optional<std::string>)` but with a different return type.

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 | New name.

Returns
  Always returns this instance.

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.