ZonoOpt v2.0.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ZonoOpt::Inequality Class Reference

Inequality class. More...

#include <Inequality.hpp>

Public Member Functions

 Inequality (const int n_dims)
 Constructs inequality, must specify number of dimensions.
 
 Inequality (const int n_dims, const std::vector< IneqTerm > &terms, const zono_float rhs, const IneqType type)
 Constructs inequality with all quantities specified.
 
void add_term (const int idx, const zono_float coeff)
 Adds a term to the inequality.
 
void set_rhs (const zono_float rhs)
 Set the right hand side of the inequality.
 
void set_ineq_type (const IneqType type)
 Sets the direction of the inequality or sets it to be an equality.
 
const std::vector< IneqTerm > & get_terms () const
 Get reference to terms in the inequality.
 
zono_float get_rhs () const
 Get right hand side of the inequality.
 
IneqType get_ineq_type () const
 Get inequality type / direction.
 
int get_n_dims () const
 Get number of dimensions for inequality.
 

Detailed Description

Inequality class.

Constructor & Destructor Documentation

◆ Inequality() [1/2]

ZonoOpt::Inequality::Inequality ( const int  n_dims)
inlineexplicit

Constructs inequality, must specify number of dimensions.

Parameters
n_dimsnumber of dimensions in inequality

◆ Inequality() [2/2]

ZonoOpt::Inequality::Inequality ( const int  n_dims,
const std::vector< IneqTerm > &  terms,
const zono_float  rhs,
const IneqType  type 
)
inline

Constructs inequality with all quantities specified.

Parameters
n_dimsnumber of dimensions in inequality
termsvector of terms in inequality
rhsright-hand side of the inequality
typeinequality type (e.g., less than or equal, greater than or equal, or equal)

Member Function Documentation

◆ add_term()

void ZonoOpt::Inequality::add_term ( const int  idx,
const zono_float  coeff 
)
inline

Adds a term to the inequality.

Parameters
idxvariable index
coeffcoefficient

◆ get_ineq_type()

IneqType ZonoOpt::Inequality::get_ineq_type ( ) const
inline

Get inequality type / direction.

Returns
inequality type (type member)

◆ get_n_dims()

int ZonoOpt::Inequality::get_n_dims ( ) const
inline

Get number of dimensions for inequality.

Returns
number of dimensions (n_dims member)

◆ get_rhs()

zono_float ZonoOpt::Inequality::get_rhs ( ) const
inline

Get right hand side of the inequality.

Returns
right hand side value (rhs member)

◆ get_terms()

const std::vector< IneqTerm > & ZonoOpt::Inequality::get_terms ( ) const
inline

Get reference to terms in the inequality.

Returns
reference to terms member

◆ set_ineq_type()

void ZonoOpt::Inequality::set_ineq_type ( const IneqType  type)
inline

Sets the direction of the inequality or sets it to be an equality.

Parameters
typeinequality type (e.g., less than or equal, greater than or equal, or equal)

◆ set_rhs()

void ZonoOpt::Inequality::set_rhs ( const zono_float  rhs)
inline

Set the right hand side of the inequality.

Parameters
rhsright hand side value

The documentation for this class was generated from the following file: