9 template<
class Real,
int Options>
15 namespace vec {
namespace priv
17 template<
class Real, szt Align>
20 operator Real()
const {
return x; }
25 namespace matrix {
namespace priv
27 template<
class R,
int O>
29 template<
class R,
int O>
32 template<
class R,
int O>
34 template<
class R,
int O>
37 template<
class R,
int O>
42 template<
class Real,
int Options>
48 using Super::operator*;
49 using Super::operator*=;
50 using Super::operator/;
51 using Super::operator/=;
82 static const Vec axis[1];
91 template<
class R,
int Opt>
94 struct priv::map_impl<Vec<1,R,Opt>, Vec<1,R,Opt>>
96 template<
class T,
class O,
class Func>
97 static O&& func(T&& v, O&& o, Func&& f) { o.x = f(v.x);
return forward<O>(o); }
100 template<
class R,
int Opt>
101 struct priv::map_impl<Vec<1,R,Opt>, Vec<1,R,Opt>, Vec<1,R,Opt>>
103 template<
class T,
class T2,
class O,
class Func>
104 static O&& func(T&& v, T2&& rhs, O&& o, Func&& f) { o.x = f(v.x,rhs.x);
return forward<O>(o); }
107 template<
class R,
int O,
class Accum_>
108 struct priv::reduce_impl<Vec<1,R,O>, Accum_>
110 template<
class T,
class Accum,
class Func>
111 static Accum_ func(T&& v, Accum&& initVal, Func&& f) {
return f(forward<Accum>(initVal), v.x); }
114 template<
class R,
int O,
class Accum_>
115 struct priv::reduce_impl<Vec<1,R,O>, Accum_, Vec<1,R,O>>
117 template<
class T,
class T2,
class Accum,
class Func>
118 static Accum_ func(T&& v, T2&& rhs, Accum&& initVal, Func&& f) {
return f(forward<Accum>(initVal), v.x, rhs.x); }
130 template<
class Real,
int Options>
(m x n)-dimensional matrix
Definition: Matrix.h:24
Automatic (stack-compatible) vector storage that allows direct access to dimension fields...
Definition: Storage.h:13
VecBase & operator=(const MatrixBase< T > &rhs)
Assign to row or column vector of any dimension. Asserts that if this vector has a fixed dimension th...
Definition: Base.h:35
void storageFillZero(StorageBlock< T > &store)
Fill block storage with zeros.
Definition: Block.h:136
N-dimensional vector traits.
Definition: Vec.h:14
Real dot(const VecBase< T > &v) const
Vector dot product.
Definition: Base.h:91
bool storageEqual(const StorageBlock< T > &lhs, const StorageBlock< T2 > &rhs)
Test between block storages.
Definition: Block.h:157
static const Vec one
Definition: Vec1.h:80
Vec(Real x)
Definition: Vec1.h:56
Vec< 1, Float > Vec1_f
Definition: Vec1.h:125
static const Vec zero
Definition: Vec1.h:79
Vec< 1, Double > Vec1_d
Definition: Vec1.h:126
Real lengthSqr() const
Definition: Vec1.h:73
Real dot(const Vec &v) const
Definition: Vec1.h:75
Vec< 1 > Vec1
1D vector types
Definition: Vec1.h:124
Real x
Definition: Vec1.h:21
Vec operator*(int rhs) const
Implicit conversion to real causes ambiguity with int.
Definition: Vec1.h:65
Real length() const
Definition: Vec1.h:74
MatrixS operator/(Real rhs) const
Definition: Base.h:184
Real Real
Definition: Vec.h:17
N-dimensional vector.
Definition: Traits.h:12
Vec()
No init.
Definition: Vec1.h:55
friend Vec operator*(int lhs, const Vec &rhs)
Definition: Vec1.h:69
Vec & operator*=(int rhs)
Definition: Vec1.h:66
float Real
Real number type. See Real_ for real number operations and constants.
Definition: Real.h:21
Vector base class.
Definition: Base.h:11
Vec & operator=(const MatrixBase< T > &rhs)
Assign to row or column vector of any dimension. Asserts that if this vector has a fixed dimension th...
Definition: Vec.h:56
void storageFill(StorageBlock< T > &store, typename StorageBlock< T >::Real f)
Fill block storage with scalar.
Definition: Block.h:128
Vec operator/(int rhs) const
Definition: Vec1.h:67
Matrix< s_rows, T::s_cols, Real > operator*(const T &rhs) const
Multiply with another matrix. Returns a new matrix.
Definition: Base.h:178
1D vector
Definition: Vec1.h:43
Vec(const MatrixBase< T > &rhs)
Construct from vector of same dimension.
Definition: Vec1.h:59
void storageCopy(const StorageBlock< Src > &src, StorageBlock< Dst > &dst)
Copy between block and dense storages.
Definition: Block.h:84
static const Vec axisX
Definition: Vec1.h:81
#define MATRIX_VEC_ADAPTER
It's not possible to inherit ctors, so this macro is required.
Definition: Vec.h:71
Matrix base class.
Definition: Base.h:17
Vec & operator=(const MatrixBase< T > &rhs)
Definition: Vec1.h:62
Global Honeycomb namespace.
Vec & operator/=(int rhs)
Definition: Vec1.h:68
vec::priv::StorageFields< Vec< 1, Real, Options > > Storage
Definition: Vec1.h:12