#include <IpVector.hpp>
This is the base class for all derived vector types. Those vectors are meant to store entities like iterates, Lagrangian multipliers, constraint values etc. The implementation of a vector type depends on the computational environment (e.g. just a double array on a shared memory machine, or distributed double arrays for a distributed memory machine.)
Deriving from Vector: This class inherits from tagged object to implement an advanced caching scheme. Because of this, the TaggedObject method ObjectChanged() must be called each time the Vector changes. If you overload the XXXX_Impl protected methods, this taken care of (along with caching if possible) for you. If you have additional methods in your derived class that change the underlying data (vector values), you MUST remember to call ObjectChanged() AFTER making the change!
Public Member Functions | |
Vector * | MakeNew () const |
Create new Vector of the same type with uninitialized data. | |
Vector * | MakeNewCopy () const |
Create new Vector of the same type and copy the data over. | |
bool | HasValidNumbers () const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan). | |
Constructor/Destructor | |
Vector (const VectorSpace *owner_space) | |
Constructor. | |
virtual | ~Vector () |
Destructor. | |
Standard BLAS-1 Operations | |
(derived classes do NOT overload these methods, instead, overload the protected versions of these methods). | |
void | Copy (const Vector &x) |
Copy the data of the vector x into this vector (DCOPY). | |
void | Scal (Number alpha) |
Scales the vector by scalar alpha (DSCAL). | |
void | Axpy (Number alpha, const Vector &x) |
Add the multiple alpha of vector x to this vector (DAXPY). | |
Number | Dot (const Vector &x) const |
Computes inner product of vector x with this (DDOT). | |
Number | Nrm2 () const |
Computes the 2-norm of this vector (DNRM2). | |
Number | Asum () const |
Computes the 1-norm of this vector (DASUM). | |
Number | Amax () const |
Computes the max-norm of this vector (based on IDAMAX). | |
Additional (Non-BLAS) Vector Methods | |
(derived classes do NOT overload these methods, instead, overload the protected versions of these methods). | |
void | Set (Number alpha) |
Set each element in the vector to the scalar alpha. | |
void | ElementWiseDivide (const Vector &x) |
Element-wise division . | |
void | ElementWiseMultiply (const Vector &x) |
Element-wise multiplication . | |
void | ElementWiseMax (const Vector &x) |
Element-wise max against entries in x. | |
void | ElementWiseMin (const Vector &x) |
Element-wise min against entries in x. | |
void | ElementWiseReciprocal () |
Reciprocates the entries in the vector. | |
void | ElementWiseAbs () |
Absolute values of the entries in the vector. | |
void | ElementWiseSqrt () |
Element-wise square root of the entries in the vector. | |
void | ElementWiseSgn () |
Replaces the vector values with their sgn values ( -1 if x_i < 0, 0 if x_i == 0, and 1 if x_i > 0). | |
void | AddScalar (Number scalar) |
Add scalar to every vector component. | |
Number | Max () const |
Returns the maximum value in the vector. | |
Number | Min () const |
Returns the minimum value in the vector. | |
Number | Sum () const |
Returns the sum of the vector entries. | |
Number | SumLogs () const |
Returns the sum of the logs of each vector entry. | |
Methods for specialized operations. A prototype | |
implementation is provided, but for efficient implementation those should be specially implemented. | |
void | AddOneVector (Number a, const Vector &v1, Number c) |
Add one vector, y = a * v1 + c * y. | |
void | AddTwoVectors (Number a, const Vector &v1, Number b, const Vector &v2, Number c) |
Add two vectors, y = a * v1 + b * v2 + c * y. | |
Number | FracToBound (const Vector &delta, Number tau) const |
Fraction to the boundary parameter. | |
void | AddVectorQuotient (Number a, const Vector &z, const Vector &s, Number c) |
Add the quotient of two vectors, y = a * z/s + c * y. | |
Accessor methods | |
Index | Dim () const |
Dimension of the Vector. | |
SmartPtr< const VectorSpace > | OwnerSpace () const |
Return the owner VectorSpace. | |
Output methods | |
(derived classes do NOT overload these methods, instead, overload the protected versions of these methods). | |
void | Print (SmartPtr< const Journalist > jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent=0, const std::string &prefix="") const |
Print the entire vector. | |
void | Print (const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent=0, const std::string &prefix="") const |
Print the entire vector. | |
Protected Member Functions | |
implementation methods (derived classes MUST | |
overload these pure virtual protected methods.
) | |
virtual void | CopyImpl (const Vector &x)=0 |
Copy the data of the vector x into this vector (DCOPY). | |
virtual void | ScalImpl (Number alpha)=0 |
Scales the vector by scalar alpha (DSCAL). | |
virtual void | AxpyImpl (Number alpha, const Vector &x)=0 |
Add the multiple alpha of vector x to this vector (DAXPY). | |
virtual Number | DotImpl (const Vector &x) const =0 |
Computes inner product of vector x with this (DDOT). | |
virtual Number | Nrm2Impl () const =0 |
Computes the 2-norm of this vector (DNRM2). | |
virtual Number | AsumImpl () const =0 |
Computes the 1-norm of this vector (DASUM). | |
virtual Number | AmaxImpl () const =0 |
Computes the max-norm of this vector (based on IDAMAX). | |
virtual void | SetImpl (Number alpha)=0 |
Set each element in the vector to the scalar alpha. | |
virtual void | ElementWiseDivideImpl (const Vector &x)=0 |
Element-wise division . | |
virtual void | ElementWiseMultiplyImpl (const Vector &x)=0 |
Element-wise multiplication . | |
virtual void | ElementWiseMaxImpl (const Vector &x)=0 |
Element-wise max against entries in x. | |
virtual void | ElementWiseMinImpl (const Vector &x)=0 |
Element-wise min against entries in x. | |
virtual void | ElementWiseReciprocalImpl ()=0 |
Reciprocates the elements of the vector. | |
virtual void | ElementWiseAbsImpl ()=0 |
Take elementwise absolute values of the elements of the vector. | |
virtual void | ElementWiseSqrtImpl ()=0 |
Take elementwise square-root of the elements of the vector. | |
virtual void | ElementWiseSgnImpl ()=0 |
Replaces entries with sgn of the entry. | |
virtual void | AddScalarImpl (Number scalar)=0 |
Add scalar to every component of vector. | |
virtual Number | MaxImpl () const =0 |
Max value in the vector. | |
virtual Number | MinImpl () const =0 |
Min number in the vector. | |
virtual Number | SumImpl () const =0 |
Sum of entries in the vector. | |
virtual Number | SumLogsImpl () const =0 |
Sum of logs of entries in the vector. | |
virtual void | AddTwoVectorsImpl (Number a, const Vector &v1, Number b, const Vector &v2, Number c) |
Add two vectors (a * v1 + b * v2). | |
virtual Number | FracToBoundImpl (const Vector &delta, Number tau) const |
Fraction to boundary parameter. | |
virtual void | AddVectorQuotientImpl (Number a, const Vector &z, const Vector &s, Number c) |
Add the quotient of two vectors. | |
virtual bool | HasValidNumbersImpl () const |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan). | |
virtual void | PrintImpl (const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const =0 |
Print the entire vector. |
Vector | ( | const VectorSpace * | owner_space | ) | [inline] |
Constructor.
It has to be given a pointer to the corresponding VectorSpace.
References DBG_ASSERT, and Ipopt::IsValid().
~Vector | ( | ) | [inline, virtual] |
Destructor.
Vector * MakeNew | ( | ) | const [inline] |
Create new Vector of the same type with uninitialized data.
Referenced by ScaledMatrix::AddMSinvZImpl(), Matrix::AddMSinvZImpl(), Vector::AddVectorQuotientImpl(), LeastSquareMultipliers::CalculateMultipliers(), Vector::FracToBoundImpl(), RestoIpoptNLP::grad_f(), Vector::MakeNewCopy(), StdAugSystemSolver::MultiSolve(), SymScaledMatrix::MultVectorImpl(), ScaledMatrix::MultVectorImpl(), DiagMatrix::MultVectorImpl(), DefaultIterateInitializer::push_variables(), and ScaledMatrix::TransMultVectorImpl().
Vector * MakeNewCopy | ( | ) | const [inline] |
Create new Vector of the same type and copy the data over.
References Vector::Copy(), SimTK::Impl::copy(), and Vector::MakeNew().
Referenced by OrigIpoptNLP::AdjustVariableBounds(), StdAugSystemSolver::MultiSolve(), SymScaledMatrix::MultVectorImpl(), ScaledMatrix::MultVectorImpl(), LowRankUpdateSymMatrix::MultVectorImpl(), and ScaledMatrix::TransMultVectorImpl().
void Copy | ( | const Vector & | x | ) | [inline] |
Copy the data of the vector x into this vector (DCOPY).
References Vector::amax_cache_tag_, Vector::asum_cache_tag_, Vector::cached_amax_, Vector::cached_asum_, Vector::cached_max_, Vector::cached_min_, Vector::cached_nrm2_, Vector::cached_sum_, Vector::cached_sumlogs_, Vector::CopyImpl(), TaggedObject::GetTag(), Vector::max_cache_tag_, Vector::min_cache_tag_, Vector::nrm2_cache_tag_, TaggedObject::ObjectChanged(), Vector::sum_cache_tag_, and Vector::sumlogs_cache_tag_.
Referenced by Vector::AddTwoVectorsImpl(), CompoundVector::CopyImpl(), and Vector::MakeNewCopy().
void Scal | ( | Number | alpha | ) |
Scales the vector by scalar alpha (DSCAL).
References Vector::Dim(), TaggedObject::GetTag(), TaggedObject::ObjectChanged(), and Vector::ScalImpl().
Referenced by Vector::AddTwoVectorsImpl(), MultiVectorMatrix::LRMultVector(), ZeroMatrix::MultVectorImpl(), SymTMatrix::MultVectorImpl(), SymScaledMatrix::MultVectorImpl(), SumSymMatrix::MultVectorImpl(), SumMatrix::MultVectorImpl(), ScaledMatrix::MultVectorImpl(), MultiVectorMatrix::MultVectorImpl(), GenTMatrix::MultVectorImpl(), ExpansionMatrix::MultVectorImpl(), DiagMatrix::MultVectorImpl(), CompoundSymMatrix::MultVectorImpl(), CompoundMatrix::MultVectorImpl(), MultiVectorMatrix::ScaleColumns(), CompoundVector::ScalImpl(), PDFullSpaceSolver::Solve(), ZeroMatrix::TransMultVectorImpl(), SumMatrix::TransMultVectorImpl(), ScaledMatrix::TransMultVectorImpl(), GenTMatrix::TransMultVectorImpl(), ExpansionMatrix::TransMultVectorImpl(), and CompoundMatrix::TransMultVectorImpl().
Add the multiple alpha of vector x to this vector (DAXPY).
References Vector::AxpyImpl(), and TaggedObject::ObjectChanged().
Referenced by Vector::AddTwoVectorsImpl(), CompoundVector::AxpyImpl(), SymScaledMatrix::MultVectorImpl(), ScaledMatrix::MultVectorImpl(), DiagMatrix::MultVectorImpl(), ScaledMatrix::SinvBlrmZMTdBrImpl(), Matrix::SinvBlrmZMTdBrImpl(), PDFullSpaceSolver::Solve(), and ScaledMatrix::TransMultVectorImpl().
Computes inner product of vector x with this (DDOT).
References Vector::DotImpl(), and Vector::Nrm2().
Referenced by CompoundVector::DotImpl(), OrigIpoptNLP::f(), and MultiVectorMatrix::TransMultVectorImpl().
Number Nrm2 | ( | ) | const [inline] |
Computes the 2-norm of this vector (DNRM2).
References TaggedObject::GetTag(), and Vector::Nrm2Impl().
Referenced by IpoptCalculatedQuantities::CalcNormOfType(), Vector::Dot(), and CompoundVector::Nrm2Impl().
Number Asum | ( | ) | const [inline] |
Computes the 1-norm of this vector (DASUM).
References Vector::AsumImpl(), and TaggedObject::GetTag().
Referenced by CompoundVector::AsumImpl(), IpoptCalculatedQuantities::CalcCentralityMeasure(), IpoptCalculatedQuantities::CalcNormOfType(), TNLPAdapter::Eval_h(), and Vector::HasValidNumbersImpl().
Number Amax | ( | ) | const [inline] |
Computes the max-norm of this vector (based on IDAMAX).
References Vector::AmaxImpl(), and TaggedObject::GetTag().
Referenced by CompoundVector::AmaxImpl(), and IpoptCalculatedQuantities::CalcNormOfType().
void Set | ( | Number | alpha | ) | [inline] |
Set each element in the vector to the scalar alpha.
References TaggedObject::ObjectChanged(), and Vector::SetImpl().
Referenced by Vector::AddTwoVectorsImpl(), IpoptCalculatedQuantities::curr_grad_barrier_obj_s(), IpoptCalculatedQuantities::curr_grad_barrier_obj_x(), MultiVectorMatrix::LRMultVector(), ZeroMatrix::MultVectorImpl(), SymTMatrix::MultVectorImpl(), SymScaledMatrix::MultVectorImpl(), SumSymMatrix::MultVectorImpl(), SumMatrix::MultVectorImpl(), ScaledMatrix::MultVectorImpl(), MultiVectorMatrix::MultVectorImpl(), GenTMatrix::MultVectorImpl(), ExpansionMatrix::MultVectorImpl(), DiagMatrix::MultVectorImpl(), CompoundSymMatrix::MultVectorImpl(), CompoundMatrix::MultVectorImpl(), CompoundVector::SetImpl(), ZeroMatrix::TransMultVectorImpl(), SumMatrix::TransMultVectorImpl(), ScaledMatrix::TransMultVectorImpl(), GenTMatrix::TransMultVectorImpl(), ExpansionMatrix::TransMultVectorImpl(), and CompoundMatrix::TransMultVectorImpl().
void ElementWiseDivide | ( | const Vector & | x | ) | [inline] |
Element-wise division .
References Vector::ElementWiseDivideImpl(), and TaggedObject::ObjectChanged().
Referenced by Vector::AddVectorQuotientImpl(), IpoptCalculatedQuantities::curr_grad_barrier_obj_s(), CompoundVector::ElementWiseDivideImpl(), ScaledMatrix::SinvBlrmZMTdBrImpl(), and Matrix::SinvBlrmZMTdBrImpl().
void ElementWiseMultiply | ( | const Vector & | x | ) | [inline] |
Element-wise multiplication .
References Vector::ElementWiseMultiplyImpl(), and TaggedObject::ObjectChanged().
Referenced by CompoundVector::ElementWiseMultiplyImpl(), LowRankUpdateSymMatrix::MultVectorImpl(), MultiVectorMatrix::ScaleRows(), ScaledMatrix::SinvBlrmZMTdBrImpl(), and Matrix::SinvBlrmZMTdBrImpl().
void ElementWiseMax | ( | const Vector & | x | ) | [inline] |
Element-wise max against entries in x.
References Vector::ElementWiseMaxImpl(), and TaggedObject::ObjectChanged().
Referenced by CompoundVector::ElementWiseMaxImpl().
void ElementWiseMin | ( | const Vector & | x | ) | [inline] |
Element-wise min against entries in x.
References Vector::ElementWiseMinImpl(), and TaggedObject::ObjectChanged().
Referenced by CompoundVector::ElementWiseMinImpl().
void ElementWiseReciprocal | ( | ) | [inline] |
Reciprocates the entries in the vector.
References Vector::ElementWiseReciprocalImpl(), and TaggedObject::ObjectChanged().
Referenced by CompoundVector::ElementWiseReciprocalImpl().
void ElementWiseAbs | ( | ) | [inline] |
Absolute values of the entries in the vector.
References Vector::ElementWiseAbsImpl(), and TaggedObject::ObjectChanged().
Referenced by CompoundVector::ElementWiseAbsImpl().
void ElementWiseSqrt | ( | ) | [inline] |
Element-wise square root of the entries in the vector.
References Vector::ElementWiseSqrtImpl(), and TaggedObject::ObjectChanged().
Referenced by CompoundVector::ElementWiseSqrtImpl().
void ElementWiseSgn | ( | ) | [inline] |
Replaces the vector values with their sgn values ( -1 if x_i < 0, 0 if x_i == 0, and 1 if x_i > 0).
References Vector::ElementWiseSgnImpl(), and TaggedObject::ObjectChanged().
Referenced by CompoundVector::ElementWiseSgnImpl().
void AddScalar | ( | Number | scalar | ) | [inline] |
Add scalar to every vector component.
References Vector::AddScalarImpl(), and TaggedObject::ObjectChanged().
Referenced by CompoundVector::AddScalarImpl().
Number Max | ( | ) | const [inline] |
Returns the maximum value in the vector.
References TaggedObject::GetTag(), and Vector::MaxImpl().
Referenced by CompoundVector::MaxImpl().
Number Min | ( | ) | const [inline] |
Returns the minimum value in the vector.
References TaggedObject::GetTag(), and Vector::MinImpl().
Referenced by IpoptCalculatedQuantities::CalcCentralityMeasure(), and CompoundVector::MinImpl().
Number Sum | ( | ) | const [inline] |
Returns the sum of the vector entries.
References TaggedObject::GetTag(), and Vector::SumImpl().
Referenced by RestoIpoptNLP::f(), and CompoundVector::SumImpl().
Number SumLogs | ( | ) | const [inline] |
Returns the sum of the logs of each vector entry.
References TaggedObject::GetTag(), and Vector::SumLogsImpl().
Referenced by CompoundVector::SumLogsImpl().
Add one vector, y = a * v1 + c * y.
This is automatically reduced to call AddTwoVectors.
References Vector::AddTwoVectorsImpl().
Referenced by MultiVectorMatrix::AddOneMultiVectorMatrix(), Vector::AddVectorQuotientImpl(), MultiVectorMatrix::LRMultVector(), MultiVectorMatrix::MultVectorImpl(), LowRankUpdateSymMatrix::MultVectorImpl(), and IdentityMatrix::MultVectorImpl().
Add two vectors, y = a * v1 + b * v2 + c * y.
Here, this vector is y
References Vector::AddTwoVectorsImpl(), and TaggedObject::ObjectChanged().
Referenced by CompoundVector::AddTwoVectorsImpl().
Fraction to the boundary parameter.
Computes
References Vector::FracToBoundImpl().
Referenced by CompoundVector::FracToBoundImpl().
Add the quotient of two vectors, y = a * z/s + c * y.
References Vector::AddVectorQuotientImpl(), and TaggedObject::ObjectChanged().
Referenced by IdentityMatrix::AddMSinvZImpl(), and CompoundVector::AddVectorQuotientImpl().
bool HasValidNumbers | ( | ) | const [inline] |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
References TaggedObject::GetTag(), and Vector::HasValidNumbersImpl().
Referenced by MultiVectorMatrix::HasValidNumbersImpl(), and CompoundVector::HasValidNumbersImpl().
Index Dim | ( | ) | const [inline] |
Dimension of the Vector.
Referenced by IdentityMatrix::AddMSinvZImpl(), ExpansionMatrix::AddMSinvZImpl(), DenseVector::AddScalarImpl(), DenseVector::AddTwoVectorsImpl(), Vector::AddVectorQuotientImpl(), DenseVector::AddVectorQuotientImpl(), DenseVector::AmaxImpl(), DenseVector::AsumImpl(), DenseVector::AxpyImpl(), IpoptCalculatedQuantities::CalcCentralityMeasure(), DenseGenMatrix::CholeskySolveVector(), CompoundVector::CompoundVector(), DenseGenMatrix::ComputeEigenVectors(), DenseVector::CopyFromPos(), DenseVector::CopyImpl(), DenseVector::CopyToPos(), DenseVector::DenseVector(), DenseVector::DotImpl(), DenseVector::ElementWiseAbsImpl(), DenseVector::ElementWiseDivideImpl(), DenseVector::ElementWiseMaxImpl(), DenseVector::ElementWiseMinImpl(), DenseVector::ElementWiseMultiplyImpl(), DenseVector::ElementWiseReciprocalImpl(), DenseVector::ElementWiseSgnImpl(), DenseVector::ElementWiseSqrtImpl(), TNLPAdapter::Eval_d(), TNLPAdapter::Eval_grad_f(), TripletHelper::FillValuesFromVector(), TNLPAdapter::FinalizeSolution(), Vector::FracToBoundImpl(), DenseVector::FracToBoundImpl(), TNLPAdapter::GetScalingParameters(), MultiVectorMatrix::LRMultVector(), DenseVector::MaxImpl(), CompoundVector::MaxImpl(), DenseVector::MinImpl(), CompoundVector::MinImpl(), ZeroMatrix::MultVectorImpl(), SymTMatrix::MultVectorImpl(), SumSymMatrix::MultVectorImpl(), SumMatrix::MultVectorImpl(), MultiVectorMatrix::MultVectorImpl(), LowRankUpdateSymMatrix::MultVectorImpl(), IdentityMatrix::MultVectorImpl(), GenTMatrix::MultVectorImpl(), ExpansionMatrix::MultVectorImpl(), DiagMatrix::MultVectorImpl(), DenseSymMatrix::MultVectorImpl(), DenseGenMatrix::MultVectorImpl(), DenseVector::Nrm2Impl(), DenseVector::PrintImpl(), TripletHelper::PutValuesInVector(), Vector::Scal(), MultiVectorMatrix::ScaleColumns(), DenseGenMatrix::ScaleColumns(), MultiVectorMatrix::ScaleRows(), DenseVector::ScalImpl(), DenseVector::SetValues(), ExpansionMatrix::SinvBlrmZMTdBrImpl(), LowRankAugSystemSolver::Solve(), DenseSymMatrix::SpecialAddForLMSR1(), DenseVector::SumImpl(), DenseVector::SumLogsImpl(), ZeroMatrix::TransMultVectorImpl(), SumMatrix::TransMultVectorImpl(), MultiVectorMatrix::TransMultVectorImpl(), GenTMatrix::TransMultVectorImpl(), ExpansionMatrix::TransMultVectorImpl(), DenseGenMatrix::TransMultVectorImpl(), and DenseVector::Values().
SmartPtr< const VectorSpace > OwnerSpace | ( | ) | const [inline] |
void Print | ( | SmartPtr< const Journalist > | jnlst, | |
EJournalLevel | level, | |||
EJournalCategory | category, | |||
const std::string & | name, | |||
Index | indent = 0 , |
|||
const std::string & | prefix = "" | |||
) | const |
Print the entire vector.
References Ipopt::IsValid(), and Vector::PrintImpl().
Referenced by MultiVectorMatrix::PrintImpl(), CompoundVector::PrintImpl(), and DefaultIterateInitializer::push_variables().
void Print | ( | const Journalist & | jnlst, | |
EJournalLevel | level, | |||
EJournalCategory | category, | |||
const std::string & | name, | |||
Index | indent = 0 , |
|||
const std::string & | prefix = "" | |||
) | const |
virtual void CopyImpl | ( | const Vector & | x | ) | [protected, pure virtual] |
Copy the data of the vector x into this vector (DCOPY).
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Copy().
virtual void ScalImpl | ( | Number | alpha | ) | [protected, pure virtual] |
Scales the vector by scalar alpha (DSCAL).
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Scal().
Add the multiple alpha of vector x to this vector (DAXPY).
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Axpy().
Computes inner product of vector x with this (DDOT).
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Dot().
virtual Number Nrm2Impl | ( | ) | const [protected, pure virtual] |
Computes the 2-norm of this vector (DNRM2).
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Nrm2().
virtual Number AsumImpl | ( | ) | const [protected, pure virtual] |
Computes the 1-norm of this vector (DASUM).
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Asum().
virtual Number AmaxImpl | ( | ) | const [protected, pure virtual] |
Computes the max-norm of this vector (based on IDAMAX).
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Amax().
virtual void SetImpl | ( | Number | alpha | ) | [protected, pure virtual] |
Set each element in the vector to the scalar alpha.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Set().
virtual void ElementWiseDivideImpl | ( | const Vector & | x | ) | [protected, pure virtual] |
Element-wise division .
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::ElementWiseDivide().
virtual void ElementWiseMultiplyImpl | ( | const Vector & | x | ) | [protected, pure virtual] |
Element-wise multiplication .
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::ElementWiseMultiply().
virtual void ElementWiseMaxImpl | ( | const Vector & | x | ) | [protected, pure virtual] |
Element-wise max against entries in x.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::ElementWiseMax().
virtual void ElementWiseMinImpl | ( | const Vector & | x | ) | [protected, pure virtual] |
Element-wise min against entries in x.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::ElementWiseMin().
virtual void ElementWiseReciprocalImpl | ( | ) | [protected, pure virtual] |
Reciprocates the elements of the vector.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::ElementWiseReciprocal().
virtual void ElementWiseAbsImpl | ( | ) | [protected, pure virtual] |
Take elementwise absolute values of the elements of the vector.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::ElementWiseAbs().
virtual void ElementWiseSqrtImpl | ( | ) | [protected, pure virtual] |
Take elementwise square-root of the elements of the vector.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::ElementWiseSqrt().
virtual void ElementWiseSgnImpl | ( | ) | [protected, pure virtual] |
Replaces entries with sgn of the entry.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::ElementWiseSgn().
virtual void AddScalarImpl | ( | Number | scalar | ) | [protected, pure virtual] |
Add scalar to every component of vector.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::AddScalar().
virtual Number MaxImpl | ( | ) | const [protected, pure virtual] |
Max value in the vector.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Max().
virtual Number MinImpl | ( | ) | const [protected, pure virtual] |
Min number in the vector.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Min().
virtual Number SumImpl | ( | ) | const [protected, pure virtual] |
Sum of entries in the vector.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Sum().
virtual Number SumLogsImpl | ( | ) | const [protected, pure virtual] |
Sum of logs of entries in the vector.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::SumLogs().
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 in CompoundVector, and DenseVector.
References Vector::Axpy(), Vector::Copy(), Vector::Scal(), and Vector::Set().
Referenced by Vector::AddOneVector(), Vector::AddTwoVectors(), and DenseVector::AddTwoVectorsImpl().
Fraction to boundary parameter.
Reimplemented in CompoundVector, and DenseVector.
References alpha, DBG_ASSERT, Vector::Dim(), Vector::MakeNew(), and Ipopt::Min().
Referenced by Vector::FracToBound().
void AddVectorQuotientImpl | ( | Number | a, | |
const Vector & | z, | |||
const Vector & | s, | |||
Number | c | |||
) | [protected, virtual] |
Add the quotient of two vectors.
Reimplemented in CompoundVector, and DenseVector.
References Vector::AddOneVector(), DBG_ASSERT, Vector::Dim(), Vector::ElementWiseDivide(), and Vector::MakeNew().
Referenced by Vector::AddVectorQuotient().
bool HasValidNumbersImpl | ( | ) | const [protected, virtual] |
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
A default implementation using Asum is provided.
Reimplemented in CompoundVector.
References Vector::Asum(), Ipopt::IsFiniteNumber(), and SimTK::sum().
Referenced by Vector::HasValidNumbers().
virtual void PrintImpl | ( | const Journalist & | jnlst, | |
EJournalLevel | level, | |||
EJournalCategory | category, | |||
const std::string & | name, | |||
Index | indent, | |||
const std::string & | prefix | |||
) | const [protected, pure virtual] |
Print the entire vector.
Implemented in CompoundVector, and DenseVector.
Referenced by Vector::Print().