/** \file NXVector.h * \brief Implements point-vector classes using expression templates */ #ifndef NX_VECTOR_H #define NX_VECTOR_H #include "Nanorex/Utility/NXUtility.h" #include #include #include namespace Nanorex { // forward declarations for usable types template class NXVectorRef; template class NXVector; static double const NX_DEFAULTTOL = 1.0e-6; template struct promotion_traits; template struct promotion_traits { typedef T type; }; template<> struct promotion_traits { typedef double type; }; template<> struct promotion_traits { typedef double type; }; template<> struct promotion_traits { typedef long double type; }; template<> struct promotion_traits { typedef long double type; }; template<> struct promotion_traits { typedef long double type; }; template<> struct promotion_traits { typedef long double type; }; /* CLASS: NXVectorBase */ template class NXVectorDerived> class NXVectorBase { public: typedef T value_type; typedef NXVectorBase baseclass_type; typedef NXVectorDerived subclass_type; private: typedef NXVectorBase self_type; public: NXVectorBase() {} ~NXVectorBase() {} // shallow or deep copy as per the implementation template