DNA Calib 1.1
Project brief
Namespaces | Classes | Typedefs | Enumerations | Functions
tdm Namespace Reference

Namespaces

namespace  affine
 
namespace  impl
 
namespace  projective
 

Classes

struct  axis_angle
 
struct  mat
 
struct  vec
 

Typedefs

using dim_t = std::size_t
 
template<typename T >
using vec2 = vec< 2, T >
 
template<typename T >
using vec3 = vec< 3, T >
 
template<typename T >
using vec4 = vec< 4, T >
 
template<dim_t L>
using ivec = vec< L, int >
 
using ivec2 = ivec< 2 >
 
using ivec3 = ivec< 3 >
 
using ivec4 = ivec< 4 >
 
template<dim_t L>
using fvec = vec< L, float >
 
using fvec2 = fvec< 2 >
 
using fvec3 = fvec< 3 >
 
using fvec4 = fvec< 4 >
 
template<typename T >
using mat2 = mat< 2, 2, T >
 
template<typename T >
using mat3 = mat< 3, 3, T >
 
template<typename T >
using mat4 = mat< 4, 4, T >
 
template<dim_t R, dim_t C>
using imat = mat< R, C, int >
 
using imat2 = imat< 2, 2 >
 
using imat3 = imat< 3, 3 >
 
using imat4 = imat< 4, 4 >
 
template<dim_t R, dim_t C>
using fmat = mat< R, C, float >
 
using fmat2 = fmat< 2, 2 >
 
using fmat3 = fmat< 3, 3 >
 
using fmat4 = fmat< 4, 4 >
 

Enumerations

enum class  handedness { left = -1 , right = 1 }
 

Functions

template<typename T >
vec3< T > cross (const vec3< T > &lhs, const vec3< T > &rhs)
 
template<dim_t L, typename T >
dot (const vec< L, T > &lhs, const vec< L, T > &rhs)
 
template<dim_t L, typename T >
vec< L, T > negate (vec< L, T > v)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > negate (const mat< R, C, T > &m)
 
template<dim_t L, typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type length (const vec< L, T > &v)
 
template<dim_t L, typename T >
std::enable_if< std::is_floating_point< T >::value, vec< L, T > >::type normalize (vec< L, T > v)
 
template<dim_t R, dim_t C, typename T >
mat< C, R, T > transpose (const mat< R, C, T > &m)
 
template<dim_t N, typename T >
determinant (const mat< N, N, T > &m)
 
template<dim_t N, typename T >
mat< N, N, T > inverse (const mat< N, N, T > &m)
 
template<dim_t N, typename T >
trace (const mat< N, N, T > &m)
 
template<dim_t R, dim_t C, typename T >
bool operator== (const mat< R, C, T > &lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
bool operator!= (const mat< R, C, T > &lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator+ (const mat< R, C, T > &m)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator- (const mat< R, C, T > &m)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator+ (const mat< R, C, T > &lhs, T rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator+ (T lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator+ (const mat< R, C, T > &lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator- (const mat< R, C, T > &lhs, T rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator- (T lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator- (const mat< R, C, T > &lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator* (const mat< R, C, T > &lhs, T rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator* (T lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T >::row_type operator* (const typename mat< R, C, T >::column_type &lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T >::column_type operator* (const mat< R, C, T > &lhs, const typename mat< R, C, T >::row_type &rhs)
 
template<dim_t R, dim_t S, dim_t C, typename T >
mat< R, C, T > operator* (const mat< R, S, T > &lhs, const mat< S, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator/ (const mat< R, C, T > &lhs, T rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator/ (T lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T >::row_type operator/ (const typename mat< R, C, T >::column_type &lhs, const mat< R, C, T > &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T >::column_type operator/ (const mat< R, C, T > &lhs, const typename mat< R, C, T >::row_type &rhs)
 
template<dim_t R, dim_t C, typename T >
mat< R, C, T > operator/ (const mat< R, C, T > &lhs, const mat< R, C, T > &rhs)
 
constexpr double pi ()
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type degrees (T radians)
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type radians (T degrees)
 
template<typename T >
mat4< T > rotate (const vec3< T > &axis, T radians, handedness h=handedness::right)
 
template<typename T >
mat4< T > rotate (const mat4< T > &m, const vec3< T > &axis, T radians, handedness h=handedness::right)
 
template<typename T >
mat4< T > rotate (T xRadians, T yRadians, T zRadians, handedness h=handedness::right)
 
template<typename T >
mat4< T > rotate (const mat4< T > &m, T xRadians, T yRadians, T zRadians, handedness h=handedness::right)
 
template<typename T >
mat4< T > rotate (const vec3< T > &radians, handedness h=handedness::right)
 
template<typename T >
mat4< T > rotate (const mat4< T > &m, const vec3< T > &radians, handedness h=handedness::right)
 
template<dim_t L, typename T >
mat< L+1, L+1, T > scale (const vec< L, T > &factors)
 
template<dim_t L, typename T >
mat< L+1, L+1, T > scale (const mat< L+1, L+1, T > &m, const vec< L, T > &factors)
 
template<dim_t L, typename T >
mat< L+1, L+1, T > scale (T factor)
 
template<dim_t L, typename T >
mat< L, L, T > scale (const mat< L, L, T > &m, T factor)
 
template<dim_t L, typename T >
mat< L+1, L+1, T > translate (const vec< L, T > &position)
 
template<dim_t L, typename T >
mat< L+1, L+1, T > translate (const mat< L+1, L+1, T > &m, const vec< L, T > &position)
 
template<typename T >
axis_angle< T > xyz2AxisAngle (T xRadians, T yRadians, T zRadians, handedness h=handedness::right)
 
template<typename T >
axis_angle< T > xyz2AxisAngle (const vec3< T > &radians, handedness h=handedness::right)
 
template<dim_t L, typename T >
bool operator== (const vec< L, T > &lhs, const vec< L, T > &rhs)
 
template<dim_t L, typename T >
bool operator!= (const vec< L, T > &lhs, const vec< L, T > &rhs)
 
template<dim_t L, typename T >
vec< L, T > operator+ (const vec< L, T > &v)
 
template<dim_t L, typename T >
vec< L, T > operator- (vec< L, T > v)
 
template<dim_t L, typename T , typename U >
vec< L, T > operator+ (const vec< L, T > &lhs, const vec< L, U > &rhs)
 
template<dim_t L, typename T , typename U >
vec< L, T > operator+ (const vec< L, T > &lhs, U rhs)
 
template<dim_t L, typename T , typename U >
vec< L, T > operator+ (T lhs, const vec< L, U > &rhs)
 
template<dim_t L, typename T , typename U >
vec< L, T > operator- (const vec< L, T > &lhs, const vec< L, U > &rhs)
 
template<dim_t L, typename T , typename U >
vec< L, T > operator- (const vec< L, T > &lhs, U rhs)
 
template<dim_t L, typename T , typename U >
vec< L, T > operator- (T lhs, const vec< L, U > &rhs)
 
template<dim_t L, typename T , typename U >
vec< L, T > operator* (const vec< L, T > &lhs, const vec< L, U > &rhs)
 
template<dim_t L, typename T , typename U >
std::enable_if< std::is_arithmetic< U >::value, vec< L, T > >::type operator* (const vec< L, T > &lhs, U rhs)
 
template<dim_t L, typename T , typename U >
std::enable_if< std::is_arithmetic< T >::value, vec< L, T > >::type operator* (T lhs, const vec< L, U > &rhs)
 
template<dim_t L, typename T , typename U >
vec< L, T > operator/ (const vec< L, T > &lhs, const vec< L, U > &rhs)
 
template<dim_t L, typename T , typename U >
std::enable_if< std::is_arithmetic< U >::value, vec< L, T > >::type operator/ (const vec< L, T > &lhs, U rhs)
 
template<dim_t L, typename T , typename U >
std::enable_if< std::is_arithmetic< T >::value, vec< L, T > >::type operator/ (T lhs, const vec< L, U > &rhs)
 

Typedef Documentation

◆ dim_t

using tdm::dim_t = typedef std::size_t

◆ fmat

template<dim_t R, dim_t C>
using tdm::fmat = typedef mat<R, C, float>

◆ fmat2

using tdm::fmat2 = typedef fmat<2, 2>

◆ fmat3

using tdm::fmat3 = typedef fmat<3, 3>

◆ fmat4

using tdm::fmat4 = typedef fmat<4, 4>

◆ fvec

template<dim_t L>
using tdm::fvec = typedef vec<L, float>

◆ fvec2

using tdm::fvec2 = typedef fvec<2>

◆ fvec3

using tdm::fvec3 = typedef fvec<3>

◆ fvec4

using tdm::fvec4 = typedef fvec<4>

◆ imat

template<dim_t R, dim_t C>
using tdm::imat = typedef mat<R, C, int>

◆ imat2

using tdm::imat2 = typedef imat<2, 2>

◆ imat3

using tdm::imat3 = typedef imat<3, 3>

◆ imat4

using tdm::imat4 = typedef imat<4, 4>

◆ ivec

template<dim_t L>
using tdm::ivec = typedef vec<L, int>

◆ ivec2

using tdm::ivec2 = typedef ivec<2>

◆ ivec3

using tdm::ivec3 = typedef ivec<3>

◆ ivec4

using tdm::ivec4 = typedef ivec<4>

◆ mat2

template<typename T >
using tdm::mat2 = typedef mat<2, 2, T>

◆ mat3

template<typename T >
using tdm::mat3 = typedef mat<3, 3, T>

◆ mat4

template<typename T >
using tdm::mat4 = typedef mat<4, 4, T>

◆ vec2

template<typename T >
using tdm::vec2 = typedef vec<2, T>

◆ vec3

template<typename T >
using tdm::vec3 = typedef vec<3, T>

◆ vec4

template<typename T >
using tdm::vec4 = typedef vec<4, T>

Enumeration Type Documentation

◆ handedness

enum class tdm::handedness
strong
Enumerator
left 
right 
84 {
85 left = -1,
86 right = 1
87};

Function Documentation

◆ cross()

template<typename T >
vec3< T > tdm::cross ( const vec3< T > &  lhs,
const vec3< T > &  rhs 
)
inline
22 {
23 return vec3<T>{
24 lhs[1] * rhs[2] - lhs[2] * rhs[1],
25 lhs[2] * rhs[0] - lhs[0] * rhs[2],
26 lhs[0] * rhs[1] - lhs[1] * rhs[0]
27 };
28}
Definition: Vec.h:10

◆ degrees()

template<typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type tdm::degrees ( radians)
inline
15 {
16 static constexpr const auto c = static_cast<T>(180.0 / pi());
17 return c * radians;
18}
std::enable_if< std::is_floating_point< T >::value, T >::type radians(T degrees)
Definition: Transforms.h:21
constexpr double pi()
Definition: Transforms.h:10

References pi(), and radians().

Referenced by radians(), dnac::RotateCommand::RotateCommand(), dnac::RotateCommand::Impl::rotateNeutralJoints(), and dnac::RotateCommand::setRotation().

◆ determinant()

template<dim_t N, typename T >
T tdm::determinant ( const mat< N, N, T > &  m)
inline
129 {
130 return impl::determinant(m, N);
131}
T determinant(const mat< N, N, T > &m)
Definition: Computations.h:129

References tdm::impl::determinant().

Referenced by inverse().

◆ dot()

template<dim_t L, typename T >
T tdm::dot ( const vec< L, T > &  lhs,
const vec< L, T > &  rhs 
)
inline
31 {
32 return (lhs * rhs).sum();
33}

Referenced by dnac::Triangle::getBarycentricCoords().

◆ inverse()

template<dim_t N, typename T >
mat< N, N, T > tdm::inverse ( const mat< N, N, T > &  m)
inline
134 {
135 T det = determinant(m);
136 if (det == T{}) {
137 return {};
138 }
139
140 mat<N, N, T> adj = impl::adjoint(m);
141 mat<N, N, T> inv;
142 for (dim_t row{}; row < m.rows(); ++row) {
143 for (dim_t col{}; col < m.columns(); ++col) {
144 inv(row, col) = adj(row, col) / det;
145 }
146 }
147 return inv;
148}
mat< N, N, T > adjoint(const mat< N, N, T > &m)
Definition: Computations.h:107
std::size_t dim_t
Definition: Types.h:22

References tdm::impl::adjoint(), and determinant().

Referenced by dnac::extractRotationMatrix(), operator/(), and tdm::mat< R, C, T >::operator/=().

◆ length()

template<dim_t L, typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type tdm::length ( const vec< L, T > &  v)
inline
46 {
47 return v.length();
48}
std::enable_if< std::is_floating_point< V >::value, V >::type length() const
Definition: Vec.h:168

References tdm::vec< L, T >::length().

Referenced by trio::StringConverter< wchar_t >::from(), and dnac::CalculateMeshLowerLODsCommand::Impl::getMeshName().

◆ negate() [1/2]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::negate ( const mat< R, C, T > &  m)
inline
41 {
42 return m.negate();
43}

◆ negate() [2/2]

template<dim_t L, typename T >
vec< L, T > tdm::negate ( vec< L, T >  v)
inline
36 {
37 return v.negate();
38}
vec & negate()
Definition: Vec.h:178

References tdm::vec< L, T >::negate().

◆ normalize()

template<dim_t L, typename T >
std::enable_if< std::is_floating_point< T >::value, vec< L, T > >::type tdm::normalize ( vec< L, T >  v)
inline
51 {
52 v.normalize();
53 return v;
54}
std::enable_if< std::is_floating_point< V >::value, vec & >::type normalize()
Definition: Vec.h:174

References tdm::vec< L, T >::normalize().

◆ operator!=() [1/2]

template<dim_t R, dim_t C, typename T >
bool tdm::operator!= ( const mat< R, C, T > &  lhs,
const mat< R, C, T > &  rhs 
)
inline
285 {
286 return !(lhs == rhs);
287}

◆ operator!=() [2/2]

template<dim_t L, typename T >
bool tdm::operator!= ( const vec< L, T > &  lhs,
const vec< L, T > &  rhs 
)
inline
204 {
205 return !(lhs == rhs);
206}

◆ operator*() [1/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T >::column_type tdm::operator* ( const mat< R, C, T > &  lhs,
const typename mat< R, C, T >::row_type &  rhs 
)
inline
352 {
353 using column_type = typename mat<R, C, T>::column_type;
354 using value_type = typename column_type::value_type;
355 column_type ret;
356 rhs.apply([&ret, &lhs](value_type value, dim_t ci) {
357 ret += (lhs.column(ci) * column_type{value});
358 });
359 return ret;
360}
column_type column(dim_t index) const
Definition: Mat.h:251
vec & apply(F func)
Definition: Vec.h:68

References tdm::vec< L, T >::apply(), and tdm::mat< R, C, T >::column().

◆ operator*() [2/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator* ( const mat< R, C, T > &  lhs,
rhs 
)
inline
332 {
333 return mat<R, C, T>(lhs) *= rhs;
334}
Definition: Mat.h:17

◆ operator*() [3/8]

template<dim_t R, dim_t S, dim_t C, typename T >
mat< R, C, T > tdm::operator* ( const mat< R, S, T > &  lhs,
const mat< S, C, T > &  rhs 
)
inline
363 {
364 using row_type = typename mat<R, C, T>::row_type;
365 mat<R, C, T> ret;
366 ret.apply([&lhs, &rhs](row_type& row, dim_t ri) {
367 row = (lhs[ri] * rhs);
368 });
369 return ret;
370}
mat & apply(F func)
Definition: Mat.h:140

References tdm::mat< R, C, T >::apply().

◆ operator*() [4/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T >::row_type tdm::operator* ( const typename mat< R, C, T >::column_type &  lhs,
const mat< R, C, T > &  rhs 
)
inline
342 {
343 using row_type = typename mat<R, C, T>::row_type;
344 row_type ret;
345 rhs.apply([&ret, &lhs](const row_type& row, dim_t ri) {
346 ret += (row * row_type{lhs[ri]});
347 });
348 return ret;
349}

References tdm::mat< R, C, T >::apply().

◆ operator*() [5/8]

template<dim_t L, typename T , typename U >
vec< L, T > tdm::operator* ( const vec< L, T > &  lhs,
const vec< L, U > &  rhs 
)
inline
249 {
250 return vec<L, T>(lhs) *= rhs;
251}

◆ operator*() [6/8]

template<dim_t L, typename T , typename U >
std::enable_if< std::is_arithmetic< U >::value, vec< L, T > >::type tdm::operator* ( const vec< L, T > &  lhs,
rhs 
)
inline
254 {
255 return vec<L, T>(lhs) *= rhs;
256}

◆ operator*() [7/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator* ( lhs,
const mat< R, C, T > &  rhs 
)
inline
337 {
338 return mat<R, C, T>(rhs) *= lhs;
339}

◆ operator*() [8/8]

template<dim_t L, typename T , typename U >
std::enable_if< std::is_arithmetic< T >::value, vec< L, T > >::type tdm::operator* ( lhs,
const vec< L, U > &  rhs 
)
inline
259 {
260 return vec<L, T>(lhs) *= rhs;
261}

◆ operator+() [1/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator+ ( const mat< R, C, T > &  lhs,
const mat< R, C, T > &  rhs 
)
inline
312 {
313 return mat<R, C, T>(lhs) += rhs;
314}

◆ operator+() [2/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator+ ( const mat< R, C, T > &  lhs,
rhs 
)
inline
302 {
303 return mat<R, C, T>(lhs) += rhs;
304}

◆ operator+() [3/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator+ ( const mat< R, C, T > &  m)
inline
290 {
291 return m;
292}

◆ operator+() [4/8]

template<dim_t L, typename T , typename U >
vec< L, T > tdm::operator+ ( const vec< L, T > &  lhs,
const vec< L, U > &  rhs 
)
inline
219 {
220 return vec<L, T>(lhs) += rhs;
221}

◆ operator+() [5/8]

template<dim_t L, typename T , typename U >
vec< L, T > tdm::operator+ ( const vec< L, T > &  lhs,
rhs 
)
inline
224 {
225 return vec<L, T>(lhs) += rhs;
226}

◆ operator+() [6/8]

template<dim_t L, typename T >
vec< L, T > tdm::operator+ ( const vec< L, T > &  v)
inline
209 {
210 return v;
211}

◆ operator+() [7/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator+ ( lhs,
const mat< R, C, T > &  rhs 
)
inline
307 {
308 return mat<R, C, T>(lhs) += rhs;
309}

◆ operator+() [8/8]

template<dim_t L, typename T , typename U >
vec< L, T > tdm::operator+ ( lhs,
const vec< L, U > &  rhs 
)
inline
229 {
230 return vec<L, T>(lhs) += rhs;
231}

◆ operator-() [1/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator- ( const mat< R, C, T > &  lhs,
const mat< R, C, T > &  rhs 
)
inline
327 {
328 return mat<R, C, T>(lhs) -= rhs;
329}

◆ operator-() [2/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator- ( const mat< R, C, T > &  lhs,
rhs 
)
inline
317 {
318 return mat<R, C, T>(lhs) -= rhs;
319}

◆ operator-() [3/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator- ( const mat< R, C, T > &  m)
inline
295 {
296 mat<R, C, T> ret{m};
297 ret.negate();
298 return ret;
299}

◆ operator-() [4/8]

template<dim_t L, typename T , typename U >
vec< L, T > tdm::operator- ( const vec< L, T > &  lhs,
const vec< L, U > &  rhs 
)
inline
234 {
235 return vec<L, T>(lhs) -= rhs;
236}

◆ operator-() [5/8]

template<dim_t L, typename T , typename U >
vec< L, T > tdm::operator- ( const vec< L, T > &  lhs,
rhs 
)
inline
239 {
240 return vec<L, T>(lhs) -= rhs;
241}

◆ operator-() [6/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator- ( lhs,
const mat< R, C, T > &  rhs 
)
inline
322 {
323 return mat<R, C, T>(lhs) -= rhs;
324}

◆ operator-() [7/8]

template<dim_t L, typename T , typename U >
vec< L, T > tdm::operator- ( lhs,
const vec< L, U > &  rhs 
)
inline
244 {
245 return vec<L, T>(lhs) -= rhs;
246}

◆ operator-() [8/8]

template<dim_t L, typename T >
vec< L, T > tdm::operator- ( vec< L, T >  v)
inline
214 {
215 return v.negate();
216}

References tdm::vec< L, T >::negate().

◆ operator/() [1/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator/ ( const mat< R, C, T > &  lhs,
const mat< R, C, T > &  rhs 
)
inline
398 {
399 return mat<R, C, T>(lhs) /= rhs;
400}

◆ operator/() [2/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T >::column_type tdm::operator/ ( const mat< R, C, T > &  lhs,
const typename mat< R, C, T >::row_type &  rhs 
)
inline
393 {
394 return (inverse(lhs) * rhs);
395}
mat< N, N, T > inverse(const mat< N, N, T > &m)
Definition: Computations.h:134

References inverse().

◆ operator/() [3/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator/ ( const mat< R, C, T > &  lhs,
rhs 
)
inline
373 {
374 return mat<R, C, T>(lhs) /= rhs;
375}

◆ operator/() [4/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T >::row_type tdm::operator/ ( const typename mat< R, C, T >::column_type &  lhs,
const mat< R, C, T > &  rhs 
)
inline
388 {
389 return (lhs * inverse(rhs));
390}

References inverse().

◆ operator/() [5/8]

template<dim_t L, typename T , typename U >
vec< L, T > tdm::operator/ ( const vec< L, T > &  lhs,
const vec< L, U > &  rhs 
)
inline
264 {
265 return vec<L, T>(lhs) /= rhs;
266}

◆ operator/() [6/8]

template<dim_t L, typename T , typename U >
std::enable_if< std::is_arithmetic< U >::value, vec< L, T > >::type tdm::operator/ ( const vec< L, T > &  lhs,
rhs 
)
inline
269 {
270 return vec<L, T>(lhs) /= rhs;
271}

◆ operator/() [7/8]

template<dim_t R, dim_t C, typename T >
mat< R, C, T > tdm::operator/ ( lhs,
const mat< R, C, T > &  rhs 
)
inline
378 {
379 using row_type = typename mat<R, C, T>::row_type;
380 mat<R, C, T> tmp{rhs};
381 tmp.apply([lhs](row_type& row, dim_t /*unused*/) {
382 row = lhs / row;
383 });
384 return tmp;
385}

References tdm::mat< R, C, T >::apply().

◆ operator/() [8/8]

template<dim_t L, typename T , typename U >
std::enable_if< std::is_arithmetic< T >::value, vec< L, T > >::type tdm::operator/ ( lhs,
const vec< L, U > &  rhs 
)
inline
274 {
275 return vec<L, T>(lhs) /= rhs;
276}

◆ operator==() [1/2]

template<dim_t R, dim_t C, typename T >
bool tdm::operator== ( const mat< R, C, T > &  lhs,
const mat< R, C, T > &  rhs 
)
inline
275 {
276 using row_type = typename mat<R, C, T>::row_type;
277 bool retval = true;
278 lhs.apply([&rhs, &retval](const row_type& row, dim_t ri) {
279 retval = retval && (row == rhs[ri]);
280 });
281 return retval;
282}

References tdm::mat< R, C, T >::apply().

◆ operator==() [2/2]

template<dim_t L, typename T >
bool tdm::operator== ( const vec< L, T > &  lhs,
const vec< L, T > &  rhs 
)
inline
195 {
196 bool equal = true;
197 lhs.apply([&equal, &rhs](const T& v, dim_t i) {
198 equal = equal && (v == rhs[i]);
199 });
200 return equal;
201}

References tdm::vec< L, T >::apply().

◆ pi()

constexpr double tdm::pi ( )
inlineconstexpr
10 {
11 return 3.14159265358979323846;
12}

Referenced by degrees(), dnac::extractRotationVector(), and radians().

◆ radians()

template<typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type tdm::radians ( degrees)
inline
21 {
22 static constexpr const auto c = static_cast<T>(pi() / 180.0);
23 return c * degrees;
24}
std::enable_if< std::is_floating_point< T >::value, T >::type degrees(T radians)
Definition: Transforms.h:15

References degrees(), and pi().

Referenced by degrees(), dnac::RotateCommand::Impl::getRotationTransformationMatrix(), and dnac::RotateCommand::Impl::rotateNeutralJoints().

◆ trace()

template<dim_t N, typename T >
T tdm::trace ( const mat< N, N, T > &  m)
inline
151 {
152 T trace{0};
153 for (dim_t row{}; row < m.rows(); ++row) {
154 trace += m(row, row);
155 }
156 return trace;
157}
T trace(const mat< N, N, T > &m)
Definition: Computations.h:151

References trace().

Referenced by trace().

◆ transpose()

template<dim_t R, dim_t C, typename T >
mat< C, R, T > tdm::transpose ( const mat< R, C, T > &  m)
inline
57 {
58 using row_type = typename mat<C, R, T>::row_type;
59 mat<C, R, T> ret;
60 ret.apply([&m](row_type& row, dim_t i) {
61 row = m.column(i);
62 });
63 return ret;
64}

References tdm::mat< R, C, T >::apply().

Referenced by tdm::mat< R, C, T >::fromColumns(), and tdm::mat< R, C, T >::transpose().