Loading...
Searching...
No Matches
idol::LinExpr< KeyT, ValueT > Class Template Reference

#include <LinExpr.h>

Description

template<class KeyT = idol::Var, class ValueT = double>
class idol::LinExpr< KeyT, ValueT >
Template Parameters
KeyTthe class representing keys

Definition at line 28 of file LinExpr.h.

Public Types

using iterator
using const_iterator

Public Methods

 LinExpr (KeyT t_key)
 LinExpr (SparseVector< KeyT, ValueT > t_vector)
 LinExpr (const ValueT &t_factor, const KeyT &t_key)
 LinExpr (ValueT &&t_factor, const KeyT &t_key)
 LinExpr (const LinExpr< KeyT, ValueT > &)=default
 LinExpr (LinExpr< KeyT, ValueT > &&)=default
LinExpr & operator= (const LinExpr< KeyT, ValueT > &) noexcept=default
LinExpr & operator= (LinExpr< KeyT, ValueT > &&) noexcept=default
virtual LinExpr & operator+= (const LinExpr< KeyT, ValueT > &t_rhs)
LinExpr & operator+= (const KeyT &t_rhs)
LinExpr & operator-= (const LinExpr< KeyT, ValueT > &t_rhs)
LinExpr & operator-= (const KeyT &t_rhs)
virtual SparseVector & operator+= (const SparseVector &t_vector)
virtual SparseVector & operator-= (const SparseVector &t_vector)
virtual SparseVector & operator*= (std::conditional_t< std::is_arithmetic_v< double >, double, double > t_scalar)
virtual SparseVector & operator/= (std::conditional_t< std::is_arithmetic_v< double >, double, double > t_scalar)
SparseVector operator- () const
unsigned int size () const
bool empty () const
bool has_index (const idol::Var &t_index) const
const double & get (const idol::Var &t_index1) const
void set (const idol::Var &t_index, const double &t_value)
virtual bool is_zero (double t_tolerance) const
void remove (const idol::Var &t_index)
void clear ()
void reserve (unsigned int t_capacity)
iterator begin ()
iterator end ()
const_iterator cbegin () const
const_iterator cend () const
SparseVector & merge_without_conflict (const SparseVector &t_vec)

Public Static Attributes

static LinExpr< KeyT, ValueT > Zero {}

Member Typedef Documentation

◆ const_iterator

using idol::SparseVector< idol::Var, double >::const_iterator
inherited

Definition at line 130 of file SparseVector.h.

◆ iterator

using idol::SparseVector< idol::Var, double >::iterator
inherited

Definition at line 129 of file SparseVector.h.

Constructor & Destructor Documentation

◆ LinExpr()

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

Definition at line 32 of file LinExpr.h.

Methods Documentation

◆ begin()

iterator idol::SparseVector< idol::Var, double >::begin ( )
inlinenodiscardinherited

Definition at line 132 of file SparseVector.h.

◆ cbegin()

const_iterator idol::SparseVector< idol::Var, double >::cbegin ( ) const
inlinenodiscardinherited

Definition at line 140 of file SparseVector.h.

◆ cend()

const_iterator idol::SparseVector< idol::Var, double >::cend ( ) const
inlinenodiscardinherited

Definition at line 142 of file SparseVector.h.

◆ clear()

void idol::SparseVector< idol::Var, double >::clear ( )
inlineinherited

Definition at line 121 of file SparseVector.h.

◆ empty()

bool idol::SparseVector< idol::Var, double >::empty ( ) const
inlinenodiscardinherited

Definition at line 109 of file SparseVector.h.

◆ end()

iterator idol::SparseVector< idol::Var, double >::end ( )
inlinenodiscardinherited

Definition at line 134 of file SparseVector.h.

◆ get()

const double & idol::SparseVector< idol::Var, double >::get ( const idol::Var & t_index1) const
nodiscardinherited

Definition at line 113 of file SparseVector.h.

◆ has_index()

bool idol::SparseVector< idol::Var, double >::has_index ( const idol::Var & t_index) const
inlinenodiscardinherited

Definition at line 111 of file SparseVector.h.

◆ is_zero()

bool idol::SparseVector< idol::Var, double >::is_zero ( double t_tolerance) const
nodiscardvirtualinherited

Definition at line 117 of file SparseVector.h.

◆ merge_without_conflict()

idol::SparseVector< idol::Var, double > & idol::SparseVector< idol::Var, double >::merge_without_conflict ( const SparseVector< idol::Var, double > & t_vec)
inherited

Definition at line 144 of file SparseVector.h.

◆ operator*=()

idol::SparseVector< idol::Var, double > & idol::SparseVector< idol::Var, double >::operator*= ( std::conditional_t< std::is_arithmetic_v< double >, double, double > t_scalar)
virtualinherited

Definition at line 103 of file SparseVector.h.

◆ operator+=() [1/2]

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

Definition at line 66 of file LinExpr.h.

◆ operator+=() [2/2]

idol::SparseVector< idol::Var, double > & idol::SparseVector< idol::Var, double >::operator+= ( const SparseVector< idol::Var, double > & t_vector)
virtualinherited

Definition at line 101 of file SparseVector.h.

◆ operator-()

idol::SparseVector< idol::Var, double > idol::SparseVector< idol::Var, double >::operator- ( ) const
inherited

Definition at line 105 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)

Definition at line 54 of file LinExpr.h.

◆ operator-=() [2/3]

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

Definition at line 60 of file LinExpr.h.

◆ operator-=() [3/3]

idol::SparseVector< idol::Var, double > & idol::SparseVector< idol::Var, double >::operator-= ( const SparseVector< idol::Var, double > & t_vector)
virtualinherited

Definition at line 102 of file SparseVector.h.

◆ operator/=()

idol::SparseVector< idol::Var, double > & idol::SparseVector< idol::Var, double >::operator/= ( std::conditional_t< std::is_arithmetic_v< double >, double, double > t_scalar)
virtualinherited

Definition at line 104 of file SparseVector.h.

◆ remove()

void idol::SparseVector< idol::Var, double >::remove ( const idol::Var & t_index)
inlineinherited

Definition at line 119 of file SparseVector.h.

◆ reserve()

void idol::SparseVector< idol::Var, double >::reserve ( unsigned int t_capacity)
inlineinherited

Definition at line 123 of file SparseVector.h.

◆ set()

void idol::SparseVector< idol::Var, double >::set ( const idol::Var & t_index,
const double & t_value )
inherited

Definition at line 115 of file SparseVector.h.

◆ size()

unsigned int idol::SparseVector< idol::Var, double >::size ( ) const
inlinenodiscardinherited

Definition at line 107 of file SparseVector.h.

Member Data Documentation

◆ Zero

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

Definition at line 48 of file LinExpr.h.