Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

SimpleVector Class Reference
[SparseLinearAlgebraDenseLinearAlgebra]

#include <SimpleVector.h>

Inheritance diagram for SimpleVector:

OoqpVector IotrRefCount List of all members.

Public Methods

virtual void copyIntoArray (double v[]) const
virtual void copyFromArray (double v[])
virtual void copyFromArray (char v[])
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 void componentMult (OoqpVector &v)
virtual void scalarMult (double num)
virtual void componentDiv (OoqpVector &v)
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 numberOfNonzeros ()
virtual int matchesNonZeroPattern (OoqpVector &select)
virtual void selectNonZeros (OoqpVector &select)
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 isKindOf (int kind)
virtual int somePositive (OoqpVector &select)
virtual void divideSome (OoqpVector &div, OoqpVector &select)
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)
double * elements ()
double & operator[] (int i)

Detailed Description

Simple sequential vectors with element access.


Member Function Documentation

virtual void SimpleVector::addConstant double    c [virtual]
 

Add c to the elements of this OoqpVector object

Implements OoqpVector.

virtual void SimpleVector::addSomeConstants double    c,
OoqpVector   select
[virtual]
 

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

Parameters:
c  The constant to be added
select  a 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.

virtual int SimpleVector::allPositive   [virtual]
 

True if all elements of this OoqpVector are positive.

Implements OoqpVector.

virtual void SimpleVector::axdzpy double    alpha,
OoqpVector   x,
OoqpVector   z,
OoqpVector   select
[virtual]
 

this += alpha * x / z

Parameters:
select  only 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.

virtual void SimpleVector::axdzpy double    alpha,
OoqpVector   x,
OoqpVector   z
[virtual]
 

this += alpha * x / z

Implements OoqpVector.

virtual void SimpleVector::axpy double    alpha,
OoqpVector   x
[virtual]
 

this += alpha * x

Implements OoqpVector.

virtual void SimpleVector::axzpy double    alpha,
OoqpVector   x,
OoqpVector   z
[virtual]
 

this += alpha * x * z

Implements OoqpVector.

virtual void SimpleVector::componentDiv OoqpVector   v [virtual]
 

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

Implements OoqpVector.

virtual void SimpleVector::componentMult OoqpVector   v [virtual]
 

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

Implements OoqpVector.

virtual void SimpleVector::copyFrom OoqpVector   v [virtual]
 

Copy the elements of v into this OoqpVector object.

Implements OoqpVector.

virtual void SimpleVector::copyFromArray char    v[] [virtual]
 

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

Implements OoqpVector.

virtual void SimpleVector::copyFromArray double    v[] [virtual]
 

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

Implements OoqpVector.

virtual void SimpleVector::copyIntoArray double    v[] const [virtual]
 

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

Implements OoqpVector.

virtual void SimpleVector::divideSome OoqpVector   div,
OoqpVector   select
[virtual]
 

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

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

Implements OoqpVector.

virtual double SimpleVector::dotProductWith OoqpVector   v [virtual]
 

Return the dot product of this OoqpVector with v

Implements OoqpVector.

double* SimpleVector::elements   [inline]
 

Returns a pointer to the elemens of this vector.

virtual double SimpleVector::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.

virtual void SimpleVector::gondzioProjection double    rmin,
double    rmax
[virtual]
 

perform the projection operation required by Gondzio algorithm: replace each component of the vector v by vp_i - v_i, where vp_i is the projection of v_i onto the box [rmin, rmax]. Then if the resulting value is less than -rmax, replace it by -rmax.

Implements OoqpVector.

virtual double SimpleVector::infnorm   [virtual]
 

Return the infinity norm of this OoqpVector object.

Implements OoqpVector.

virtual void SimpleVector::invert   [virtual]
 

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

Implements OoqpVector.

virtual int SimpleVector::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.

virtual int SimpleVector::matchesNonZeroPattern OoqpVector   select [virtual]
 

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

Implements OoqpVector.

virtual void SimpleVector::min double &    m,
int &    index
[virtual]
 

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

Implements OoqpVector.

virtual void SimpleVector::negate   [virtual]
 

Negate all the elements of this OoqpVector object.

Implements OoqpVector.

virtual int SimpleVector::numberOfNonzeros   [virtual]
 

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

Implements OoqpVector.

virtual double SimpleVector::onenorm   [virtual]
 

Return the one norm of this OoqpVector object.

Implements OoqpVector.

double& SimpleVector::operator[] int    i [inline]
 

Access the individual elments of this vector.

virtual void SimpleVector::randomize double    alpha,
double    beta,
double *    ix
[virtual]
 

Fill this OoqpVector with random elements

Parameters:
alpha 
beta  the elements will be in the interval [alpha, beta]
ix  an aribitray number used to seed the random number generator

Implements OoqpVector.

virtual void SimpleVector::scalarMult double    num [virtual]
 

Multiply the components of this OoqpVector by num.

Implements OoqpVector.

virtual void SimpleVector::scale double    alpha [virtual]
 

Scale each element of this OoqpVector by the constant alpha

Implements OoqpVector.

virtual void SimpleVector::selectNonZeros OoqpVector   select [virtual]
 

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

Implements OoqpVector.

virtual void SimpleVector::setToConstant double    c [virtual]
 

Set all elements of this OoqpVector to the constant value c

Implements OoqpVector.

virtual void SimpleVector::setToZero   [virtual]
 

Set all elements of this OoqpVector to zero.

Implements OoqpVector.

virtual double SimpleVector::shiftedDotProductWith double    alpha,
OoqpVector   mystep,
OoqpVector   yvec,
double    beta,
OoqpVector   ystep
[virtual]
 

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

Implements OoqpVector.

virtual int SimpleVector::somePositive OoqpVector   select [virtual]
 

True if selected elements of this OoqpVector are positive

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

Implements OoqpVector.

virtual double SimpleVector::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 void SimpleVector::writefSomeToStream ostream &    out,
const char    format[],
OoqpVector   select
const [virtual]
 

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

Parameters:
out  a C++-style output stream
format  a 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.
select  a mask OoqpVector. An element if this OoqpVector is written only if the corresponding element of selec is non-zero.

Implements OoqpVector.

virtual void SimpleVector::writefToStream ostream &    out,
const char    format[]
const [virtual]
 

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

Parameters:
out  a C++-style output stream
format  a 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.

Implements OoqpVector.


The documentation for this class was generated from the following file:
Generated on Mon May 24 17:40:46 2004 for OOQP by doxygen1.2.18