DenseVector Class Reference

#include <IpDenseVector.hpp>

Inheritance diagram for DenseVector:

Vector TaggedObject ReferencedObject Subject

List of all members.


Detailed Description

Dense Vector Implementation.

Public Member Functions

Constructors / Destructors
 DenseVector (const DenseVectorSpace *owner_space)
 Default Constructor.
virtual ~DenseVector ()
 Destructor.
Additional public methods not in Vector base class.
SmartPtr< DenseVectorMakeNewDenseVector () const
 Create a new DenseVector from same VectorSpace.
void SetValues (const Number *x)
 Set elements in the vector to the Number array x.
NumberValues ()
 Obtain pointer to the internal Number array with vector elements with the indention to change the vector data (USE WITH CARE!).
const NumberValues () const
 Obtain pointer to the internal Number array with vector elements without the intention to change the vector data (USE WITH CARE!).
bool IsHomogeneous () const
 Indicates if the vector is homogeneous (i.e., all entries have the value Scalar().
Number Scalar () const
 Scalar value of all entries in a homogeneous vector.
Modifying subranges of the vector.
void CopyToPos (Index Pos, const Vector &x)
 Copy the data in x into the subrange of this vector starting at position Pos in this vector.
void CopyFromPos (Index Pos, Vector &x) const
 Copy the data in this vector's subrange starting at position Pos to Vector x.

Protected Member Functions

Overloaded methods from Vector base class
virtual void CopyImpl (const Vector &x)
 Copy the data of the vector x into this vector (DCOPY).
virtual void ScalImpl (Number alpha)
 Scales the vector by scalar alpha (DSCAL).
virtual void AxpyImpl (Number alpha, const Vector &x)
 Add the multiple alpha of vector x to this vector (DAXPY).
virtual Number DotImpl (const Vector &x) const
 Computes inner product of vector x with this (DDOT).
virtual Number Nrm2Impl () const
 Computes the 2-norm of this vector (DNRM2).
virtual Number AsumImpl () const
 Computes the 1-norm of this vector (DASUM).
virtual Number AmaxImpl () const
 Computes the max-norm of this vector (based on IDAMAX).
virtual void SetImpl (Number value)
 Set each element in the vector to the scalar alpha.
virtual void ElementWiseDivideImpl (const Vector &x)
 Element-wise division $y_i \gets y_i/x_i$.
virtual void ElementWiseMultiplyImpl (const Vector &x)
 Element-wise multiplication $y_i \gets y_i*x_i$.
virtual void ElementWiseMaxImpl (const Vector &x)
 Set entry to max of itself and the corresponding element in x.
virtual void ElementWiseMinImpl (const Vector &x)
 Set entry to min of itself and the corresponding element in x.
virtual void ElementWiseReciprocalImpl ()
 reciprocates the elements of the vector
virtual void ElementWiseAbsImpl ()
 take abs of the elements of the vector
virtual void ElementWiseSqrtImpl ()
 take square-root of the elements of the vector
virtual void ElementWiseSgnImpl ()
 Changes each entry in the vector to its sgn value.
virtual void AddScalarImpl (Number scalar)
 Add scalar to every component of the vector.
virtual Number MaxImpl () const
 Max value in the vector.
virtual Number MinImpl () const
 Min value in the vector.
virtual Number SumImpl () const
 Computes the sum of the lements of vector.
virtual Number SumLogsImpl () const
 Computes the sum of the logs of the elements of vector.
Implemented specialized functions
void AddTwoVectorsImpl (Number a, const Vector &v1, Number b, const Vector &v2, Number c)
 Add two vectors (a * v1 + b * v2).
Number FracToBoundImpl (const Vector &delta, Number tau) const
 Fraction to the boundary parameter.
void AddVectorQuotientImpl (Number a, const Vector &z, const Vector &s, Number c)
 Add the quotient of two vectors, y = a * z/s + c * y.
Output methods
virtual void PrintImpl (const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const
 Print the entire vector.

Constructor & Destructor Documentation

DenseVector ( const DenseVectorSpace owner_space  ) 

Default Constructor.

References DBG_START_METH, and Vector::Dim().

~DenseVector (  )  [virtual]


Member Function Documentation

SmartPtr< DenseVector > MakeNewDenseVector (  )  const [inline]

Create a new DenseVector from same VectorSpace.

References DenseVectorSpace::MakeNewDenseVector().

void SetValues ( const Number x  ) 

Set elements in the vector to the Number array x.

References Vector::Dim(), Ipopt::IpBlasDcopy(), and TaggedObject::ObjectChanged().

Number * Values (  )  [inline]

const Number * Values (  )  const [inline]

Obtain pointer to the internal Number array with vector elements without the intention to change the vector data (USE WITH CARE!).

This does not produce a copy, and lifetime is not guaranteed!

References DBG_ASSERT, and Vector::Dim().

bool IsHomogeneous (  )  const [inline]

Number Scalar (  )  const [inline]

void CopyToPos ( Index  Pos,
const Vector x 
)

Copy the data in x into the subrange of this vector starting at position Pos in this vector.

Position count starts at 0.

References DBG_ASSERT, Vector::Dim(), DenseVector::homogeneous_, Ipopt::IpBlasDcopy(), TaggedObject::ObjectChanged(), and DenseVector::values_.

void CopyFromPos ( Index  Pos,
Vector x 
) const

Copy the data in this vector's subrange starting at position Pos to Vector x.

Position count starts at 0.

References DBG_ASSERT, Vector::Dim(), DenseVector::homogeneous_, DenseVector::initialized_, Ipopt::IpBlasDcopy(), TaggedObject::ObjectChanged(), and DenseVector::values_.

void CopyImpl ( const Vector x  )  [protected, virtual]

void ScalImpl ( Number  alpha  )  [protected, virtual]

Scales the vector by scalar alpha (DSCAL).

Implements Vector.

References DBG_ASSERT, Vector::Dim(), and Ipopt::IpBlasDscal().

void AxpyImpl ( Number  alpha,
const Vector x 
) [protected, virtual]

Add the multiple alpha of vector x to this vector (DAXPY).

Implements Vector.

References DBG_ASSERT, Vector::Dim(), DenseVector::homogeneous_, fkinkryx::i, DenseVector::initialized_, Ipopt::IpBlasDaxpy(), DenseVector::scalar_, and DenseVector::values_.

Number DotImpl ( const Vector x  )  const [protected, virtual]

Computes inner product of vector x with this (DDOT).

Implements Vector.

References DBG_ASSERT, Vector::Dim(), DenseVector::homogeneous_, DenseVector::initialized_, Ipopt::IpBlasDdot(), DenseVector::scalar_, and DenseVector::values_.

Number Nrm2Impl (  )  const [protected, virtual]

Computes the 2-norm of this vector (DNRM2).

Implements Vector.

References DBG_ASSERT, Vector::Dim(), and Ipopt::IpBlasDnrm2().

Number AsumImpl (  )  const [protected, virtual]

Computes the 1-norm of this vector (DASUM).

Implements Vector.

References DBG_ASSERT, Vector::Dim(), and Ipopt::IpBlasDasum().

Number AmaxImpl (  )  const [protected, virtual]

Computes the max-norm of this vector (based on IDAMAX).

Implements Vector.

References DBG_ASSERT, Vector::Dim(), and Ipopt::IpBlasIdamax().

void SetImpl ( Number  value  )  [protected, virtual]

Set each element in the vector to the scalar alpha.

Implements Vector.

References DenseVectorSpace::FreeInternalStorage().

void ElementWiseDivideImpl ( const Vector x  )  [protected, virtual]

void ElementWiseMultiplyImpl ( const Vector x  )  [protected, virtual]

void ElementWiseMaxImpl ( const Vector x  )  [protected, virtual]

Set entry to max of itself and the corresponding element in x.

Implements Vector.

References DBG_ASSERT, Vector::Dim(), DenseVector::homogeneous_, fkinkryx::i, DenseVector::initialized_, Ipopt::Max(), DenseVector::scalar_, and DenseVector::values_.

void ElementWiseMinImpl ( const Vector x  )  [protected, virtual]

Set entry to min of itself and the corresponding element in x.

Implements Vector.

References DBG_ASSERT, Vector::Dim(), DenseVector::homogeneous_, fkinkryx::i, DenseVector::initialized_, Ipopt::Min(), DenseVector::scalar_, and DenseVector::values_.

void ElementWiseReciprocalImpl (  )  [protected, virtual]

reciprocates the elements of the vector

Implements Vector.

References DBG_ASSERT, Vector::Dim(), and fkinkryx::i.

void ElementWiseAbsImpl (  )  [protected, virtual]

take abs of the elements of the vector

Implements Vector.

References DBG_ASSERT, Vector::Dim(), and fkinkryx::i.

void ElementWiseSqrtImpl (  )  [protected, virtual]

take square-root of the elements of the vector

Implements Vector.

References DBG_ASSERT, Vector::Dim(), and fkinkryx::i.

void ElementWiseSgnImpl (  )  [protected, virtual]

Changes each entry in the vector to its sgn value.

Implements Vector.

References DBG_ASSERT, Vector::Dim(), and fkinkryx::i.

void AddScalarImpl ( Number  scalar  )  [protected, virtual]

Add scalar to every component of the vector.

Implements Vector.

References DBG_ASSERT, Vector::Dim(), and Ipopt::IpBlasDaxpy().

Number MaxImpl (  )  const [protected, virtual]

Max value in the vector.

Implements Vector.

References DBG_ASSERT, Vector::Dim(), fkinkryx::i, Ipopt::Max(), and SimTK::max().

Number MinImpl (  )  const [protected, virtual]

Min value in the vector.

Implements Vector.

References DBG_ASSERT, Vector::Dim(), fkinkryx::i, Ipopt::Min(), and SimTK::min().

Number SumImpl (  )  const [protected, virtual]

Computes the sum of the lements of vector.

Implements Vector.

References DBG_ASSERT, Vector::Dim(), fkinkryx::i, and SimTK::sum().

Number SumLogsImpl (  )  const [protected, virtual]

Computes the sum of the logs of the elements of vector.

Implements Vector.

References DBG_ASSERT, Vector::Dim(), fkinkryx::i, and SimTK::sum().

void AddTwoVectorsImpl ( Number  a,
const Vector v1,
Number  b,
const Vector v2,
Number  c 
) [protected, virtual]

Add two vectors (a * v1 + b * v2).

Result is stored in this vector.

Reimplemented from Vector.

References Vector::AddTwoVectorsImpl(), DBG_ASSERT, Vector::Dim(), DenseVector::homogeneous_, fkinkryx::i, DenseVector::initialized_, DenseVector::scalar_, and DenseVector::values_.

Number FracToBoundImpl ( const Vector delta,
Number  tau 
) const [protected, virtual]

Fraction to the boundary parameter.

Reimplemented from Vector.

References alpha, DBG_ASSERT, Vector::Dim(), DenseVector::homogeneous_, fkinkryx::i, Ipopt::Min(), DenseVector::scalar_, and DenseVector::values_.

void AddVectorQuotientImpl ( Number  a,
const Vector z,
const Vector s,
Number  c 
) [protected, virtual]

void PrintImpl ( const Journalist jnlst,
EJournalLevel  level,
EJournalCategory  category,
const std::string &  name,
Index  indent,
const std::string &  prefix 
) const [protected, virtual]

Print the entire vector.

Implements Vector.

References Vector::Dim(), fkinkryx::i, and Journalist::PrintfIndented().


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

Generated on Fri Sep 26 07:44:25 2008 for SimTKcore by  doxygen 1.5.6