Initializing help system before first use

# PWLExpression

A class that represents a piecewise linear function. More...

Inheritance diagram for xpress::objects::PWLExpression:

## Public Member Functions
template<typename... POINTS, typename RestrictPack = typename std::enable_if<xpress::AllConvertible<xpress::PwlBreakpoint, POINTS...>::value>::type>
| PWLExpression (int argument, POINTS... points)
| Create a piecewise linear function invocation.
| PWLExpression (int argument, xpress::SizedArray< double const > const &breakX, xpress::SizedArray< double const > const &breakY)
| Create a piecewise linear function invocation.
| PWLExpression (int argument, xpress::SizedArray< PwlBreakpoint const > const &points)
| Create a piecewise linear function invocation.
template<typename... POINTS, typename RestrictPack = typename std::enable_if<xpress::AllConvertible<xpress::PwlBreakpoint, POINTS...>::value>::type>
| PWLExpression (Variable argument, POINTS... points)
| Create a piecewise linear function invocation.
| PWLExpression (Variable argument, xpress::SizedArray< double const > const &breakX, xpress::SizedArray< double const > const &breakY)
| Create a piecewise linear function invocation.
| PWLExpression (Variable argument, xpress::SizedArray< PwlBreakpoint const > const &points)
| Create a piecewise linear function invocation.
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 | getArgumentColumn () const -> int const &
auto | getArgumentVariable () const -> xpress::objects::Variable const &
auto | getBreakX () const -> std::vector< double > const &
auto | getBreakY () const -> std::vector< double > const &
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`:
Public Member Functions inherited from xpress::objects::FormulaExpression
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 | div (double arg) const -> xpress::objects::Expression
| Create a expression that represents the quotient of `this` and `arg`.
virtual auto | div (Expression arg) const -> xpress::objects::Expression
| Create a expression that represents the quotient of `this` and `arg`.
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 | mul (double arg) const -> xpress::objects::Expression
| Create a expression that represents the product of `this` and `arg`.
virtual auto | mul (Expression arg) const -> xpress::objects::Expression
| Create a expression that represents the product 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`.
virtual auto | uminus () const -> xpress::objects::Expression
| Create a expression that represents the unary minus of this one.

## Detailed Description

A class that represents a piecewise linear function.

Since
  44.00

## Constructor & Destructor Documentation

## PWLExpression() [1/6]

xpress::objects::PWLExpression::PWLExpression | ( | Variable | argument,
|  | xpress::SizedArray< double const > const & | breakX,
|  | xpress::SizedArray< double const > const & | breakY )
| inline

Create a piecewise linear function invocation.

The constructor will sort the breakpoints lexicographically.

Parameters

  argument | Variable at which the function should be evaluated.
  breakX | x coordinates of breakpoints.
  breakY | y coordinates of breakpoints.

Since
  44.00

## PWLExpression() [2/6]

template<typename... POINTS, typename RestrictPack >

xpress::objects::PWLExpression::PWLExpression | ( | Variable | argument,
|  | POINTS... | points )
| inline

Create a piecewise linear function invocation.

The constructor will sort the breakpoints lexicographically.

Parameters

  argument | Variable at which the function should be evaluated.
  points | The breakpoints for the PWL.

Since
  44.00

## PWLExpression() [3/6]

xpress::objects::PWLExpression::PWLExpression | ( | Variable | argument,
|  | xpress::SizedArray< PwlBreakpoint const > const & | points )
| inline

Create a piecewise linear function invocation.

The constructor will sort the breakpoints lexicographically.

Parameters

  argument | Variable at which the function should be evaluated.
  points | The breakpoints for the PWL.

Since
  44.00

## PWLExpression() [4/6]

xpress::objects::PWLExpression::PWLExpression | ( | int | argument,
|  | xpress::SizedArray< double const > const & | breakX,
|  | xpress::SizedArray< double const > const & | breakY )
| inline

Create a piecewise linear function invocation.

The constructor will sort the breakpoints lexicographically.

Parameters

  argument | Column index at which the function should be evaluated.
  breakX | x coordinates of breakpoints.
  breakY | y coordinates of breakpoints.

Since
  44.00

## PWLExpression() [5/6]

template<typename... POINTS, typename RestrictPack >

xpress::objects::PWLExpression::PWLExpression | ( | int | argument,
|  | POINTS... | points )
| inline

Create a piecewise linear function invocation.

The constructor will sort the breakpoints lexicographically.

Parameters

  argument | Column index at which the function should be evaluated.
  points | The breakpoints for the PWL.

Since
  44.00

## PWLExpression() [6/6]

xpress::objects::PWLExpression::PWLExpression | ( | int | argument,
|  | xpress::SizedArray< PwlBreakpoint const > const & | points )
| inline

Create a piecewise linear function invocation.

The constructor will sort the breakpoints lexicographically.

Parameters

  argument | Column index at which the function should be evaluated.
  points | The breakpoints for the PWL.

Since
  44.00

## Member Function Documentation

## evaluate()

auto xpress::objects::PWLExpression::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.

## getArgumentColumn()

auto xpress::objects::PWLExpression::getArgumentColumn | ( |  | ) | const -> int const &
| inline

Since
  44 [get].00

## getArgumentVariable()

auto xpress::objects::PWLExpression::getArgumentVariable | ( |  | ) | const -> xpress::objects::Variable const &
| inline

Since
  44 [get].00

## getBreakX()

auto xpress::objects::PWLExpression::getBreakX | ( |  | ) | const -> std::vector<double> const &
| inline

Since
  44 [get].00

## getBreakY()

auto xpress::objects::PWLExpression::getBreakY | ( |  | ) | const -> std::vector<double> const &
| inline

Since
  44 [get].00

## toString()

auto xpress::objects::PWLExpression::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.

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.