30 template<
class T,
unsigned D>
50 template<
class T1,
unsigned D1>
52 for (
unsigned d=0; d<D; ++d)
53 X[d] = (d < D1) ? rhs[d] : T1(0);
63 PInsist(D==2,
"Number of arguments does not match Vektor dimension!!");
69 PInsist(D==3,
"Number of arguments does not match Vektor dimension!!");
75 Vektor(
const T& x00,
const T& x01,
const T& x02,
const T& x03) {
76 PInsist(D==4,
"Number of arguments does not match Vektor dimension!!");
169 return !(*
this == that);
192 template<
class T,
unsigned D>
199 template<
class T,
unsigned D>
206 template<
class T,
unsigned D>
213 template<
class T,
unsigned D>
228 template<
class T,
unsigned D>
236 template<
class T,
unsigned D>
263 template < class T1, class T2,
unsigned D >
265 dot(const Vektor<T1,D> &lhs, const Vektor<T2,D> &rhs)
274 template <
class T1,
class T2,
unsigned D >
284 template <
class T,
unsigned D >
294 template<
class T,
unsigned D>
295 inline std::ostream& operator<<(std::ostream& out, const Vektor<T,D>& rhs)
297 std::streamsize sw = out.width();
301 for (
unsigned int i=0; i<D - 1; i++)
302 out << std::setw(sw) << rhs[i] <<
" , ";
303 out << std::setw(sw) << rhs[D - 1] <<
" )";
305 out <<
"( " << std::setw(sw) << rhs[0] <<
" )";
Tps< T > sqrt(const Tps< T > &x)
Square root.
Element_t & operator()(unsigned int i)
#define TSV_ELEMENTWISE_OPERATOR(TSV, OP, APP)
double Min(double a, double b)
Vektor< T, D > & operator+=(const Vektor< T1, D > &rhs)
Vektor< T, D > & operator-=(const T &rhs)
Element_t & operator[](unsigned int i)
Matrix< T > operator-(const Matrix< T > &, const Matrix< T > &)
Matrix subtraction.
Vektor(const T &x00, const T &x01)
Vektor(const Vektor< T, D > &rhs)
Message & getMessage(Message &m)
Vektor< T, D > & operator-=(const Vektor< T1, D > &rhs)
const Vektor< T, D > & operator=(const T &rhs)
Vektor(const T &x00, const T &x01, const T &x02)
Vektor< T, D > & operator*=(const T &rhs)
Message & setCopy(const bool c)
T euclidean_norm(const Vector< T > &)
Euclidean norm.
Vektor< T, D > & operator/=(const T &rhs)
double Max(double a, double b)
Vector3D cross(const Vector3D &lhs, const Vector3D &rhs)
Vector cross product.
Vektor(const Vektor< T1, D1 > &rhs)
const Vektor< T, D > & operator=(const Vektor< T1, D > &rhs)
Matrix< T > operator+(const Matrix< T > &, const Matrix< T > &)
Matrix addition.
Vektor(const T &x00, const T &x01, const T &x02, const T &x03)
Message & putMessage(Message &m) const
static bool apply(const T1 *lhs, const T2 *rhs)
Vektor< T, D > & operator+=(const T &rhs)
bool operator==(const Vektor< T, D > &that) const
const Vektor< T, D > & operator=(const Vektor< T, D > &rhs)
Vektor< T, D > & operator*=(const Vektor< T1, D > &rhs)
Vektor< T, D > & operator/=(const Vektor< T1, D > &rhs)
bool operator!=(const Vektor< T, D > &that) const
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.