59 virtual size_t size()
const = 0;
60 virtual void resize(
size_t newSize,
bool bCopyValues=
true) = 0;
70 virtual double norm2()
const = 0;
72 virtual void set(
double d) = 0;
74 virtual void print(std::ostream &output)
const = 0;
82 T *t =
dynamic_cast<T*
>(
this);
83 UG_ASSERT(t != NULL,
"could not downcast " <<
TypeName(
this) <<
" to " << TypeName<T>());
89 const T *t =
dynamic_cast<const T*
>(
this);
90 UG_ASSERT(t != NULL,
"could not downcast " <<
TypeName(
this) <<
" to " << TypeName<T>());
146 template<
typename TVec>
152 return *((TVec*)
this);
156 return *((TVec*)
this);
181 virtual void set(
double d)
184 for(
size_t i=0; i<t.size(); i++)
188 virtual void print(std::ostream &output)
const
192 for(
size_t i=0; i<t.size(); i++)
193 output << i <<
" = " << t[i] <<
"\n";
198 std::stringstream ss;
Definition: smart_pointer.h:108
Definition: ivector.h:148
const TVec & downcast() const
Definition: ivector.h:154
TVec & downcast()
Definition: ivector.h:150
virtual void vec_add(double a1, double a2, const IVector &iv2, double a3, const IVector &iv3, double a4, const IVector &iv4)
Definition: ivector.h:167
virtual void vec_add(double a1, double a2, const IVector &iv2)
Definition: ivector.h:159
virtual void set(double d)
Definition: ivector.h:181
friend std::ostream & operator<<(std::ostream &output, const this_type &v)
Definition: ivector.h:203
virtual void print(std::ostream &output) const
Definition: ivector.h:188
virtual std::string short_desc() const
Definition: ivector.h:196
virtual double vec_prod(const IVector &iv) const
Definition: ivector.h:171
virtual double norm2() const
Definition: ivector.h:176
IVector_AlgebraDownCastTo< TVec > this_type
Definition: ivector.h:149
virtual void vec_add(double a1, double a2, const IVector &iv2, double a3, const IVector &iv3)
Definition: ivector.h:163
virtual void set(double d)=0
virtual void print(std::ostream &output) const =0
double norm() const
Definition: ivector.h:95
virtual SmartPtr< IVector > clone() const =0
clones the vector (deep-copy) including values
virtual size_t capacity() const =0
virtual SmartPtr< IVector > clone_without_values(size_t size) const =0
clones the vector (deep-copy) excluding values
void operator-=(const IVector &v)
Definition: ivector.h:105
virtual void vec_add(double a1, double a2, const IVector &iv2)=0
virtual double norm2() const =0
const T & downcast() const
Definition: ivector.h:87
virtual void vec_add(double a1, double a2, const IVector &iv2, double a3, const IVector &iv3, double a4, const IVector &iv4)=0
virtual double vec_prod(const IVector &v) const =0
virtual std::string short_desc() const =0
void operator*=(double alpha)
Definition: ivector.h:110
virtual void resize(size_t newSize, bool bCopyValues=true)=0
void operator=(const IVector &v)
Definition: ivector.h:97
virtual size_t size() const =0
virtual void vec_add(double a1, double a2, const IVector &iv2, double a3, const IVector &iv3)=0
void operator+=(const IVector &v)
Definition: ivector.h:101
T & downcast()
Definition: ivector.h:80
const T & v1
Definition: te.h:109
double a1
Definition: te.h:108
double a2
Definition: te.h:110
const T & v2
Definition: te.h:111
const T & v3
Definition: te.h:126
double a2
Definition: te.h:123
double a3
Definition: te.h:125
const T & v1
Definition: te.h:122
const T & v2
Definition: te.h:124
double a1
Definition: te.h:121
double scaling() const
Definition: te.h:63
const T & vec() const
Definition: te.h:64
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
void VecAdd(vector_t &vOut, const vector_t &v1, const vector_t &v2)
adds two MathVector<N>s and stores the result in a third one
Definition: math_vector_functions_common_impl.hpp:185
double VecNorm2(const IVector &v1)
Definition: ivector_vec_functions.h:85
double VecProd(const double &a, const double &b)
returns scal<a, b>
Definition: operations_vec.h:84
std::string TypeName(const T &t)
Definition: typename.h:40