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