Creates a fixed size matrix from a set of its elements given by a vector object. .
#include <iostream>
#include <vector>
#include <iomanip>
template <class value_t, class alloc_t, class derived_t>
{
for (std::size_t iRow = 0; iRow < m.
Rows(); ++iRow)
{
os << '[';
for (auto& c:m)
{
os << ' ' << std::setw(3) << c[iRow];
}
os << "]\n";
}
return os;
}
int main(int, char**)
{
std::vector<double> v =
{
1, 2, 3, 4,
4, 3, 2, 1
};
std::cout << "m1:\n" << m1;
std::cout << "m2:\n" << m2;
std::cout << std::boolalpha << "m1 == m2.Transpose() is " << (m1 == m2.Transpose()) << "\n";
std::cout << std::boolalpha << "m2 == m1.Transpose() is " << (m1.Transpose() == m2) << "\n";
return 0;
}
mathematical and arithmetical functions mostly over integer operands.
Specializes the Matrix template for fixed-sized matrices.
Definition: chsvmath.h:8765
A class template for matrices of elements of various types and semantics, including types which do no...
Definition: chsvmath.h:6374
size_type Rows() const
Returns a number of rows in the current matrix.