Initializing help system before first use

# LinTerm

A linear term. More...

Inheritance diagram for xpress::objects::LinTerm:

## Public Member Functions
| LinTerm (Variable const &variable, double coefficient)
| Create a term.
auto | div (ConstantExpression arg) const -> xpress::objects::LinTerm
| Create a expression that represents the quotient of `this` and `arg`.
virtual auto | div (double arg) const -> xpress::objects::Expression override
  | Create a expression that represents the quotient of `this` and `arg`. Parameters
  arg | Divisor.
Returns Quotient of `this` and `arg`. Since 44.00
virtual auto | div (Expression arg) const -> xpress::objects::Expression override
  | Create a expression that represents the quotient of `this` and `arg`. Parameters
  arg | Divisor.
Returns Quotient of `this` and `arg`. Since 44.00
virtual auto | evaluate (xpress::SizedArray< double const > const &solution) const -> double override
  | Compute the value of this expression with respect to the given solution vector (which is not required to be feasible).Examples using `evaluate`: CapitalBudgeting.cpp PolygonObjects.cpp Parameters
  solution | Solution values for which the expression is evaluated.
Returns The value of this expression evaluated at `solution`. Since 44.00 Examples using `evaluate`:
auto | getCoefficient () const -> double const &
| The coefficient for `variable` in this term [get].
auto | getVariable () const -> xpress::objects::Variable const &
| The variable in the term [get].
auto | mul (ConstantExpression arg) const -> xpress::objects::LinTerm
| Create a expression that represents the product of `this` and `arg`.
virtual auto | mul (double arg) const -> xpress::objects::Expression override
  | Create a expression that represents the product of `this` and `arg`.Examples using `mul`: Capbgt2l.cpp Parameters
  arg | Factor.
Returns Product of `this` and `arg`. Since 44.00 Examples using `mul`:
auto | mul (LinTerm arg) const -> xpress::objects::QuadTerm
| Create a expression that represents the product of `this` and `arg`.
auto | mul (Variable arg) const -> xpress::objects::QuadTerm
| Create a expression that represents the product of `this` and `arg`.
virtual auto | mul (xpress::objects::Expression arg) const -> xpress::objects::Expression override
  | Create a expression that represents the product of `this` and `arg`.Examples using `mul`: Capbgt2l.cpp Parameters
  arg | Factor.
Returns Product of `this` and `arg`. Since 44.00 Examples using `mul`:
auto | square () const -> xpress::objects::QuadTerm
| Multiply this term by itself.
virtual auto | toString () const -> std::string override
| Get a string representation of this expression.Examples using `toString`: Boxes02.cpp Capbgt2l.cpp Returns A string representing this expression. Since 44.00 Examples using `toString`:
virtual auto | uminus () const -> xpress::objects::Expression override
| Create a expression that represents the unary minus of this one. Returns Expression representing `-this`. Since 44.00
Public Member Functions inherited from xpress::objects::AbstractExpression
virtual auto | eq (double rhs) const -> xpress::objects::InequalityDefinition override
  | Create an "equals" constraint with this expression as left-hand side.Examples using `eq`: BoolVars.cpp Parameters
  rhs | Right-hand side of constraint.
Returns The constraint. Since 44.00 Examples using `eq`:
virtual auto | eq (Expression const &rhs) const -> xpress::objects::InequalityDefinition override
  | Create an "equals" constraint with this expression as left-hand side.Examples using `eq`: BoolVars.cpp Parameters
  rhs | Right-hand side of constraint.
Returns The constraint. Since 44.00 Examples using `eq`:
virtual auto | geq (double rhs) const -> xpress::objects::InequalityDefinition override
  | Create a "greater than or equal" constraint with this expression as left-hand side. Parameters
  rhs | Right-hand side of constraint.
Returns The constraint. Since 44.00
virtual auto | geq (Expression const &rhs) const -> xpress::objects::InequalityDefinition override
  | Create a "greater than or equal" constraint with this expression as left-hand side. Parameters
  rhs | Right-hand side of constraint.
Returns The constraint. Since 44.00
virtual auto | in (double lb, double ub) -> xpress::objects::InequalityDefinition override
  | Create a range constraint that bounds this expression from below and above.Examples using `in`: Folio.cpp FolioCB.cpp FolioMipIIS.cpp QuadraticProgramming.cpp Parameters
  lb | Lower bound for this expression.
  ub | Upper bound for this expression.
Returns The constraint. Since 44.00 Examples using `in`:
virtual auto | leq (double rhs) const -> xpress::objects::InequalityDefinition override
  | Create a "less than or equal" constraint with this expression as left-hand side.Examples using `leq`: TravelingSalesPerson.cpp Parameters
  rhs | Right-hand side of constraint.
Returns The constraint. Since 44.00 Examples using `leq`:
virtual auto | leq (Expression const &rhs) const -> xpress::objects::InequalityDefinition override
  | Create a "less than or equal" constraint with this expression as left-hand side.Examples using `leq`: TravelingSalesPerson.cpp Parameters
  rhs | Right-hand side of constraint.
Returns The constraint. Since 44.00 Examples using `leq`:
Public Member Functions inherited from xpress::objects::Expression
virtual auto | minus (double arg) const -> xpress::objects::Expression
| Create a expression that represents the difference of `this` and `arg`.
virtual auto | minus (xpress::objects::Expression arg) const -> xpress::objects::Expression
| Create a expression that represents the difference of `this` and `arg`.
virtual auto | plus (double arg) const -> xpress::objects::Expression
| Create a expression that represents the sum of `this` and `arg`.
virtual auto | plus (xpress::objects::Expression arg) const -> xpress::objects::Expression
| Create a expression that represents the sum of `this` and `arg`.

## Static Public Member Functions
static auto | lTerm (Variable variable) -> xpress::objects::LinTerm
| Convenience function to create a single linear term.
static auto | lTerm (xpress::objects::Variable variable, double coefficient) -> xpress::objects::LinTerm
| Convenience function to create a single linear term.
static auto | toString (xpress::objects::Variable const &v, double coef) -> std::string
| Convert a linear term to a string.

## Detailed Description

A linear term.

Since
  44.00

## Constructor & Destructor Documentation

## LinTerm()

xpress::objects::LinTerm::LinTerm | ( | Variable const & | variable,
|  | double | coefficient )
| inline

Create a term.

Parameters

  variable | objects.Variable in the term.
  coefficient | Coefficient for `variable`.

Since
  44.00

## Member Function Documentation

## div() [1/3]

auto xpress::objects::LinTerm::div | ( | ConstantExpression | arg | ) | const -> xpress::objects::LinTerm
| inline

Create a expression that represents the quotient of `this` and `arg`.

Parameters

  arg | Divisor.

Returns
  The expression.

Since
  44.00

## div() [2/3]

auto xpress::objects::LinTerm::div | ( | double | arg | ) | const -> xpress::objects::Expression
| inline override virtual

Create a expression that represents the quotient of `this` and `arg`.

Parameters

  arg | Divisor.

Returns
  Quotient of `this` and `arg`.

Since
  44.00

Since
  44.00

Reimplemented from xpress::objects::Expression.

## div() [3/3]

auto xpress::objects::LinTerm::div | ( | Expression | arg | ) | const -> xpress::objects::Expression
| inline override virtual

Create a expression that represents the quotient of `this` and `arg`.

Parameters

  arg | Divisor.

Returns
  Quotient of `this` and `arg`.

Since
  44.00

Since
  44.00

Reimplemented from xpress::objects::Expression.

## evaluate()

auto xpress::objects::LinTerm::evaluate | ( | xpress::SizedArray< double const > const & | solution | ) | const -> double
| inline override virtual

Compute the value of this expression with respect to the given solution vector (which is not required to be feasible).Examples using `evaluate`:

- CapitalBudgeting.cpp
- PolygonObjects.cpp

Parameters

  solution | Solution values for which the expression is evaluated.

Returns
  The value of this expression evaluated at `solution`.

Since
  44.00

Examples using `evaluate`:

- CapitalBudgeting.cpp
- PolygonObjects.cpp

Since
  44.00

Reimplemented from xpress::objects::Expression.

## getCoefficient()

auto xpress::objects::LinTerm::getCoefficient | ( |  | ) | const -> double const &
| inline

The coefficient for `variable` in this term [get].

Since
  44.00

## getVariable()

auto xpress::objects::LinTerm::getVariable | ( |  | ) | const -> xpress::objects::Variable const &
| inline

The variable in the term [get].

Since
  44.00

## lTerm() [1/2]

auto xpress::objects::LinTerm::lTerm | ( | Variable | variable | ) | -> xpress::objects::LinTerm
| inline static

Convenience function to create a single linear term.

Creates the term `1 * variable`.

Parameters

  variable | objects.Variable for term.

Returns
  The newly created term.

Since
  44.00

## lTerm() [2/2]

auto xpress::objects::LinTerm::lTerm | ( | xpress::objects::Variable | variable,
|  | double | coefficient ) -> xpress::objects::LinTerm
| inline static

Convenience function to create a single linear term.

Parameters

  variable | objects.Variable for term.
  coefficient | Coefficient for term.

Returns
  The newly created term.

Since
  44.00

## mul() [1/5]

auto xpress::objects::LinTerm::mul | ( | ConstantExpression | arg | ) | const -> xpress::objects::LinTerm
| inline

Create a expression that represents the product of `this` and `arg`.

Examples using `mul`:

- Capbgt2l.cpp

Parameters

  arg | Factor.

Returns
  The expression.

Since
  44.00

## mul() [2/5]

auto xpress::objects::LinTerm::mul | ( | double | arg | ) | const -> xpress::objects::Expression
| inline override virtual

Create a expression that represents the product of `this` and `arg`.Examples using `mul`:

- Capbgt2l.cpp

Parameters

  arg | Factor.

Returns
  Product of `this` and `arg`.

Since
  44.00

Examples using `mul`:

- Capbgt2l.cpp

Since
  44.00

Reimplemented from xpress::objects::Expression.

## mul() [3/5]

auto xpress::objects::LinTerm::mul | ( | LinTerm | arg | ) | const -> xpress::objects::QuadTerm
| inline

Create a expression that represents the product of `this` and `arg`.

Examples using `mul`:

- Capbgt2l.cpp

Parameters

  arg | Factor.

Returns
  The expression.

Since
  44.00

## mul() [4/5]

auto xpress::objects::LinTerm::mul | ( | Variable | arg | ) | const -> xpress::objects::QuadTerm
| inline

Create a expression that represents the product of `this` and `arg`.

Examples using `mul`:

- Capbgt2l.cpp

Parameters

  arg | Factor.

Returns
  The expression.

Since
  44.00

## mul() [5/5]

auto xpress::objects::LinTerm::mul | ( | xpress::objects::Expression | arg | ) | const -> xpress::objects::Expression
| inline override virtual

Create a expression that represents the product of `this` and `arg`.Examples using `mul`:

- Capbgt2l.cpp

Parameters

  arg | Factor.

Returns
  Product of `this` and `arg`.

Since
  44.00

Examples using `mul`:

- Capbgt2l.cpp

Since
  44.00

Reimplemented from xpress::objects::Expression.

## square()

auto xpress::objects::LinTerm::square | ( |  | ) | const -> xpress::objects::QuadTerm
| inline

Multiply this term by itself.

Examples using `square`:

- PolygonObjects.cpp
- QuadraticProgramming.cpp

Returns
  The product of this term with itself.

Since
  44.00

## toString() [1/2]

auto xpress::objects::LinTerm::toString | ( |  | ) | const -> std::string
| inline override virtual

Get a string representation of this expression.Examples using `toString`:

- Boxes02.cpp
- Capbgt2l.cpp

Returns
  A string representing this expression.

Since
  44.00

Examples using `toString`:

- Boxes02.cpp
- Capbgt2l.cpp

Since
  44.00

Reimplemented from xpress::objects::Expression.

## toString() [2/2]

auto xpress::objects::LinTerm::toString | ( | xpress::objects::Variable const & | v,
|  | double | coef ) -> std::string
| inline static

Convert a linear term to a string.

Note that while the `LinTerm` class does not allow `XpressProblem::NULL_VARIABLE` as variable, this function allows this variable to indicate constantterms.

Examples using `toString`:

- Boxes02.cpp
- Capbgt2l.cpp

Parameters

  v | Variable in linear term.
  coef | Coeffcient in linear term.

Returns
  String representation of `coef*v`.

Since
  44.00

## uminus()

auto xpress::objects::LinTerm::uminus | ( |  | ) | const -> xpress::objects::Expression
| inline override virtual

Create a expression that represents the unary minus of this one.

Returns
  Expression representing `-this`.

Since
  44.00

Since
  44.00

Reimplemented from xpress::objects::Expression.

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.