Creates a matrix with a specified number of columns and rows such that all elements appertaining to the main diagonal of the created matrix are initialized with a given value.
#include <iostream>
#include <iomanip>
template <class val_t, class alloc_t>
std::ostream& operator<<(std::ostream& os, const Matrix<val_t, alloc_t>& m)
{
{
os << "\n[";
os << std::setw(3) << m[col][row] << "\t";
os << std::setw(3) << m[m.Columns() - 1][row] << "]";
}
os << std::endl;
return os;
}
int main(int argc, char** argv)
{
Matrix<int> m1(1, 3, 3);
std::cout << m1 << std::endl;
Matrix<int> m2(1, 3, 4);
std::cout << m2 << std::endl;
Matrix<int> m3(2, 4, 3);
std::cout << m3 << std::endl;
}
mathematical and arithmetical functions mostly over integer operands.
MyBase::size_type size_type
An unsigned integral type for sizes within the matrix storage.
Definition: chsvmath.h:6396
A namespace containing mathematical functions and components.
Definition: chsvmath.h:84