idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
idol::QuadExpr< KeyT, ValueT > Class Template Reference
Inheritance diagram for idol::QuadExpr< KeyT, ValueT >:
Inheritance graph
Collaboration diagram for idol::QuadExpr< KeyT, ValueT >:
Collaboration graph

Public Types

using iterator = typename map_t::iterator
 
using const_iterator = typename map_t::const_iterator
 

Public Member Functions

 QuadExpr (ValueT t_constant)
 
 QuadExpr (const KeyT &t_key)
 
 QuadExpr (LinExpr< KeyT, ValueT > t_expr)
 
 QuadExpr (AffExpr< KeyT, ValueT > t_expr)
 
 QuadExpr (const KeyT &t_key1, const KeyT &t_key2)
 
 QuadExpr (const ValueT &t_factor, const KeyT &t_key1, const KeyT &t_key2)
 
 QuadExpr (ValueT &&t_factor, const KeyT &t_key1, const KeyT &t_key2)
 
 QuadExpr (const ValueT &t_factor, const KeyT &t_key)
 
 QuadExpr (ValueT &&t_factor, const KeyT &t_key)
 
 QuadExpr (const QuadExpr &t_src)=default
 
 QuadExpr (QuadExpr &&) noexcept=default
 
QuadExproperator= (const QuadExpr &t_rhs)=default
 
QuadExproperator= (QuadExpr &&) noexcept=default
 
QuadExproperator+= (const QuadExpr &t_rhs)
 
QuadExproperator-= (const QuadExpr &t_rhs)
 
QuadExproperator*= (double t_rhs)
 
QuadExproperator/= (double t_rhs)
 
QuadExpr operator- () const
 
AffExpr< KeyT, ValueT > & affine ()
 
const AffExpr< KeyT, ValueT > & affine () const
 
bool has_quadratic () const
 
bool empty_all () const
 
bool is_zero (double t_tolerance) const override
 
void clear_all ()
 
LinExproperator+= (const LinExpr< KeyT, ValueT > &t_rhs)
 
LinExproperator+= (const KeyT &t_rhs)
 
virtual SparseVectoroperator+= (const SparseVector &t_vector)
 
LinExproperator-= (const LinExpr< KeyT, ValueT > &t_rhs)
 
LinExproperator-= (const KeyT &t_rhs)
 
virtual SparseVectoroperator-= (const SparseVector &t_vector)
 
virtual SparseVectoroperator*= (std::conditional_t< std::is_arithmetic_v< ValueT >, ValueT, double > t_scalar)
 
virtual SparseVectoroperator/= (std::conditional_t< std::is_arithmetic_v< ValueT >, ValueT, double > t_scalar)
 
unsigned int size () const
 
bool empty () const
 
bool has_index (const IndexT &t_index) const
 
const ValueT & get (const IndexT &t_index1) const
 
void set (const IndexT &t_index, const ValueT &t_value)
 
void remove (const IndexT &t_index)
 
void clear ()
 
void reserve (unsigned int t_capacity)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
SparseVectormerge_without_conflict (const SparseVector &t_vec)
 

Static Public Attributes

static LinExpr< KeyT, ValueT > Zero {}
 

Detailed Description

template<class KeyT = idol::Var, class ValueT = double>
class idol::QuadExpr< KeyT, ValueT >

Definition at line 16 of file QuadExpr.h.

Member Typedef Documentation

◆ const_iterator

template<class IndexT , class ValueT >
using idol::SparseVector< IndexT, ValueT >::const_iterator = typename map_t::const_iterator
inherited

Definition at line 128 of file SparseVector.h.

◆ iterator

template<class IndexT , class ValueT >
using idol::SparseVector< IndexT, ValueT >::iterator = typename map_t::iterator
inherited

Definition at line 127 of file SparseVector.h.

Constructor & Destructor Documentation

◆ QuadExpr() [1/9]

template<class KeyT = idol::Var, class ValueT = double>
idol::QuadExpr< KeyT, ValueT >::QuadExpr ( ValueT  t_constant)
inline

Definition at line 20 of file QuadExpr.h.

◆ QuadExpr() [2/9]

template<class KeyT = idol::Var, class ValueT = double>
idol::QuadExpr< KeyT, ValueT >::QuadExpr ( const KeyT &  t_key)
inline

Definition at line 21 of file QuadExpr.h.

◆ QuadExpr() [3/9]

template<class KeyT = idol::Var, class ValueT = double>
idol::QuadExpr< KeyT, ValueT >::QuadExpr ( LinExpr< KeyT, ValueT >  t_expr)
inline

Definition at line 22 of file QuadExpr.h.

◆ QuadExpr() [4/9]

template<class KeyT = idol::Var, class ValueT = double>
idol::QuadExpr< KeyT, ValueT >::QuadExpr ( AffExpr< KeyT, ValueT >  t_expr)
inline

Definition at line 23 of file QuadExpr.h.

◆ QuadExpr() [5/9]

template<class KeyT = idol::Var, class ValueT = double>
idol::QuadExpr< KeyT, ValueT >::QuadExpr ( const KeyT &  t_key1,
const KeyT &  t_key2 
)
inline

Definition at line 25 of file QuadExpr.h.

◆ QuadExpr() [6/9]

template<class KeyT = idol::Var, class ValueT = double>
idol::QuadExpr< KeyT, ValueT >::QuadExpr ( const ValueT &  t_factor,
const KeyT &  t_key1,
const KeyT &  t_key2 
)
inline

Definition at line 26 of file QuadExpr.h.

◆ QuadExpr() [7/9]

template<class KeyT = idol::Var, class ValueT = double>
idol::QuadExpr< KeyT, ValueT >::QuadExpr ( ValueT &&  t_factor,
const KeyT &  t_key1,
const KeyT &  t_key2 
)
inline

Definition at line 27 of file QuadExpr.h.

◆ QuadExpr() [8/9]

template<class KeyT = idol::Var, class ValueT = double>
idol::QuadExpr< KeyT, ValueT >::QuadExpr ( const ValueT &  t_factor,
const KeyT &  t_key 
)
inline

Definition at line 28 of file QuadExpr.h.

◆ QuadExpr() [9/9]

template<class KeyT = idol::Var, class ValueT = double>
idol::QuadExpr< KeyT, ValueT >::QuadExpr ( ValueT &&  t_factor,
const KeyT &  t_key 
)
inline

Definition at line 29 of file QuadExpr.h.

Member Function Documentation

◆ affine() [1/2]

template<class KeyT = idol::Var, class ValueT = double>
AffExpr< KeyT, ValueT > & idol::QuadExpr< KeyT, ValueT >::affine ( )
inline

Definition at line 43 of file QuadExpr.h.

◆ affine() [2/2]

template<class KeyT = idol::Var, class ValueT = double>
const AffExpr< KeyT, ValueT > & idol::QuadExpr< KeyT, ValueT >::affine ( ) const
inline

Definition at line 44 of file QuadExpr.h.

◆ begin() [1/2]

template<class IndexT , class ValueT >
iterator idol::SparseVector< IndexT, ValueT >::begin ( )
inlineinherited

Definition at line 130 of file SparseVector.h.

◆ begin() [2/2]

template<class IndexT , class ValueT >
const_iterator idol::SparseVector< IndexT, ValueT >::begin ( ) const
inlineinherited

Definition at line 134 of file SparseVector.h.

◆ cbegin()

template<class IndexT , class ValueT >
const_iterator idol::SparseVector< IndexT, ValueT >::cbegin ( ) const
inlineinherited

Definition at line 138 of file SparseVector.h.

◆ cend()

template<class IndexT , class ValueT >
const_iterator idol::SparseVector< IndexT, ValueT >::cend ( ) const
inlineinherited

Definition at line 140 of file SparseVector.h.

◆ clear()

template<class IndexT , class ValueT >
void idol::SparseVector< IndexT, ValueT >::clear ( )
inlineinherited

Definition at line 119 of file SparseVector.h.

◆ clear_all()

template<class KeyT , class ValueT >
void idol::QuadExpr< KeyT, ValueT >::clear_all ( )

Definition at line 56 of file QuadExpr.h.

◆ empty()

template<class IndexT , class ValueT >
bool idol::SparseVector< IndexT, ValueT >::empty ( ) const
inlineinherited

Definition at line 107 of file SparseVector.h.

◆ empty_all()

template<class KeyT = idol::Var, class ValueT = double>
bool idol::QuadExpr< KeyT, ValueT >::empty_all ( ) const
inline

Definition at line 48 of file QuadExpr.h.

◆ end() [1/2]

template<class IndexT , class ValueT >
iterator idol::SparseVector< IndexT, ValueT >::end ( )
inlineinherited

Definition at line 132 of file SparseVector.h.

◆ end() [2/2]

template<class IndexT , class ValueT >
const_iterator idol::SparseVector< IndexT, ValueT >::end ( ) const
inlineinherited

Definition at line 136 of file SparseVector.h.

◆ get()

template<class IndexT , class ValueT >
const ValueT & idol::SparseVector< IndexT, ValueT >::get ( const IndexT &  t_index1) const
inherited

Definition at line 271 of file SparseVector.h.

◆ has_index()

template<class IndexT , class ValueT >
bool idol::SparseVector< IndexT, ValueT >::has_index ( const IndexT &  t_index) const
inlineinherited

Definition at line 109 of file SparseVector.h.

◆ has_quadratic()

template<class KeyT = idol::Var, class ValueT = double>
bool idol::QuadExpr< KeyT, ValueT >::has_quadratic ( ) const
inline

Definition at line 46 of file QuadExpr.h.

◆ is_zero()

template<class KeyT , class ValueT >
bool idol::QuadExpr< KeyT, ValueT >::is_zero ( double  t_tolerance) const
overridevirtual

Reimplemented from idol::SparseVector< IndexT, ValueT >.

Definition at line 62 of file QuadExpr.h.

◆ merge_without_conflict()

template<class IndexT , class ValueT >
idol::SparseVector< IndexT, ValueT > & idol::SparseVector< IndexT, ValueT >::merge_without_conflict ( const SparseVector< IndexT, ValueT > &  t_vec)
inherited

Definition at line 258 of file SparseVector.h.

◆ operator*=() [1/2]

template<class KeyT , class ValueT >
idol::QuadExpr< KeyT, ValueT > & idol::QuadExpr< KeyT, ValueT >::operator*= ( double  t_rhs)

Definition at line 81 of file QuadExpr.h.

◆ operator*=() [2/2]

template<class IndexT , class ValueT >
idol::SparseVector< IndexT, ValueT > & idol::SparseVector< IndexT, ValueT >::operator*= ( std::conditional_t< std::is_arithmetic_v< ValueT >, ValueT, double >  t_scalar)
virtualinherited

Definition at line 206 of file SparseVector.h.

◆ operator+=() [1/3]

template<class KeyT , class ValueT >
idol::LinExpr< KeyT, ValueT > & idol::LinExpr< KeyT, ValueT >::operator+= ( const KeyT &  t_rhs)
inherited

Definition at line 66 of file LinExpr.h.

◆ operator+=() [2/3]

template<class KeyT , class ValueT >
idol::QuadExpr< KeyT, ValueT > & idol::QuadExpr< KeyT, ValueT >::operator+= ( const QuadExpr< KeyT, ValueT > &  t_rhs)

Definition at line 97 of file QuadExpr.h.

◆ operator+=() [3/3]

template<class IndexT , class ValueT >
idol::SparseVector< IndexT, ValueT > & idol::SparseVector< IndexT, ValueT >::operator+= ( const SparseVector< IndexT, ValueT > &  t_vector)
virtualinherited

Definition at line 237 of file SparseVector.h.

◆ operator-()

template<class KeyT , class ValueT >
idol::QuadExpr< KeyT, ValueT > idol::QuadExpr< KeyT, ValueT >::operator- ( ) const

Definition at line 67 of file QuadExpr.h.

◆ operator-=() [1/4]

template<class KeyT , class ValueT >
idol::LinExpr< KeyT, ValueT > & idol::LinExpr< KeyT, ValueT >::operator-= ( const KeyT &  t_rhs)
inherited

Definition at line 54 of file LinExpr.h.

◆ operator-=() [2/4]

template<class KeyT , class ValueT >
idol::LinExpr< KeyT, ValueT > & idol::LinExpr< KeyT, ValueT >::operator-= ( const LinExpr< KeyT, ValueT > &  t_rhs)
inherited

Definition at line 60 of file LinExpr.h.

◆ operator-=() [3/4]

template<class KeyT , class ValueT >
idol::QuadExpr< KeyT, ValueT > & idol::QuadExpr< KeyT, ValueT >::operator-= ( const QuadExpr< KeyT, ValueT > &  t_rhs)

Definition at line 89 of file QuadExpr.h.

◆ operator-=() [4/4]

template<class IndexT , class ValueT >
idol::SparseVector< IndexT, ValueT > & idol::SparseVector< IndexT, ValueT >::operator-= ( const SparseVector< IndexT, ValueT > &  t_vector)
virtualinherited

Definition at line 182 of file SparseVector.h.

◆ operator/=() [1/2]

template<class KeyT , class ValueT >
idol::QuadExpr< KeyT, ValueT > & idol::QuadExpr< KeyT, ValueT >::operator/= ( double  t_rhs)

Definition at line 74 of file QuadExpr.h.

◆ operator/=() [2/2]

template<class IndexT , class ValueT >
idol::SparseVector< IndexT, ValueT > & idol::SparseVector< IndexT, ValueT >::operator/= ( std::conditional_t< std::is_arithmetic_v< ValueT >, ValueT, double >  t_scalar)
virtualinherited

Definition at line 161 of file SparseVector.h.

◆ remove()

template<class IndexT , class ValueT >
void idol::SparseVector< IndexT, ValueT >::remove ( const IndexT &  t_index)
inlineinherited

Definition at line 117 of file SparseVector.h.

◆ reserve()

template<class IndexT , class ValueT >
void idol::SparseVector< IndexT, ValueT >::reserve ( unsigned int  t_capacity)
inlineinherited

Definition at line 121 of file SparseVector.h.

◆ set()

template<class IndexT , class ValueT >
void idol::SparseVector< IndexT, ValueT >::set ( const IndexT &  t_index,
const ValueT &  t_value 
)
inherited

Definition at line 283 of file SparseVector.h.

◆ size()

template<class IndexT , class ValueT >
unsigned int idol::SparseVector< IndexT, ValueT >::size ( ) const
inlineinherited

Definition at line 105 of file SparseVector.h.

Member Data Documentation

◆ Zero

template<class KeyT , class ValueT >
idol::LinExpr< KeyT, ValueT > idol::LinExpr< KeyT, ValueT >::Zero {}
staticinherited

Definition at line 48 of file LinExpr.h.