units
Use physical dimensions at compile-time or run-time.
|
Classes | |
struct | mat |
Model of a matrix of quantities. More... | |
class | mref |
Reference to column or row in matrix. More... | |
Typedefs | |
template<typename T , size_t NR> | |
using | col = mat< T, NR, 1 > |
Model of column of quantities. More... | |
template<typename T , size_t NC> | |
using | row = mat< T, 1, NC > |
Model of row of quantities. More... | |
Functions | |
template<typename T , typename OT , size_t N> | |
constexpr T | cnv_el (array< OT, N > const &a, size_t i) |
Convert element i of array a from type OT to type T. More... | |
template<typename T , typename OT , size_t... i> | |
constexpr auto | _cnv (array< OT, sizeof...(i)> const &a, index_sequence< i... >) |
Convert array of elements of type OT to array of elements of type T. More... | |
template<typename T , typename OT , size_t N> | |
constexpr auto | cnv_ar (array< OT, N > const &a) |
Convert array of elements of type OT to array of elements of type T. More... | |
template<typename T1 , typename T2 , size_t S1, size_t S2, size_t N> | |
constexpr auto | dot (mref< T1, S1, N > const &mr1, mref< T2, S2, N > const &mr2) |
Dot-product of two mrefs. More... | |
template<typename T1 , typename T2 , size_t NR1, size_t NC2, size_t N> | |
constexpr auto | operator* (mat< T1, NR1, N > const &m1, mat< T2, N, NC2 > const &m2) |
Multiply two matrices. More... | |
template<typename T1 , typename T2 , size_t NR2, size_t NC2> | |
constexpr auto | operator* (T1 const &s1, mat< T2, NR2, NC2 > const &m2) |
Multiply matrix on left by scalar. More... | |
template<typename T , size_t NR, size_t NC> | |
ostream & | operator<< (ostream &os, mat< T, NR, NC > const &m) |
Print matrix. More... | |
using vnix::mv::col = typedef mat<T, NR, 1> |
Model of column of quantities.
Definition at line 124 of file example1.cpp.
using vnix::mv::row = typedef mat<T, 1, NC> |
Model of row of quantities.
Definition at line 127 of file example1.cpp.
constexpr auto vnix::mv::_cnv | ( | array< OT, sizeof...(i)> const & | a, |
index_sequence< i... > | |||
) |
Convert array of elements of type OT to array of elements of type T.
Definition at line 31 of file example1.cpp.
constexpr auto vnix::mv::cnv_ar | ( | array< OT, N > const & | a | ) |
Convert array of elements of type OT to array of elements of type T.
Definition at line 37 of file example1.cpp.
constexpr T vnix::mv::cnv_el | ( | array< OT, N > const & | a, |
size_t | i | ||
) |
Convert element i of array a from type OT to type T.
Definition at line 25 of file example1.cpp.
constexpr auto vnix::mv::dot | ( | mref< T1, S1, N > const & | mr1, |
mref< T2, S2, N > const & | mr2 | ||
) |
constexpr auto vnix::mv::operator* | ( | mat< T1, NR1, N > const & | m1, |
mat< T2, N, NC2 > const & | m2 | ||
) |
Multiply two matrices.
Definition at line 131 of file example1.cpp.
constexpr auto vnix::mv::operator* | ( | T1 const & | s1, |
mat< T2, NR2, NC2 > const & | m2 | ||
) |
Multiply matrix on left by scalar.
Definition at line 146 of file example1.cpp.
ostream& vnix::mv::operator<< | ( | ostream & | os, |
mat< T, NR, NC > const & | m | ||
) |