31 lines
687 B
C++
31 lines
687 B
C++
/**
|
|
* g++ main.cpp -std=c++17 -Wall -Wpedantic -pedantic -o main; ./main
|
|
*/
|
|
|
|
#include <iostream>
|
|
|
|
#include "Matrix.h"
|
|
|
|
int main(int argn, char* argv[]) {
|
|
|
|
Matrix<int> mat(3, 4);
|
|
for (size_t i = 0; i < mat.size(); ++i) {
|
|
mat(i) = i;
|
|
}
|
|
|
|
// std::cout << "Matrix:\n" << mat(2, 1) << std::endl;
|
|
std::cout << "Matrix:\n" << mat.nrow() << std::endl;
|
|
|
|
std::cout << "Matrix:\n" << mat << std::endl;
|
|
|
|
Col<int> colView(mat, 2);
|
|
Row<int> rowView(mat, 1);
|
|
Diag<int> diagView(mat);
|
|
|
|
std::cout << "col:\n" << colView << std::endl;
|
|
std::cout << "row:\n" << rowView << std::endl;
|
|
std::cout << "diag:\n" << diagView << std::endl;
|
|
|
|
return 0;
|
|
}
|