9 #ifndef __IPCOMPOUNDVECTOR_HPP__ 10 #define __IPCOMPOUNDVECTOR_HPP__ 20 class CompoundVectorSpace;
191 const std::string& name,
193 const std::string& prefix)
const;
254 virtual void SetCompSpace(
Index icomp ,
264 return ncomp_spaces_;
277 return MakeNewCompoundVector();
bool IsValid(const SmartPtr< U > &smart_ptr)
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.
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 void AxpyImpl(Number alpha, const Vector &x)
Add the multiple alpha of vector x to this vector (DAXPY)
virtual void ElementWiseSqrtImpl()
Element-wise square-root.
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 Number MinImpl() const
Min value in the vector.
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...
virtual void SetImpl(Number value)
Set each element in the vector to the scalar alpha.
virtual void ElementWiseAbsImpl()
Element-wise absolute values.
virtual CompoundVector * MakeNewCompoundVector(bool create_new=true) const
Method for creating a new vector of this specific type.
virtual Number SumLogsImpl() const
Computes the sum of the logs of the elements of vector.
EJournalLevel
Print Level Enum.
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.
VectorSpace base class, corresponding to the Vector base class.
bool IsCompNull(Index i) const
Check if a particular component is null or not.
U * GetRawPtr(const SmartPtr< U > &smart_ptr)
virtual void ElementWiseMaxImpl(const Vector &x)
Element-wise max against entries in x.
SmartPtr< const Vector > GetComp(Index i) const
Return a particular component (const version)
~CompoundVectorSpace()
Destructor.
virtual void AddScalarImpl(Number scalar)
Add scalar to every component of the vector.
Number FracToBoundImpl(const Vector &delta, Number tau) const
Fraction to the boundary parameter.
virtual Number SumImpl() const
Computes the sum of the lements of vector.
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)
virtual Number MaxImpl() const
Max value in the vector.
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.
virtual Number DotImpl(const Vector &x) const
Computes inner product of vector x with this (DDOT)
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
virtual Number AsumImpl() const
Computes the 1-norm of this vector (DASUM)
const CompoundVectorSpace * owner_space_
Class responsible for all message output.
Index NComps() const
Number of components of this compound vector.
Index NCompSpaces() const
Accessor method to obtain the number of components.
virtual Vector * MakeNew() const
Overloaded MakeNew method for the VectorSpace base class.
This vectors space is the vector space for CompoundVector.
virtual void ElementWiseDivideImpl(const Vector &x)
Element-wise division .
virtual void ElementWiseMultiplyImpl(const Vector &x)
Element-wise multiplication .
virtual Number AmaxImpl() const
Computes the max-norm of this vector (based on IDAMAX)
EJournalCategory
Category Selection Enum.
const Vector * ConstComp(Index i) const
Class of Vectors consisting of other vectors.
virtual void ElementWiseReciprocalImpl()
Element-wise reciprocal.
std::vector< SmartPtr< Vector > > comps_
Components of the compound vector.