PIPS-NLP
Public Member Functions | Public Attributes | List of all members
OoqpVector Class Referenceabstract

#include <OoqpVector.h>

Inheritance diagram for OoqpVector:
IotrRefCount PetscVector SimpleVector StochVector StochDummyVector

Public Member Functions

long long length () const
 
 OoqpVector (int n_=0)
 
virtual ~OoqpVector ()
 
double Norm (const int Norm_Type, OoqpVector *vec2=NULL)
 
double Norm (const int Norm_Type, const double norm1, const double norm2)
 
virtual void setToZero ()=0
 
virtual void setToConstant (double c)=0
 
virtual void randomize (double alpha, double beta, double *ix)=0
 
virtual void copyFrom (OoqpVector &v)=0
 
virtual double infnorm ()=0
 
virtual double onenorm ()=0
 
virtual void componentMult (OoqpVector &v)=0
 
virtual void componentDiv (OoqpVector &v)=0
 
virtual void scalarMult (double num)=0
 
virtual void writeToStream (std::ostream &out) const =0
 
virtual void writefToStream (std::ostream &out, const char format[]) const =0
 
virtual void scale (double alpha)=0
 
virtual void axpy (double alpha, OoqpVector &x)=0
 
virtual void axzpy (double alpha, OoqpVector &x, OoqpVector &z)=0
 
virtual void axdzpy (double alpha, OoqpVector &x, OoqpVector &z)=0
 
virtual void addConstant (double c)=0
 
virtual void gondzioProjection (double rmin, double rmax)=0
 
virtual void min (double &m, int &index)=0
 
virtual double dotProductWith (OoqpVector &v)=0
 
virtual double shiftedDotProductWith (double alpha, OoqpVector &mystep, OoqpVector &yvec, double beta, OoqpVector &ystep)=0
 
virtual void negate ()=0
 
virtual void invert ()=0
 
virtual int allPositive ()=0
 
virtual long long numberOfNonzeros ()=0
 
virtual int matchesNonZeroPattern (OoqpVector &select)=0
 
virtual void selectNonZeros (OoqpVector &select)=0
 
virtual void addSomeConstants (double c, OoqpVector &select)=0
 
virtual void writefSomeToStream (std::ostream &out, const char format[], OoqpVector &select) const =0
 
virtual void axdzpy (double alpha, OoqpVector &x, OoqpVector &z, OoqpVector &select)=0
 
virtual int somePositive (OoqpVector &select)=0
 
virtual void divideSome (OoqpVector &div, OoqpVector &select)=0
 
virtual int isKindOf (int kind)=0
 
virtual double stepbound (OoqpVector &v, double maxStep)=0
 
virtual double findBlocking (OoqpVector &wstep_vec, OoqpVector &u_vec, OoqpVector &ustep_vec, double maxStep, double *w_elt, double *wstep_elt, double *u_elt, double *ustep_elt, int &first_or_second)=0
 
virtual void copyIntoArray (double v[])=0
 
virtual void copyFromArray (double v[])=0
 
virtual void copyFromArray (char v[])=0
 
virtual void findBlockingPD (OoqpVector &wstep_vec, OoqpVector &u_vec, OoqpVector &ustep_vec, double *w_elt, double *wstep_elt, double *u_elt, double *ustep_elt, int &first_or_second, double *alphaPri, double *alphaDual)=0
 
virtual void print ()=0
 
virtual double sumLog (OoqpVector *select)=0
 
virtual double twonorm ()=0
 
virtual double sumPowElt (const double pow_in)=0
 
virtual double sumElt ()=0
 
virtual void MinComponentOrConstant (OoqpVector *vec_in, double minVal)=0
 
virtual void MinComponentBetween (OoqpVector *vec_in, OoqpVector *select=NULL)=0
 
virtual void correctLargeVal (const double testVal, const double corVal, const int absFlag)=0
 
virtual void setToConstantFromTo (double c, int start, int end)=0
 
virtual void SetComponentFromMaxXorY (OoqpVector *x_in, OoqpVector *y_in, OoqpVector *select=NULL)=0
 
virtual void SetComponentFromMaxXorY (OoqpVector *x_in, OoqpVector *y_in, int Start, int End, int xStart, int xEnd, int yStart, int yEnd)=0
 
virtual void SetComponentFromMaxXorConstant (OoqpVector *x_in, const double y_in)=0
 
virtual void SetComponentFromMaxXorConstant (OoqpVector *x_in, const double y_in, int Start, int End, int xStart, int xEnd)=0
 
virtual void copyFromFromTo (OoqpVector *vec_in, int VStart, int VEnd, int VinStart, int VinEnd)=0
 
virtual void copyFromArrayFromTo (double *w, int VStart, int VEnd, int Wstart, int Wend)=0
 
virtual void absVal (OoqpVector *vec_in)=0
 
virtual void copyIntoArrayWithIndex_AggVarCon (double *ResultArray, const int *vecmap, const int _length, bool isVar=true)
 
- Public Member Functions inherited from IotrRefCount
int refs ()
 
 IotrRefCount ()
 

Public Attributes

int n
 

Additional Inherited Members

- Static Public Member Functions inherited from IotrRefCount
static void release (IotrRefCount **obj)
 
static void addRef (IotrRefCount *const *obj)
 
- Static Public Attributes inherited from IotrRefCount
static int instances = 0
 
- Protected Member Functions inherited from IotrRefCount
virtual ~IotrRefCount ()
 

Detailed Description

An abstract class representing the implementation of a OoqpVector.

Do not create instances of OoqpVector. Create instance of subclasses of OoqpVector instead.

Constructor & Destructor Documentation

OoqpVector::OoqpVector ( int  n_ = 0)
OoqpVector::~OoqpVector ( )
virtual

Member Function Documentation

virtual void OoqpVector::absVal ( OoqpVector vec_in)
pure virtual

Return the absolute value

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::addConstant ( double  c)
pure virtual

Add c to the elements of this OoqpVector object

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::addSomeConstants ( double  c,
OoqpVector select 
)
pure virtual

Add the constant c to some of the elements of this OoqpVector

Parameters
cThe constant to be added
selecta mask OoqpVector. The constant c is added to an element of this OoqpVector only if the corresponding element of select is non-zero.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual int OoqpVector::allPositive ( )
pure virtual

True if all elements of this OoqpVector are positive.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::axdzpy ( double  alpha,
OoqpVector x,
OoqpVector z 
)
pure virtual

this += alpha * x / z

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::axdzpy ( double  alpha,
OoqpVector x,
OoqpVector z,
OoqpVector select 
)
pure virtual

this += alpha * x / z

Parameters
selectonly perform the division on elements of x and z if the corresponding element of select is non-zero. Generally we avoid performing the division if we know that it will result in division by zero. The OoqpVector select may be x, z or a third OoqpVector.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::axpy ( double  alpha,
OoqpVector x 
)
pure virtual

this += alpha * x

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::axzpy ( double  alpha,
OoqpVector x,
OoqpVector z 
)
pure virtual

this += alpha * x * z

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::componentDiv ( OoqpVector v)
pure virtual

Divide the components of this OoqpVector by the components of v.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::componentMult ( OoqpVector v)
pure virtual

Multiply the components of this OoqpVector by the components of v.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::copyFrom ( OoqpVector v)
pure virtual

Copy the elements of v into this OoqpVector object.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::copyFromArray ( double  v[])
pure virtual

Copy the elements of the C-style array v into this OoqpVector.

Implemented in StochDummyVector, StochVector, PetscVector, and SimpleVector.

virtual void OoqpVector::copyFromArray ( char  v[])
pure virtual

Copy the elements of the C-style char array v into this OoqpVector.

Implemented in StochDummyVector, StochVector, PetscVector, and SimpleVector.

virtual void OoqpVector::copyFromArrayFromTo ( double *  w,
int  VStart,
int  VEnd,
int  Wstart,
int  Wend 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::copyFromFromTo ( OoqpVector vec_in,
int  VStart,
int  VEnd,
int  VinStart,
int  VinEnd 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::copyIntoArray ( double  v[])
pure virtual

Copy the elements of this OoqpVector into the C-style array v.

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::copyIntoArrayWithIndex_AggVarCon ( double *  ResultArray,
const int *  vecmap,
const int  _length,
bool  isVar = true 
)
inlinevirtual

Reimplemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::correctLargeVal ( const double  testVal,
const double  corVal,
const int  absFlag 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::divideSome ( OoqpVector div,
OoqpVector select 
)
pure virtual

Divide selected elements of this OoqpVector by the corresponding element in div.

Parameters
divIf element i of this OoqpVector is selected, then it will be divided by element i of div.
selectPerform division on elements of this OoqpVector only if the corresponding element in select is non-zero

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual double OoqpVector::dotProductWith ( OoqpVector v)
pure virtual

Return the dot product of this OoqpVector with v

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual double OoqpVector::findBlocking ( OoqpVector wstep_vec,
OoqpVector u_vec,
OoqpVector ustep_vec,
double  maxStep,
double *  w_elt,
double *  wstep_elt,
double *  u_elt,
double *  ustep_elt,
int &  first_or_second 
)
pure virtual

Return the largest value of alpha in the interval [0,1] for which: this + alpha * wstep_vec >= 0 and u_vec + alpha * ustep_vec >= 0. Also return the components this[i], wstep_vec[i], u_vec[i], ustep_vec[i], where i is the index of the "blocking" component - the one that limits the step length to alpha. Also return first_or_second=1 if the blocking component is in "this", and first_or_second=2 if the blocking component is in u_vec.

Implemented in StochDummyVector, SimpleVector, StochVector, and PetscVector.

virtual void OoqpVector::findBlockingPD ( OoqpVector wstep_vec,
OoqpVector u_vec,
OoqpVector ustep_vec,
double *  w_elt,
double *  wstep_elt,
double *  u_elt,
double *  ustep_elt,
int &  first_or_second,
double *  alphaPri,
double *  alphaDual 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::gondzioProjection ( double  rmin,
double  rmax 
)
pure virtual

Perform the projection needed by Gondzio's multiple corrector method.

See also
SimpleVector::gondzioProjection

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual double OoqpVector::infnorm ( )
pure virtual

Return the infinity norm of this OoqpVector object.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::invert ( )
pure virtual

Invert (1/x) the elements of this OoqpVector.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual int OoqpVector::isKindOf ( int  kind)
pure virtual

True if this OoqpVector identifies itself as having the type kind.

Classes overriding this method must call the inherited version, so that the class hierarchy is supported.

Implemented in StochDummyVector, SimpleVector, StochVector, and PetscVector.

long long OoqpVector::length ( ) const
inline

Return the length of this vector.

virtual int OoqpVector::matchesNonZeroPattern ( OoqpVector select)
pure virtual

True if this OoqpVector has the same non-zero pattern as select.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::min ( double &  m,
int &  index 
)
pure virtual

Return the minimum value in this vector, and the index at which it occurs.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::MinComponentBetween ( OoqpVector vec_in,
OoqpVector select = NULL 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::MinComponentOrConstant ( OoqpVector vec_in,
double  minVal 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::negate ( )
pure virtual

Negate all the elements of this OoqpVector object.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

double OoqpVector::Norm ( const int  Norm_Type,
OoqpVector vec2 = NULL 
)
double OoqpVector::Norm ( const int  Norm_Type,
const double  norm1,
const double  norm2 
)
virtual long long OoqpVector::numberOfNonzeros ( )
pure virtual

Return the number of non-zero elements in this OoqpVector.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual double OoqpVector::onenorm ( )
pure virtual

Return the one norm of this OoqpVector object.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::print ( )
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::randomize ( double  alpha,
double  beta,
double *  ix 
)
pure virtual

Fill this OoqpVector with random elements

Parameters
alpha
betathe elements will be in the interval [alpha, beta]
ixan aribitray number used to seed the random number generator

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::scalarMult ( double  num)
pure virtual

Write the components of this OoqpVector, one element per line, to the stream out. Multiply the components of this OoqpVector by num.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::scale ( double  alpha)
pure virtual

Scale each element of this OoqpVector by the constant alpha

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::selectNonZeros ( OoqpVector select)
pure virtual

Set each element of this OoqpVector to zero if the corresponding element in select is zero.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::SetComponentFromMaxXorConstant ( OoqpVector x_in,
const double  y_in 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::SetComponentFromMaxXorConstant ( OoqpVector x_in,
const double  y_in,
int  Start,
int  End,
int  xStart,
int  xEnd 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::SetComponentFromMaxXorY ( OoqpVector x_in,
OoqpVector y_in,
OoqpVector select = NULL 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::SetComponentFromMaxXorY ( OoqpVector x_in,
OoqpVector y_in,
int  Start,
int  End,
int  xStart,
int  xEnd,
int  yStart,
int  yEnd 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::setToConstant ( double  c)
pure virtual

Set all elements of this OoqpVector to the constant value c

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual void OoqpVector::setToConstantFromTo ( double  c,
int  start,
int  end 
)
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::setToZero ( )
pure virtual

Set all elements of this OoqpVector to zero.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual double OoqpVector::shiftedDotProductWith ( double  alpha,
OoqpVector mystep,
OoqpVector yvec,
double  beta,
OoqpVector ystep 
)
pure virtual

Return the inner product <this + alpha * mystep, yvec + beta * ystep >

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual int OoqpVector::somePositive ( OoqpVector select)
pure virtual

True if selected elements of this OoqpVector are positive

Parameters
selectEach element of this OoqpVector must be positive if the corresponding element of select is non-zero.

Implemented in StochDummyVector, StochVector, SimpleVector, and PetscVector.

virtual double OoqpVector::stepbound ( OoqpVector v,
double  maxStep 
)
pure virtual

Return the largest value of alpha in the interval [0, maxStep] for which: this + alpha * v >= 0. Set firstBlocking to be the "blocking" index i - the one that limits the step length to alpha.

Implemented in StochDummyVector, SimpleVector, StochVector, and PetscVector.

virtual double OoqpVector::sumElt ( )
pure virtual
virtual double OoqpVector::sumLog ( OoqpVector select)
pure virtual

Implemented in StochVector, and SimpleVector.

virtual double OoqpVector::sumPowElt ( const double  pow_in)
pure virtual
virtual double OoqpVector::twonorm ( )
pure virtual
virtual void OoqpVector::writefSomeToStream ( std::ostream &  out,
const char  format[],
OoqpVector select 
) const
pure virtual

Write some elements of this OoqpVector to a stream, subject to a format.

Parameters
outa C++-style output stream
formata string used to format the output. The substring %{index} will be substituted by the index of the current element and the string %{value} will be substituted with the element's value.
selecta mask OoqpVector. An element if this OoqpVector is written only if the corresponding element of selec is non-zero.

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::writefToStream ( std::ostream &  out,
const char  format[] 
) const
pure virtual

Write the components of this OoqpVector to a stream, subject to a format.

Parameters
outa C++-style output stream
formata string used to format the output. The substring %{index} will be substituted by the index of the current element and the string %{value} will be substituted with the element's value.

Implemented in StochDummyVector, StochVector, and SimpleVector.

virtual void OoqpVector::writeToStream ( std::ostream &  out) const
pure virtual

Implemented in StochDummyVector, StochVector, and SimpleVector.

Member Data Documentation

int OoqpVector::n

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