74 #ifndef SLIP_VECTOR4D_HPP
75 #define SLIP_VECTOR4D_HPP
87 #include <boost/serialization/access.hpp>
88 #include <boost/serialization/split_member.hpp>
89 #include <boost/serialization/version.hpp>
99 bool operator<(const Vector4d<T>& x,
const Vector4d<T>& y);
101 template <
typename T>
104 template <
typename T>
105 bool operator<=(const Vector4d<T>& x,
const Vector4d<T>& y);
107 template <
typename T>
123 template <
typename T>
255 const T&
get_x()
const;
271 const T&
get_y()
const;
288 const T&
get_z()
const;
304 const T&
get_t()
const;
320 void set_x(
const T& r);
337 void set_y(
const T& g);
353 void set_z(
const T& r);
369 void set_t(
const T& s);
384 void set(
const T& x1,
397 std::string
name()
const;
401 template<
class Archive>
402 void save(Archive & ar,
const unsigned int version)
const
404 ar & boost::serialization::base_object<slip::kvector<T,4> >(*this);
406 template<
class Archive>
407 void load(Archive & ar,
const unsigned int version)
409 ar & boost::serialization::base_object<slip::kvector<T,4> >(*this);
411 BOOST_SERIALIZATION_SPLIT_MEMBER()
489 tmp[0] = -(*this)[0];
490 tmp[1] = -(*this)[1];
491 tmp[2] = -(*this)[2];
492 tmp[3] = -(*this)[3];
499 bool operator<(const Vector4d<T>& x,
502 return (slip::Euclidean_norm<T>(x.begin(),x.end())
503 < slip::Euclidean_norm<T>(y.begin(),y.end())
519 bool operator<=(const Vector4d<T>& x,
659 tmp[0] = V1[0] + V2[0];
660 tmp[1] = V1[1] + V2[1];
661 tmp[2] = V1[2] + V2[2];
662 tmp[3] = V1[3] + V2[3];
690 tmp[0] = V1[0] - V2[0];
691 tmp[1] = V1[1] - V2[1];
692 tmp[2] = V1[2] - V2[2];
693 tmp[3] = V1[3] - V2[3];
713 tmp[0] = val - V1[0];
714 tmp[1] = val - V1[1];
715 tmp[2] = val - V1[2];
716 tmp[3] = val - V1[3];
727 tmp[0] = V1[0] * V2[0];
728 tmp[1] = V1[1] * V2[1];
729 tmp[2] = V1[2] * V2[2];
730 tmp[2] = V1[3] * V2[3];
758 tmp[0] = V1[0] / V2[0];
759 tmp[1] = V1[1] / V2[1];
760 tmp[2] = V1[2] / V2[2];
761 tmp[3] = V1[3] / V2[3];
783 #endif //SLIP_VECTOR4D_HPP
const T & get_x4() const
Accessor to the fourth dimension value of the Vector4d.
void set_x(const T &r)
Mutator of the first dimension value of the Vector4d.
const T & get_x3() const
Accessor to the third dimension value of the Vector4d.
void set_x2(const T &x2)
Mutator of the second dimension value of the Vector4d.
const_pointer const_iterator
This is a linear (one-dimensional) static vector. This container statisfies the RandomAccessContainer...
slip::Vector4d< float > Vector4d_f
float alias
void set_z(const T &r)
Mutator of the third dimension value of the Vector4d.
std::string name() const
Returns the name of the class.
slip::Vector4d< unsigned long > Vector4d_ul
unsigned long alias
const T & v() const
Accessor to the second dimension value of the Vector4d.
Color< T > operator+(const Color< T > &V1, const Color< T > &V2)
slip::Vector4d< char > Vector4d_c
char alias
void set_x1(const T &x1)
Mutator of the first dimension value of the Vector4d.
const T & get_x1() const
Accessor to the first dimension value of the Vector4d.
ptrdiff_t difference_type
slip::Vector4d< unsigned short > Vector4d_us
unsigned long alias
slip::Vector4d< unsigned char > Vector4d_uc
unsigned char alias
bool operator>(const Array< T > &x, const Array< T > &y)
const T & u() const
Accessor to the first dimension value of the Vector4d.
const value_type & const_reference
void set_x3(const T &x3)
Mutator of the third dimension value of the Vector4d.
Provides a class to manipulate static and generic vectors.
const T & w() const
Accessor to the third dimension value of the Vector4d.
const value_type * const_pointer
const T & get_x2() const
Accessor to the second dimension value of the Vector4d.
Vector4d()
Default constructor init all the components to 0.
slip::Vector4d< short > Vector4d_s
short alias
void set_y(const T &g)
Mutator of the second dimension value of the Vector4d.
slip::Vector4d< double > Vector4d_d
double alias
void set(const T &x1, const T &x2, const T &x3, const T &x4)
Mutator of the three dimension values of the Vector4d.
This is a Vector4d struct. It is a specialization of kvector. It implements some specific 4d operatio...
friend class boost::serialization::access
const T & get_y() const
Accessor to the second dimension value of the Vector4d.
void set_x4(const T &x4)
Mutator of the fourth dimension value of the Vector4d.
void set_t(const T &s)
Mutator of the fourth dimension value of the Vector4d.
slip::Vector4d< long > Vector4d_l
long alias
slip::Vector4d< int > Vector4d_i
int alias
const T & t() const
Accessor to the fourth dimension value of the Vector4d.
const T & get_x() const
Accessor to the first dimension value of the Vector4d.
const T & get_z() const
Accessor to the third dimension value of the Vector4d.
Color< T > operator*(const Color< T > &V1, const Color< T > &V2)
Color< T > operator/(const Color< T > &V1, const Color< T > &V2)
bool operator>=(const Array< T > &x, const Array< T > &y)
slip::Vector4d< unsigned int > Vector4d_ui
unsigned int alias
Color< T > operator-(const Color< T > &V1, const Color< T > &V2)
const T & get_t() const
Accessor to the fourth dimension value of the Vector4d.
Provides some algorithms to compute norms.