9template<dim_t L,
typename T>
41 template<
typename ... Vs,
typename std::enable_if<(
sizeof...(Vs) == L) || (
sizeof...(Vs) == 0)>::type* =
nullptr>
45 template<
typename U,
typename ...,
typename std::enable_if<std::is_convertible<U, T>::value && (L > 1)>::type * =
nullptr>
50 template<
typename U,
typename ...,
typename std::enable_if<std::is_convertible<U, T>::value>::type* =
nullptr>
110 return operator+=<T>(rhs);
128 return operator-=<T>(rhs);
146 return operator*=<T>(rhs);
164 return operator/=<T>(rhs);
167 template<
typename ...,
typename V = T>
168 typename std::enable_if<std::is_floating_point<V>::value, V>::type
length()
const {
169 const auto& v = *
this;
170 return std::sqrt((v * v).
sum());
173 template<
typename ...,
typename V = T>
174 typename std::enable_if<std::is_floating_point<V>::value,
vec&>::type
normalize() {
194template<dim_t L,
typename T>
197 lhs.
apply([&equal, &rhs](
const T& v,
dim_t i) {
198 equal = equal && (v == rhs[i]);
203template<dim_t L,
typename T>
205 return !(lhs == rhs);
208template<dim_t L,
typename T>
213template<dim_t L,
typename T>
218template<dim_t L,
typename T,
typename U>
223template<dim_t L,
typename T,
typename U>
228template<dim_t L,
typename T,
typename U>
233template<dim_t L,
typename T,
typename U>
238template<dim_t L,
typename T,
typename U>
243template<dim_t L,
typename T,
typename U>
248template<dim_t L,
typename T,
typename U>
253template<dim_t L,
typename T,
typename U>
258template<dim_t L,
typename T,
typename U>
263template<dim_t L,
typename T,
typename U>
268template<dim_t L,
typename T,
typename U>
273template<dim_t L,
typename T,
typename U>
void copy(const TSource &source, TDestination &destination)
Definition: utils/Extd.h:123
Definition: Computations.h:19
std::size_t dim_t
Definition: Types.h:22
bool operator!=(const mat< R, C, T > &lhs, const mat< R, C, T > &rhs)
Definition: Mat.h:285
bool operator==(const mat< R, C, T > &lhs, const mat< R, C, T > &rhs)
Definition: Mat.h:275
mat< R, C, T > operator*(const mat< R, C, T > &lhs, T rhs)
Definition: Mat.h:332
mat< R, C, T > operator/(const mat< R, C, T > &lhs, T rhs)
Definition: Mat.h:373
mat< R, C, T > operator-(const mat< R, C, T > &m)
Definition: Mat.h:295
mat< R, C, T > operator+(const mat< R, C, T > &m)
Definition: Mat.h:290
static constexpr dim_t dimensions()
Definition: Vec.h:13
vec(Vs... vs)
Definition: Vec.h:42
vec & apply(F func)
Definition: Vec.h:68
vec & operator/=(const vec &rhs)
Definition: Vec.h:163
vec & operator/=(U rhs)
Definition: Vec.h:150
std::enable_if< std::is_floating_point< V >::value, V >::type length() const
Definition: Vec.h:168
vec(U *pv)
Definition: Vec.h:51
T value_type
Definition: Vec.h:11
vec & negate()
Definition: Vec.h:178
T & operator[](dim_t index)
Definition: Vec.h:55
vec & operator-=(const vec< L, U > &rhs)
Definition: Vec.h:121
vec & operator--()
Definition: Vec.h:89
vec & operator=(vec &&rhs)=default
vec & operator*=(const vec< L, U > &rhs)
Definition: Vec.h:139
vec(const vec &rhs)=default
vec & operator/=(const vec< L, U > &rhs)
Definition: Vec.h:157
vec & operator-=(const vec &rhs)
Definition: Vec.h:127
vec & operator+=(const vec< L, U > &rhs)
Definition: Vec.h:103
vec & operator*=(const vec &rhs)
Definition: Vec.h:145
vec & operator++()
Definition: Vec.h:83
vec(U v)
Definition: Vec.h:46
const vec & apply(F func) const
Definition: Vec.h:76
vec & operator=(const vec< L, U > &rhs)
Definition: Vec.h:36
vec & operator-=(U rhs)
Definition: Vec.h:114
vec & operator*=(U rhs)
Definition: Vec.h:132
vec()
Definition: Vec.h:19
vec & operator=(const vec &rhs)=default
std::enable_if< std::is_floating_point< V >::value, vec & >::type normalize()
Definition: Vec.h:174
T sum() const
Definition: Vec.h:184
vec & operator+=(U rhs)
Definition: Vec.h:96
vec & operator+=(const vec &rhs)
Definition: Vec.h:109
vec(const vec< L, U > &rhs)
Definition: Vec.h:31
const T & operator[](dim_t index) const
Definition: Vec.h:60
value_type values[L]
Definition: Vec.h:17