// -*- c++ -*- // // $COPYRIGHT$ // //=========================================================================== #include "mtl/matrix.h" #include "mtl/mtl.h" #include "mtl/utils.h" #include "mtl/linalg_vec.h" #include /* Sample Output Array A: 3x3 [ [1,0,0], [2,4,0], [3,5,6] ] Vector x [3,2,1,] Ax [3,14,25,] */ using namespace mtl; using namespace std; int main() { //begin typedef matrix< double, triangle, packed, column_major >::type Matrix; typedef dense1D Vector; // 1 3 // A = 2 4 x = 2 // 3 5 6 1 Matrix::size_type N = 3, i; double dA[] = { 1, 2, 3, 4, 5, 6 }; Matrix A(dA, N); Vector x(N), Ax(N); for (i = 0; i < N; ++i) x[i] = 3-i; //end cout << "Array A:" << endl; print_all_banded(A, A.sub(), A.super()); cout << "Vector x" << endl; print_vector(x); //begin mult(A, x, Ax); //end cout << "Ax" << endl; print_vector(Ax); return 0; }