ScsEigen::Cost class

Cost describes a generic convex cost.

Derived classes

class LinearCost
class QuadraticCost

Constructors, destructors, conversion operators

Cost() protected defaulted
Constructor,.
Cost(int numberOfVariables, std::string_view description = "") protected
Constructor,.
~Cost() defaulted
Desctructor.

Public functions

auto getDescription() const -> std::string_view
Get the description.
auto getNumberOfVariables() const -> int
Get the number of variables.

Protected functions

void setDescription(std::string_view description)
Set the description of the constraint.
auto setNumberOfVariables(int numberOfVariables) -> bool
Set the number of variables.

Protected variables

std::string m_description
int m_numberOfVariables

Function documentation

ScsEigen::Cost::Cost(int numberOfVariables, std::string_view description = "") protected

Constructor,.

Parameters
numberOfVariables number of variables associated to the constraint.
description string describing the constraint.

std::string_view ScsEigen::Cost::getDescription() const

Get the description.

Returns the string containng the description

int ScsEigen::Cost::getNumberOfVariables() const

Get the number of variables.

Returns the number of variables,

void ScsEigen::Cost::setDescription(std::string_view description) protected

Set the description of the constraint.

Parameters
description string describing the constraint.

bool ScsEigen::Cost::setNumberOfVariables(int numberOfVariables) protected

Set the number of variables.

Parameters
numberOfVariables a positive number describing the number of variables.
Returns true in case of success/false otherwise

Variable documentation

std::string ScsEigen::Cost::m_description protected

Description of the cost.

int ScsEigen::Cost::m_numberOfVariables protected

Number of variables associated to the constraint.