units
Use physical dimensions at compile-time or run-time.
Public Member Functions | Public Attributes | Friends | List of all members
vnix::mv::mat< T, NR, NC > Struct Template Reference

Model of a matrix of quantities. More...

#include <number.hpp>

Collaboration diagram for vnix::mv::mat< T, NR, NC >:
[legend]

Public Member Functions

 mat ()
 
template<typename... X>
constexpr mat (X...xs)
 Initialize from list. More...
 
template<typename OT >
constexpr mat (mat< OT, NR, NC > const &m)
 Copy from same-size matrix of other element-type OT. More...
 
constexpr auto col (size_t off) const
 Reference to immutable column. More...
 
constexpr auto col (size_t off)
 Reference to mutable column. More...
 
constexpr auto row (size_t off) const
 Reference to immutable row. More...
 
constexpr auto row (size_t off)
 Reference to mutable row. More...
 

Public Attributes

array< T, NR *NC > a
 Array in which quantities are stored. More...
 

Friends

template<typename OT , size_t ONR, size_t ONC>
struct mat
 Allow access to every other type of matrix. More...
 

Detailed Description

template<typename T, size_t NR, size_t NC>
struct vnix::mv::mat< T, NR, NC >

Model of a matrix of quantities.

Definition at line 23 of file number.hpp.

Constructor & Destructor Documentation

template<typename T, size_t NR, size_t NC>
vnix::mv::mat< T, NR, NC >::mat ( )
inline

Definition at line 91 of file example1.cpp.

91 {}
template<typename T, size_t NR, size_t NC>
template<typename... X>
constexpr vnix::mv::mat< T, NR, NC >::mat ( X...  xs)
inline

Initialize from list.

Definition at line 94 of file example1.cpp.

94 : a({T(xs)...}) {}
array< T, NR *NC > a
Array in which quantities are stored.
Definition: example1.cpp:86
template<typename T, size_t NR, size_t NC>
template<typename OT >
constexpr vnix::mv::mat< T, NR, NC >::mat ( mat< OT, NR, NC > const &  m)
inline

Copy from same-size matrix of other element-type OT.

Definition at line 98 of file example1.cpp.

98 : a(cnv_ar<T>(m.a)) {}
array< T, NR *NC > a
Array in which quantities are stored.
Definition: example1.cpp:86
constexpr auto m
Constant-expression symbol for m.
Definition: units.hpp:1675

Member Function Documentation

template<typename T, size_t NR, size_t NC>
constexpr auto vnix::mv::mat< T, NR, NC >::col ( size_t  off) const
inline

Reference to immutable column.

Definition at line 101 of file example1.cpp.

101  {
102  return mref<T const, NC, NR>(a.data() + off);
103  }
array< T, NR *NC > a
Array in which quantities are stored.
Definition: example1.cpp:86
template<typename T, size_t NR, size_t NC>
constexpr auto vnix::mv::mat< T, NR, NC >::col ( size_t  off)
inline

Reference to mutable column.

Definition at line 106 of file example1.cpp.

106  {
107  using RT = typename std::remove_const<T>::type;
108  return mref<RT, NC, NR>(a.data() + off);
109  }
array< T, NR *NC > a
Array in which quantities are stored.
Definition: example1.cpp:86
template<typename T, size_t NR, size_t NC>
constexpr auto vnix::mv::mat< T, NR, NC >::row ( size_t  off) const
inline

Reference to immutable row.

Definition at line 112 of file example1.cpp.

112  {
113  return mref<T const, 1, NC>(a.data() + NC * off);
114  }
array< T, NR *NC > a
Array in which quantities are stored.
Definition: example1.cpp:86
template<typename T, size_t NR, size_t NC>
constexpr auto vnix::mv::mat< T, NR, NC >::row ( size_t  off)
inline

Reference to mutable row.

Definition at line 117 of file example1.cpp.

117  {
118  using RT = typename std::remove_const<T>::type;
119  return mref<RT, 1, NC>(a.data() + NC * off);
120  }
array< T, NR *NC > a
Array in which quantities are stored.
Definition: example1.cpp:86

Here is the caller graph for this function:

Friends And Related Function Documentation

template<typename T, size_t NR, size_t NC>
template<typename OT , size_t ONR, size_t ONC>
friend struct mat
friend

Allow access to every other type of matrix.

Definition at line 89 of file example1.cpp.

Member Data Documentation

template<typename T, size_t NR, size_t NC>
array<T, NR * NC> vnix::mv::mat< T, NR, NC >::a

Array in which quantities are stored.

Definition at line 86 of file example1.cpp.


The documentation for this struct was generated from the following files: