14 #ifndef OHMMS_TINYVECTOR_H 15 #define OHMMS_TINYVECTOR_H 50 template<
class T,
unsigned D>
63 for (
size_t d = 0; d < D; ++d)
77 for (
size_t d = 0; d < D; ++d)
84 for (
size_t d = 0; d < D; ++d)
94 inline TinyVector(
const T& x00,
const T& x01,
const T& x02)
100 inline TinyVector(
const T& x00,
const T& x01,
const T& x02,
const T& x03)
111 for (
int i = 0; i < D; ++i)
112 X[i] = base[i * offset];
115 inline int size()
const {
return D; }
123 for (
size_t d = 0; d < D; ++d)
130 for (
size_t d = 0; d < D; ++d)
148 for (
size_t d = 0; d < D; ++d)
156 for (
int i = 0; i < D; ++i)
158 if ((*
this)[i] != that[i])
166 for (
int i = 0; i < D; ++i)
168 if ((*
this)[i] == that[i])
189 template<
class T1,
class T2,
unsigned D>
199 template<
class T1,
class T2,
unsigned D>
210 template<
class T1,
class T2,
unsigned D>
228 template<
class T,
unsigned D>
233 for (
int d = 0; d < D; d++)
235 os << std::setw(18) << std::setprecision(10) << r[d];
237 if (FP_ZERO == std::fpclassify(r[d]))
238 os << std::setw(18) << std::setprecision(10) << 0;
240 os << std::setw(18) << std::setprecision(10) << r[d];
246 template<
class T,
unsigned D>
247 std::ostream& operator<<(std::ostream& out, const TinyVector<T, D>& rhs)
253 template<
class T,
unsigned D>
257 for (
int i = 0; i < D; i++)
263 #endif // OHMMS_TINYVECTOR_H TinyVector & operator=(const TinyVector &rhs)=default
typename Promote< T1, T2 >::Type_t Type_t
helper functions for EinsplineSetBuilder
void print(OptimizableFunctorBase &func, std::ostream &os, double extent)
evaluates a functor (value and derivative) and dumps the quantities to output
bool operator!=(const TinyVector< T, D > &that) const
TinyVector(const T *restrict base, int offset)
const Type_t * end() const
TinyVector(const T &x00, const T &x01, const T &x02)
const Type_t & operator[](unsigned int i) const
Tensor<T,D> class for D by D tensor.
TinyVector< T, D > & operator=(const TinyVector< T1, D > &rhs)
TinyVector(const T &x00, const T &x01)
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > outerProduct(const TinyVector< T1, D > &lhs, const TinyVector< T2, D > &rhs)
TinyVector< T, D > & operator=(const T &rhs)
const Type_t * data() const
TinyVector operator-() const
bool operator==(const TinyVector< T, D > &that) const
#define OHMMS_META_BINARY_OPERATORS(TENT, FUNC, TAG)
Type_t & operator[](unsigned int i)
TinyVector< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > cross(const TinyVector< T1, D > &lhs, const TinyVector< T2, D > &rhs)
const Type_t * begin() const
static void print(std::ostream &os, const TinyVector< T, D > &r)
Tensor< T, D > inverse(const Tensor< T, D > &a)
TinyVector(const TinyVector< T1, D > &rhs)
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
#define OHMMS_META_ACCUM_OPERATORS(TENT, FUNC, TAG)
std::is_floating_point< T > IsReal_t
std::istream & operator>>(std::istream &is, Matrix< T, Alloc > &rhs)
TinyVector(const T &x00, const T &x01, const T &x02, const T &x03)