Matrix
First matrix implementation with print_matrix in io
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include <config/types.hpp> // include types to use
|
||||
#include <config/constants.hpp> // Math constants
|
||||
#include <tensor/vector.hpp>
|
||||
#include <tensor/matrix.hpp>
|
||||
#include <io/print_tensor.hpp>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -64,18 +65,29 @@ int main(void) {
|
||||
|
||||
panic::tensor::real_vector a(3);
|
||||
panic::tensor::uint_vector b(3);
|
||||
panic::tensor::int_vector c(3);
|
||||
panic::tensor::int_vector c(10);
|
||||
a[2] = 1.2;
|
||||
b[2] = 3;
|
||||
c[2] = -3;
|
||||
panic::io::print(a);
|
||||
panic::io::print(b);
|
||||
panic::io::print(c);
|
||||
panic::io::print_vector(a);
|
||||
panic::io::print_vector(b);
|
||||
panic::io::print_vector(c);
|
||||
std::cout << a[100] << std::endl;
|
||||
std::cout << a.at(100) << std::endl;
|
||||
std::cout << panic::pi << std::endl;
|
||||
std::cout << panic::constants::pi << std::endl;
|
||||
std::cout << 1.23249238423847 << std::endl;
|
||||
|
||||
panic::tensor::real_matrix A(2,2, 1);
|
||||
panic::tensor::uint_matrix B(2,2, 2);
|
||||
panic::tensor::int_matrix C(2,2, 3);
|
||||
A(1,0) = 1.2;
|
||||
B(1,0) = 3;
|
||||
C(1,0) = -2;
|
||||
|
||||
panic::io::print_matrix(A);
|
||||
panic::io::print_matrix(B);
|
||||
panic::io::print_matrix(C);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user