1#ifndef SCIFIR_UNITS_UTIL_MATRIX_HPP_INCLUDED
2#define SCIFIR_UNITS_UTIL_MATRIX_HPP_INCLUDED
4#include "../units/scalar_unit.hpp"
14 template<
typename T,
int M,
int N>
27 for(
const auto&
column : x)
35 for(
const auto&
column : x)
37 for(
int j = 0;
j <
N;
j++)
67 for (
int j = 0;
j <
N;
j++)
81 for (
int i = 0;
i <
M;
i++)
103 return data[
i - 1][
j - 1];
124 for(
int i = 0;
i <
M;
i++)
126 for(
int j = 0;
j <
N2;
j++)
129 for(
int k = 0;
k <
N;
k++)
149 for(
int i = 0;
i <
M;
i++)
151 for(
int j = 0;
j <
N;
j++)
160 for(
int i = 0;
i <
M;
i++)
162 for(
int j = 0;
j <
N;
j++)
173 for(
int i = 2;
i <= x;
i++)
177 for (
int i = 0;
i <
M;
i++)
179 for (
int j = 0;
j <
N;
j++)
189 for(
int i = 0;
i <
M;
i++)
191 for(
int j = 0;
j <
N;
j++)
213 for(
int i = 0;
i <
M;
i++)
215 for(
int j = 0;
j <
N;
j++)
258template<
typename T,
int M,
int N>
261 for(
int i = 0; i < x.row_size(); i++)
263 for(
int j = 0; j < x.column_size(); j++)
265 if (x(i,j) != y(i,j))
274template<
typename T,
int M,
int N>
280template<
typename T,
int M,
int N>
283 ostringstream output;
285 for(
int i = 1; i <= x.row_size(); i++)
287 for(
int j = 1; j <= x.column_size(); j++)
290 if(j < x.column_size())
301 return os << output.str();
matrix< T, M, N > operator^(U x)
virtual matrix< T, M, N > * clone() const
matrix< T, M, N > operator+(const matrix< T, M, N > &x)
bool outside_column_limits(int i) const
matrix(initializer_list< vector< T > > x)
bool outside_limits(int i, int j) const
void operator-=(const matrix< T, M, N > &x)
matrix< T, M, 1 > column(int j) const
matrix< T, M, N > operator-(const matrix< T, M, N > &x)
bool outside_row_limits(int i) const
matrix< T, N, N2 > operator*(const matrix< T, N, N2 > &x)
T & operator()(int i, int j)
const T & operator()(int i, int j) const
matrix< T, N, M > t() const
matrix< T, 1, N > row(int i) const
vector< vector< T > > data
void operator+=(const matrix< T, M, N > &x)
bool operator!=(const scifir::matrix< T, M, N > &x, const scifir::matrix< T, M, N > &y)
bool operator==(const scifir::matrix< T, M, N > &x, const scifir::matrix< T, M, N > &y)
ostream & operator<<(ostream &os, const scifir::matrix< T, M, N > &x)
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.