Scippy

SoPlex

Sequential object-oriented simPlex

SVSetBase< R >::DLPSV Class Reference

SVectorBase with prev/next pointers. More...

Public Member Functions

Construction / destruction
 DLPSV ()
 Default constructor. More...
 
 DLPSV (const DLPSV &copy)
 Copy constructor. More...
 
 DLPSV (DLPSV &&copy)
 move constructor. More...
 
DLPSVoperator= (DLPSV &&rhs)
 move assignment operator. More...
 
DLPSVoperator= (const DLPSV &rhs)
 Assignment operator. More...
 
Successor / predecessor
DLPSV *& next ()
 Next SVectorBase. More...
 
DLPSV *const & next () const
 Next SVectorBase. More...
 
DLPSV *const & prev () const
 Previous SVectorBase. More...
 
DLPSV *& prev ()
 Previous SVectorBase. More...
 
- Public Member Functions inherited from SVectorBase< R >
SVectorBase< Real > & operator= (const VectorBase< S > &vec)
 Assignment operator (specialization for Real). More...
 
Real operator* (const SVectorBase< S > &w) const
 specialization for inner product for sparse vectors More...
 
int size () const
 Number of used indices. More...
 
int max () const
 Maximal number of indices. More...
 
int dim () const
 Dimension of the vector defined as maximal index + 1. More...
 
int pos (int i) const
 Position of index i. More...
 
operator[] (int i) const
 Value to index i. More...
 
Nonzero< R > & element (int n)
 Reference to the n 'th nonzero element. More...
 
const Nonzero< R > & element (int n) const
 The n 'th nonzero element. More...
 
int & index (int n)
 Reference to index of n 'th nonzero. More...
 
int index (int n) const
 Index of n 'th nonzero. More...
 
R & value (int n)
 Reference to value of n 'th nonzero. More...
 
const R & value (int n) const
 Value of n 'th nonzero. More...
 
void add (int i, const R &v)
 Append one nonzero (i,v). More...
 
void add (int i)
 Append one uninitialized nonzero. More...
 
void add (const SVectorBase &sv)
 Append nonzeros of sv. More...
 
void add (int n, const int i[], const R v[])
 Append n nonzeros. More...
 
template<class S >
void add (int n, const int i[], const S v[])
 Append n nonzeros. More...
 
void add (int n, const Nonzero< R > e[])
 Append n nonzeros. More...
 
void remove (int n, int m)
 Remove nonzeros n thru m. More...
 
void remove (int n)
 Remove n 'th nonzero. More...
 
void clear ()
 Remove all indices. More...
 
void sort ()
 Sort nonzeros to increasing indices. More...
 
maxAbs () const
 Maximum absolute value, i.e., infinity norm. More...
 
minAbs () const
 Minimum absolute value. More...
 
length () const
 Floating point approximation of euclidian norm (without any approximation guarantee). More...
 
length2 () const
 Squared norm. More...
 
SVectorBase< R > & operator*= (const R &x)
 Scaling. More...
 
operator* (const VectorBase< R > &w) const
 Inner product. More...
 
template<class S >
operator* (const SVectorBase< S > &w) const
 inner product for sparse vectors More...
 
 SVectorBase (int n=0, Nonzero< R > *p_mem=nullptr)
 Default constructor. More...
 
 SVectorBase (const SVectorBase< R > &sv)=default
 
template<class S >
SVectorBase< R > & operator= (const VectorBase< S > &vec)
 Assignment operator. More...
 
SVectorBase< R > & operator= (const SVectorBase< R > &sv)
 Assignment operator. More...
 
SVectorBase< R > & operator= (const SVectorBase< R > &&sv)
 move assignement operator. More...
 
template<class S >
SVectorBase< R > & operator= (const SVectorBase< S > &sv)
 Assignment operator. More...
 
SVectorBase< Real > & scaleAssign (int scaleExp, const SVectorBase< Real > &sv)
 scale and assign More...
 
SVectorBase< Real > & scaleAssign (const int *scaleExp, const SVectorBase< Real > &sv, bool negateExp=false)
 scale and assign More...
 
template<class S >
SVectorBase< R > & assignArray (const S *rowValues, const int *rowIndices, int rowSize)
 Assignment operator. More...
 
template<class S >
SVectorBase< R > & operator= (const SSVectorBase< S > &sv)
 Assignment operator. More...
 
Nonzero< R > * mem () const
 get pointer to internal memory. More...
 
void set_size (int s)
 Set size of the vector. More...
 
void set_max (int m)
 Set the maximum number of nonzeros in the vector. More...
 
void setMem (int n, Nonzero< R > *elmem)
 Set the memory area where the nonzeros will be stored. More...
 
bool isConsistent () const
 Consistency check. More...
 

Private Attributes

Data
DLPSVthenext
 next SVectorBase More...
 
DLPSVtheprev
 previous SVectorBase More...
 

Additional Inherited Members

- Public Types inherited from SVectorBase< R >
typedef Nonzero< R > Element
 

Detailed Description

template<class R>
class soplex::SVSetBase< R >::DLPSV

SVectorBase with prev/next pointers.

Todo:
Check whether SVSetBase::DLPSV can be implemented as IdElement<SVectorBase>

The management of the SVectorBases is implemented by a DataSet<DLPSV>, the keys used externally are DataKeys.

The management of nonzeros is done by a Real linked list IdList<DLPSV>, where the SVectorBases are kept in the order in which their indices occurr in the Array. The SVectorBases are kept without holes: If one is removed or moved to the end, the SVectorBase preceeding it obtains the space for all the nonzeros that previously belonged to the (re-)moved one. However, the nonzeros in use are uneffected by this.

Definition at line 91 of file svsetbase.h.

Constructor & Destructor Documentation

◆ DLPSV() [1/3]

DLPSV ( )

Default constructor.

Definition at line 111 of file svsetbase.h.

References SVSetBase< R >::DLPSV::thenext, and SVSetBase< R >::DLPSV::theprev.

◆ DLPSV() [2/3]

DLPSV ( const DLPSV copy)

Copy constructor.

Definition at line 119 of file svsetbase.h.

◆ DLPSV() [3/3]

DLPSV ( DLPSV &&  copy)

move constructor.

Definition at line 124 of file svsetbase.h.

Member Function Documentation

◆ next() [1/2]

DLPSV *& next ( )

Next SVectorBase.

Definition at line 155 of file svsetbase.h.

References SVSetBase< R >::DLPSV::thenext.

◆ next() [2/2]

DLPSV *const & next ( ) const

Next SVectorBase.

Definition at line 161 of file svsetbase.h.

References SVSetBase< R >::DLPSV::thenext.

◆ operator=() [1/2]

DLPSV & operator= ( const DLPSV rhs)

Assignment operator.

Definition at line 143 of file svsetbase.h.

References SVectorBase< R >::operator=().

◆ operator=() [2/2]

DLPSV & operator= ( DLPSV &&  rhs)

move assignment operator.

Definition at line 129 of file svsetbase.h.

References SVectorBase< R >::operator=(), SVSetBase< R >::DLPSV::thenext, and SVSetBase< R >::DLPSV::theprev.

◆ prev() [1/2]

DLPSV *& prev ( )

Previous SVectorBase.

Definition at line 173 of file svsetbase.h.

References SVSetBase< R >::DLPSV::theprev.

◆ prev() [2/2]

DLPSV *const & prev ( ) const

Previous SVectorBase.

Definition at line 167 of file svsetbase.h.

References SVSetBase< R >::DLPSV::theprev.

Referenced by SVSetBase< R >::deleteVec(), and SVSetBase< R >::xtend().

Member Data Documentation

◆ thenext

◆ theprev

DLPSV* theprev
private