PIPS-NLP
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
PetscVector Class Reference

#include <PetscVector.h>

Inheritance diagram for PetscVector:
OoqpVector IotrRefCount

Public Member Functions

 PetscVector (int n_)
 
 PetscVector (Vec v)
 
 PetscVector (int m_, int n_)
 
virtual ~PetscVector ()
 
virtual int isKindOf (int kind)
 
virtual void setToZero ()
 
virtual void setToConstant (double c)
 
virtual void randomize (double alpha, double beta, double *ix)
 
virtual void copyFrom (OoqpVector &v)
 
virtual double infnorm ()
 
virtual double onenorm ()
 
virtual void min (double &m, int &index)
 
virtual double stepbound (OoqpVector &v, double maxStep)
 
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)
 
virtual void componentMult (OoqpVector &v)
 
virtual void componentDiv (OoqpVector &v)
 
virtual void scalarMult (double num)
 
virtual void writeToStream (ostream &out) const
 
virtual void writefToStream (ostream &out, const char format[]) const
 
virtual void scale (double alpha)
 
virtual void axpy (double alpha, OoqpVector &x)
 
virtual void axzpy (double alpha, OoqpVector &x, OoqpVector &z)
 
virtual void axdzpy (double alpha, OoqpVector &x, OoqpVector &z)
 
virtual void addConstant (double c)
 
virtual void gondzioProjection (double rmin, double rmax)
 
virtual double dotProductWith (OoqpVector &v)
 
virtual double shiftedDotProductWith (double alpha, OoqpVector &mystep, OoqpVector &yvec, double beta, OoqpVector &ystep)
 
virtual void negate ()
 
virtual void invert ()
 
virtual int allPositive ()
 
virtual int matchesNonZeroPattern (OoqpVector &select)
 
virtual void selectNonZeros (OoqpVector &select)
 
virtual int numberOfNonzeros ()
 
virtual void addSomeConstants (double c, OoqpVector &select)
 
virtual void writefSomeToStream (ostream &out, const char format[], OoqpVector &select) const
 
virtual void axdzpy (double alpha, OoqpVector &x, OoqpVector &z, OoqpVector &select)
 
virtual int somePositive (OoqpVector &select)
 
virtual void divideSome (OoqpVector &div, OoqpVector &select)
 
virtual void copyIntoArray (double v[]) const
 
virtual void copyFromArray (double v[])
 
virtual void copyFromArray (char v[])
 
int getSize ()
 
int getLocalSize ()
 
virtual double _addLog ()
 
virtual double twonorm ()
 
virtual double sumPowElt (const double pow_in)
 
virtual double sumElt ()
 
- Public Member Functions inherited from OoqpVector
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 writeToStream (std::ostream &out) const =0
 
virtual void writefToStream (std::ostream &out, const char format[]) const =0
 
virtual void writefSomeToStream (std::ostream &out, const char format[], OoqpVector &select) const =0
 
virtual void copyIntoArray (double 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 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

Vec pv
 
- Public Attributes inherited from OoqpVector
int n
 

Static Public Attributes

static int instances = 0
 
- Static Public Attributes inherited from IotrRefCount
static int instances = 0
 

Protected Attributes

int m
 
int preserveVec
 

Additional Inherited Members

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

Constructor & Destructor Documentation

PetscVector::PetscVector ( int  n_)
PetscVector::PetscVector ( Vec  v)
PetscVector::PetscVector ( int  m_,
int  n_ 
)
PetscVector::~PetscVector ( )
virtual

Member Function Documentation

double PetscVector::_addLog ( )
virtual
void PetscVector::addConstant ( double  c)
virtual

Add c to the elements of this OoqpVector object

Implements OoqpVector.

void PetscVector::addSomeConstants ( double  c,
OoqpVector select 
)
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.

Implements OoqpVector.

int PetscVector::allPositive ( )
virtual

True if all elements of this OoqpVector are positive.

Implements OoqpVector.

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

this += alpha * x / z

Implements OoqpVector.

void PetscVector::axdzpy ( double  alpha,
OoqpVector x,
OoqpVector z,
OoqpVector select 
)
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.

Implements OoqpVector.

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

this += alpha * x

Implements OoqpVector.

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

this += alpha * x * z

Implements OoqpVector.

void PetscVector::componentDiv ( OoqpVector v)
virtual

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

Implements OoqpVector.

void PetscVector::componentMult ( OoqpVector v)
virtual

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

Implements OoqpVector.

void PetscVector::copyFrom ( OoqpVector v)
virtual

Copy the elements of v into this OoqpVector object.

Implements OoqpVector.

void PetscVector::copyFromArray ( double  v[])
virtual

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

Implements OoqpVector.

void PetscVector::copyFromArray ( char  v[])
virtual

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

Implements OoqpVector.

void PetscVector::copyIntoArray ( double  v[]) const
virtual
void PetscVector::divideSome ( OoqpVector div,
OoqpVector select 
)
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

Implements OoqpVector.

double PetscVector::dotProductWith ( OoqpVector v)
virtual

Return the dot product of this OoqpVector with v

Implements OoqpVector.

double PetscVector::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 
)
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.

Implements OoqpVector.

int PetscVector::getLocalSize ( )
inline
int PetscVector::getSize ( )
inline
void PetscVector::gondzioProjection ( double  rmin,
double  rmax 
)
virtual

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

See also
SimpleVector::gondzioProjection

Implements OoqpVector.

double PetscVector::infnorm ( )
virtual

Return the infinity norm of this OoqpVector object.

Implements OoqpVector.

void PetscVector::invert ( )
virtual

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

Implements OoqpVector.

int PetscVector::isKindOf ( int  kind)
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.

Implements OoqpVector.

int PetscVector::matchesNonZeroPattern ( OoqpVector select)
virtual

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

Implements OoqpVector.

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

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

Implements OoqpVector.

void PetscVector::negate ( )
virtual

Negate all the elements of this OoqpVector object.

Implements OoqpVector.

int PetscVector::numberOfNonzeros ( )
virtual

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

Implements OoqpVector.

double PetscVector::onenorm ( )
virtual

Return the one norm of this OoqpVector object.

Implements OoqpVector.

void PetscVector::randomize ( double  alpha,
double  beta,
double *  ix 
)
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

Implements OoqpVector.

void PetscVector::scalarMult ( double  num)
virtual

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

Implements OoqpVector.

void PetscVector::scale ( double  alpha)
virtual

Scale each element of this OoqpVector by the constant alpha

Implements OoqpVector.

void PetscVector::selectNonZeros ( OoqpVector select)
virtual

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

Implements OoqpVector.

void PetscVector::setToConstant ( double  c)
virtual

Set all elements of this OoqpVector to the constant value c

Implements OoqpVector.

void PetscVector::setToZero ( )
virtual

Set all elements of this OoqpVector to zero.

Implements OoqpVector.

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

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

Implements OoqpVector.

int PetscVector::somePositive ( OoqpVector select)
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.

Implements OoqpVector.

double PetscVector::stepbound ( OoqpVector v,
double  maxStep 
)
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.

Implements OoqpVector.

virtual double PetscVector::sumElt ( )
virtual

Implements OoqpVector.

virtual double PetscVector::sumPowElt ( const double  pow_in)
virtual

Implements OoqpVector.

double PetscVector::twonorm ( )
virtual

Implements OoqpVector.

void PetscVector::writefSomeToStream ( ostream &  out,
const char  format[],
OoqpVector select 
) const
virtual
void PetscVector::writefToStream ( ostream &  out,
const char  format[] 
) const
virtual
void PetscVector::writeToStream ( ostream &  out) const
virtual

Member Data Documentation

int PetscVector::instances = 0
static
int PetscVector::m
protected
int PetscVector::preserveVec
protected
Vec PetscVector::pv

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