31 #include <boost/numeric/mtl/mtl.hpp>
32 #include <boost/numeric/itl/itl.hpp>
35 #define VIENNACL_WITH_MTL4 1
53 int main(
int,
char *[])
57 mtl::compressed2D<ScalarType> mtl4_matrix;
58 mtl4_matrix.change_dim(65025, 65025);
59 set_to_zero(mtl4_matrix);
61 mtl::dense_vector<ScalarType> mtl4_rhs(65025, 1.0);
62 mtl::dense_vector<ScalarType> mtl4_result(65025, 0.0);
63 mtl::dense_vector<ScalarType> mtl4_residual(65025, 0.0);
69 mtl::io::matrix_market_istream(
"../examples/testdata/mat65k.mtx") >> mtl4_matrix;
74 std::cout <<
"----- Running CG -----" << std::endl;
77 mtl4_residual = mtl4_matrix * mtl4_result - mtl4_rhs;
83 std::cout <<
"----- Running BiCGStab -----" << std::endl;
86 mtl4_residual = mtl4_matrix * mtl4_result - mtl4_rhs;
92 std::cout <<
"----- Running GMRES -----" << std::endl;
95 mtl4_residual = mtl4_matrix * mtl4_result - mtl4_rhs;
101 std::cout << std::endl;
102 std::cout <<
"!!!! TUTORIAL COMPLETED SUCCESSFULLY !!!!" << std::endl;
103 std::cout << std::endl;
T norm_2(std::vector< T, A > const &v1)
A reader and writer for the matrix market format is implemented here.
The stabilized bi-conjugate gradient method is implemented here.
A tag for the solver GMRES. Used for supplying solver parameters and for dispatching the solve() func...
Implementations of the generalized minimum residual method are in this file.
Implementations of incomplete factorization preconditioners. Convenience header file.
The conjugate gradient method is implemented here.
A tag for the conjugate gradient Used for supplying solver parameters and for dispatching the solve()...
A tag for the stabilized Bi-conjugate gradient solver. Used for supplying solver parameters and for d...
viennacl::vector< NumericT > solve(MatrixT const &A, viennacl::vector_base< NumericT > const &rhs, bicgstab_tag const &tag, viennacl::linalg::no_precond)
Implementation of a pipelined stabilized Bi-conjugate gradient solver.