Go to the documentation of this file.
9 #ifndef __IPCOMPOUNDVECTOR_HPP__
10 #define __IPCOMPOUNDVECTOR_HPP__
20 class CompoundVectorSpace;
191 const std::string& name,
193 const std::string& prefix)
const;
virtual void SetImpl(Number value)
Set each element in the vector to the scalar alpha.
virtual Number SumLogsImpl() const
Computes the sum of the logs of the elements of vector.
CompoundVector(const CompoundVector &)
Copy Constructor.
virtual Number Nrm2Impl() const
Computes the 2-norm of this vector (DNRM2)
CompoundVectorSpace()
Default constructor.
virtual void ElementWiseDivideImpl(const Vector &x)
Element-wise division .
SmartPtr< const VectorSpace > GetCompSpace(Index icomp) const
Method for obtaining an individual component VectorSpace.
virtual Number AmaxImpl() const
Computes the max-norm of this vector (based on IDAMAX)
virtual void ElementWiseReciprocalImpl()
Element-wise reciprocal.
CompoundVectorSpace(Index ncomp_spaces, Index total_dim)
Constructor, has to be given the number of components and the total dimension of all components combi...
bool IsCompNull(Index i) const
Check if a particular component is null or not.
void AddTwoVectorsImpl(Number a, const Vector &v1, Number b, const Vector &v2, Number c)
Add two vectors (a * v1 + b * v2).
double Number
Type of all numbers.
Index NCompSpaces() const
Accessor method to obtain the number of components.
virtual void ElementWiseSqrtImpl()
Element-wise square-root.
virtual Number MinImpl() const
Min value in the vector.
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.
virtual void AxpyImpl(Number alpha, const Vector &x)
Add the multiple alpha of vector x to this vector (DAXPY)
void ObjectChanged()
Objects derived from TaggedObject MUST call this method every time their internal state changes to up...
EJournalLevel
Print Level Enum.
SmartPtr< const Vector > GetComp(Index i) const
Return a particular component (const version)
bool IsCompConst(Index i) const
Check if a particular component is const or not.
virtual void CopyImpl(const Vector &x)
Copy the data of the vector x into this vector (DCOPY).
virtual Vector * MakeNew() const
Overloaded MakeNew method for the VectorSpace base class.
Number * x
Input: Starting point Output: Optimal solution.
virtual void ScalImpl(Number alpha)
Scales the vector by scalar alpha (DSCAL)
void SetCompNonConst(Index icomp, Vector &vec)
Method for setting the pointer for a component that is a non-const Vector.
virtual ~CompoundVector()
Default destructor.
SmartPtr< Vector > GetCompNonConst(Index i)
Return a particular component (non-const version).
Number FracToBoundImpl(const Vector &delta, Number tau) const
Fraction to the boundary parameter.
int Index
Type of all indices of vectors, matrices etc.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
U * GetRawPtr(const SmartPtr< U > &smart_ptr)
Template class for Smart Pointers.
CompoundVectorSpace & operator=(const CompoundVectorSpace &)
Overloaded Equals Operator.
EJournalCategory
Category Selection Enum.
Index NComps() const
Number of components of this compound vector.
void AddVectorQuotientImpl(Number a, const Vector &z, const Vector &s, Number c)
Add the quotient of two vectors, y = a * z/s + c * y.
virtual void ElementWiseAbsImpl()
Element-wise absolute values.
const Index ncomp_spaces_
Number of components.
std::vector< SmartPtr< const VectorSpace > > comp_spaces_
std::vector of vector spaces for the components
virtual void SetCompSpace(Index icomp, const VectorSpace &vec_space)
Method for setting the individual component VectorSpaces.
CompoundVector(const CompoundVectorSpace *owner_space, bool create_new)
Constructor, given the corresponding CompoundVectorSpace.
Class responsible for all message output.
const Vector * ConstComp(Index i) const
virtual void AddScalarImpl(Number scalar)
Add scalar to every component of the vector.
virtual Number SumImpl() const
Computes the sum of the lements of vector.
VectorSpace base class, corresponding to the Vector base class.
virtual void ElementWiseMaxImpl(const Vector &x)
Element-wise max against entries in x.
virtual void ElementWiseMultiplyImpl(const Vector &x)
Element-wise multiplication .
Class of Vectors consisting of other vectors.
void operator=(const CompoundVector &)
Overloaded Equals Operator.
bool IsValid(const SmartPtr< U > &smart_ptr)
void SetComp(Index icomp, const Vector &vec)
Method for setting the pointer for a component that is a const Vector.
std::vector< SmartPtr< const Vector > > const_comps_
std::vector< SmartPtr< Vector > > comps_
Components of the compound vector.
CompoundVector()
Default Constructor.
virtual Number DotImpl(const Vector &x) const
Computes inner product of vector x with this (DDOT)
~CompoundVectorSpace()
Destructor.
const CompoundVectorSpace * owner_space_
CompoundVectorSpace(const CompoundVectorSpace &)
Copy Constructor.
virtual Number MaxImpl() const
Max value in the vector.
virtual void ElementWiseMinImpl(const Vector &x)
Element-wise min against entries in x.
virtual void ElementWiseSgnImpl()
Replaces entries with sgn of the entry.
This vectors space is the vector space for CompoundVector.
virtual CompoundVector * MakeNewCompoundVector(bool create_new=true) const
Method for creating a new vector of this specific type.
virtual Number AsumImpl() const
Computes the 1-norm of this vector (DASUM)