8 template <
class Type, u
int nRows, u
int nCols>
12 std::array<std::array<Type, nRows>, nCols>
data;
13 typedef typename arma::Mat<Type>::template fixed<nRows,nCols>
ArmaType;
16 for (
uint i = 0; i < nRows * nCols; ++i) {
20 Mat(std::initializer_list<std::initializer_list<Type>> list) {
21 const auto * listIt = list.begin();
23 for (
uint i = 0; i < nRows; ++i) {
24 it = (listIt + i)->
begin();
25 for (
uint j = 0; j < nCols; ++j) {
26 data[j][i] = *(it + j);
30 Mat(std::initializer_list<Type> list) {
31 const Type *
it = list.begin();
32 for (
uint i = 0; i < nRows * nCols; ++i) {
33 data[0][i] = *(it + i);
37 for (
uint i = 0; i < nRows * nCols; ++i) {
38 data[0][i] = other[i];
41 inline Mat(
const ArmaType & other) {
42 for (
uint i = 0; i < nRows * nCols; ++i) {
43 data[0][i] = other[i];
46 inline const Type *
begin()
const {
47 return data.data()->data();
50 return data.data()->data();
52 inline const Type *
end()
const {
53 return begin() + nCols * nRows;
56 return begin() + nCols * nRows;
65 return data[0][index];
68 return data[0][index];
71 return data[col][row];
74 return data[col][row];
76 inline ArmaType
arma()
const {
80 for (
uint i = 0; i < nRows * nCols; ++i) {
81 data[0][i] = other[i];
86 for (
uint i = 0; i < nRows * nCols; ++i) {
87 data[0][i] = other[i];
92 const auto * listIt = list.begin();
94 for (
uint i = 0; i < nRows; ++i) {
95 it = (listIt + i)->
begin();
96 for (
uint j = 0; j < nCols; ++j) {
97 data[j][i] = *(it + j);
103 const Type *
it = list.begin();
104 for (
uint i = 0; i < nRows * nCols; ++i) {
105 data[0][i] = *(it + i);
110 const Type * first1 =
begin();
111 const Type * last1 =
end();
112 const Type * first2 = other.begin();
113 for (; first1 != last1; ++first1, ++first2) {
114 if (*first1 != *first2) {
121 const Type * first1 =
begin();
122 const Type * last1 =
end();
123 const Type * first2 = other.
begin();
124 for (; first1 != last1; ++first1, ++first2) {
125 if (*first1 != *first2) {
133 template <
class Type, u
int nRows, u
int nCols>
138 template <
class Type, u
int nRows, u
int nCols>
143 template <
class Type, u
int nRows, u
int nCols>
148 template <
class Type, u
int resRows, u
int commonDimension, u
int resCols>
153 template <
class Type, u
int nRows, u
int nCols>
158 template <
class Type, u
int nRows, u
int nCols>
160 return number * a.
arma();
163 template <
class Type, u
int nRows, u
int nCols>
165 return a.
arma() / number;
171 template <u
int N, u
int M>
const Mat< Type, nRows, nCols > & operator=(const Mat< Type, nRows, nCols > &other)
const Mat< Type, nRows, nCols > & operator=(const ArmaType &other)
const Mat< Type, nRows, nCols > & operator=(std::initializer_list< std::initializer_list< Type >> list)
arma::Mat< Type >::template fixed< nRows, nCols > ArmaType
arma::Mat< Type >::template fixed< nRows, nCols > operator+(const Mat< Type, nRows, nCols > &a, const Mat< Type, nRows, nCols > &b)
std::array< std::array< Type, nRows >, nCols > data
Mat(std::initializer_list< Type > list)
arma::Mat< Type >::template fixed< nRows, nCols > operator%(const Mat< Type, nRows, nCols > &a, const Mat< Type, nRows, nCols > &b)
Type & operator[](uint index)
arma::Mat< Type >::template fixed< resRows, resCols > operator*(const Mat< Type, resRows, commonDimension > &a, const Mat< Type, commonDimension, resCols > &b)
const Mat< Type, nRows, nCols > & operator=(std::initializer_list< Type > list)
const Type * begin() const
Type & operator()(uint row, uint col)
arma::Mat< Type >::template fixed< nRows, nCols > operator/(const Mat< Type, nRows, nCols > &a, Type number)
bool operator==(const Mat< Type, nRows, nCols > &other)
arma::Mat< Type >::template fixed< nRows, nCols > operator-(const Mat< Type, nRows, nCols > &a, const Mat< Type, nRows, nCols > &b)
Mat(const Armor::Mat< Type, nRows, nCols > &other)
const Type & operator()(uint row, uint col) const
Type dot(const Mat< Type, nRows, nCols > &a, const Mat< Type, nRows, nCols > &b)
Mat(const ArmaType &other)
Mat(std::initializer_list< std::initializer_list< Type >> list)
bool operator==(const ArmaType &other)
const Type & operator[](uint index) const