#include <SimpleVector.hh>
Inheritance diagram for SimpleVector:
Public Methods | |
SimpleVector (int n) | |
Constructor. | |
SimpleVector (double *v, int n) | |
Constructor. | |
double * | elements () |
Return mElements. | |
double & | operator[] (int i) |
Allows for vector[i] notation. | |
const double & | operator[] (int i) const |
Allows for vector[i] notation. | |
virtual void | copyFrom (const IotrVector &v) |
virtual void | copyFrom (const SimpleVector &v) |
Copy the elements of v. | |
virtual void | copyInto (SimpleVector &v) const |
Copy the element of this into the SimpleVector v; for debugging and testing purposes only. | |
IotrVector * | copy () const |
Copy this vector, including data. | |
virtual IotrVector * | newSibling () const |
create a new vector from the same space as this one | |
virtual void | writefToStream (std::ostream &out, const char format[]) const |
Write the components of this OOQP_Vector to a stream, subject to a format. | |
virtual void | setToConstant (double c) |
Set all elements to the constant value c. | |
virtual void | setToZero () |
Set all elements of this IotrVector to zero. | |
virtual void | addConstant (double c) |
Add a constant value to all elements of this vector. | |
virtual void | scale (double alpha) |
this = alpha * this | |
virtual void | axpy (double alpha, const IotrVector &x) |
this += alpha * x | |
virtual void | diagonalMult (double alpha, const IotrVector &x, double beta, IotrVector &y) const |
y = beta * y + alpha * this * x. | |
virtual void | diagonalDiv (double alpha, const IotrVector &x, double beta, IotrVector &y) const |
y = beta * y + alpha * x / this if beta == 0 then y need not be initialized | |
virtual void | diagonalDiv (double alpha, double beta, IotrVector &y) const |
y = beta * y + alpha / this if beta == 0 then y need not be initialized | |
virtual void | copyIntoRangeFrom (int ifirst, int extent, double v[]) |
Copies the elements of a traditional array. | |
virtual double | twonorm () const |
Return the Euclidean norm of the elements. | |
virtual double | infnorm (double addnlElt=0.0) const |
Return the Inf norm of the elements. | |
virtual double | stepbound (const IotrVector &s, double bound) const |
Return the greatest number alpha in [0, maxstep] for which this[i] + alpha * s[i] >= 0 for all i, provided all elements of this are initially >= 0. | |
virtual double | stepbound (const IotrVector &x, const IotrVector &xlow, ElementGather &ixlow, const IotrVector &xupp, ElementGather &ixupp, double bound) const |
Return the greatest number alpha in [0, maxstep] for which ixlow * ( this + alpha * s ) - xlow >= 0 and xupp - ixupp * ( this + alpha * s ) >= 0 Provided that these two inequalities hold for alpha = 0. | |
virtual IotrVector & | operator *= (const IotrVector &v) |
multiply the components of this by the components of v | |
virtual IotrVector & | operator/= (const IotrVector &v) |
virtual void | negate () |
this := -this | |
virtual void | makeInterior (const IotrVector &xlow, ElementGather &ixlow, const IotrVector &xupp, ElementGather &ixupp, double rtol, double atol) |
Make all elements of this interior to the bounds, leaving those already "sufficiently" interior untouched. | |
virtual double | dot (const IotrVector &x) const |
the dot product of this with x | |
virtual double | scaledDot (const IotrVector &D, const IotrVector &x) const |
the product this' * D * x | |
virtual void | invertNonzero () |
this[i] = 1/this[i] unless this[i] == 0 | |
virtual void | inspect (const char *name=0, const char *filename=0) const |
Display the elements of the vector for debugging purposes. | |
virtual void | inspectAsMatlab (const char *name=0, const char *filename=0) const |
Display the elements of the vector, for debugging purposes, in a syntax understood by matlab. | |
virtual double | min () const |
The minimum value in the vector. | |
virtual double | min (const double addnElt) const |
The minimum value in the vector with addnElt adjoined. | |
virtual int | allPositive () const |
true if all elements of this vector are positive | |
virtual void | squareRoot () |
replace all elements by their square root | |
virtual void | categorize (ElementGather *cat[], int n, IotrVector *rhs[], int nrhs, const IotrVectorCategorize &func) const |
Categorize the element of this vector, possibly in relation to the elements of one or more other vectors. | |
virtual double | sumReduce (const IotrVector *v[], int nv, const IotrVectorReduce< double > &func) const |
Protected Attributes | |
SimpleArrayDataHandle | data |
data will be used to store a vector | |
double * | mElements |
mElements will point to the first element stored in data. |
|
Categorize the element of this vector, possibly in relation to the elements of one or more other vectors.
Implements IotrVector. |
|
Copies the elements of a traditional array.
The first |
|
y = beta * y + alpha * this * x. if beta == 0 then y need not be initialized Implements IotrVector. |
|
Return the Inf norm of the elements.
Implements IotrVector. |
|
Display the elements of the vector for debugging purposes.
Implements IotrVector. |
|
Display the elements of the vector, for debugging purposes, in a syntax understood by matlab.
Implements IotrVector. |
|
Make all elements of this interior to the bounds, leaving those already "sufficiently" interior untouched. An element of this with only a lower bound is sufficiently interior if this[i] > b + atol. Otherwise it is set to b + atol. Treatment of elements with only upper bounds is similar. If an element has both upper and lower bounds, it is considered to be sufficiently interior if b + tol <= this[i] <= u - tol where tol = min[ atol, rtol * (u - b) ] If it is not sufficiently interior, we make the smallest change that will make the element sufficiently interior. Implements IotrVector. |
|
The minimum value in the vector with addnElt adjoined. In matlab notation min([addnElt; this]) Implements IotrVector. |
|
The minimum value in the vector. Will return infinity (or DBL_MAX) if the vector is empty Implements IotrVector. |
|
Allows for vector[i] notation. Return mElements[i] |
|
Allows for vector[i] notation. Returns mElements[i] |
|
Return the greatest number alpha in [0, maxstep] for which ixlow * ( this + alpha * s ) - xlow >= 0 and xupp - ixupp * ( this + alpha * s ) >= 0 Provided that these two inequalities hold for alpha = 0. Otherwise, the behavior is undefined. Implements IotrVector. |
|
Return the greatest number alpha in [0, maxstep] for which this[i] + alpha * s[i] >= 0 for all i, provided all elements of this are initially >= 0. If any element of this is negative, the behavior is undefined. Implements IotrVector. |
|
Write the components of this OOQP_Vector to a stream, subject to a format.
Implements IotrVector. |