ScsEigen::LinearCost class

LinearCost is a concrete implementation of Cost. It implements a cost of the form

\[ f(x) = a ^\top x + b \]

where $x \in \mathbb{R}^n$ is the optimization variable, $a \in \mathbb{R}^n$ and $b \in \mathbb{R}$

Base classes

class Cost

Constructors, destructors, conversion operators

LinearCost() defaulted
Constructor.
LinearCost(const Eigen::Ref<const Eigen::VectorXd>& a, double b = 0)
Constructor.

Public functions

auto setA(const Eigen::Ref<const Eigen::VectorXd>& a) -> bool
Set the vector $a$ .
void setB(double b)
Set the scalar $b$ .
auto getA() const -> Eigen::Ref<const Eigen::VectorXd>
Get the vector $a$ .
auto getB() const -> double
Get the scalar $b$ .

Function documentation

ScsEigen::LinearCost::LinearCost() defaulted

Constructor.

ScsEigen::LinearCost::LinearCost(const Eigen::Ref<const Eigen::VectorXd>& a, double b = 0)

Constructor.

Parameters
a the vector $a$ .
b optional parameter. If not provided the is set to zero.

bool ScsEigen::LinearCost::setA(const Eigen::Ref<const Eigen::VectorXd>& a)

Set the vector $a$ .

Parameters
a the vector $a$ .
Returns true/false in case of success/failure.

void ScsEigen::LinearCost::setB(double b)

Set the scalar $b$ .

Parameters
b the scalar $b$ .