35 #define VIENNACL_WITH_UBLAS
51 #include <boost/numeric/ublas/matrix.hpp>
52 #include <boost/numeric/ublas/matrix_proxy.hpp>
53 #include <boost/numeric/ublas/matrix_expression.hpp>
54 #include <boost/numeric/ublas/matrix_sparse.hpp>
55 #include <boost/numeric/ublas/vector.hpp>
56 #include <boost/numeric/ublas/operation.hpp>
57 #include <boost/numeric/ublas/vector_expression.hpp>
72 boost::numeric::ublas::compressed_matrix<ScalarType> ublas_A;
75 std::cout <<
"Error reading Matrix file" << std::endl;
90 std::cout <<
"Running Lanczos algorithm (this might take a while)..." << std::endl;
96 for (std::size_t i = 0; i< lanczos_eigenvalues.size(); i++)
97 std::cout <<
"Eigenvalue " << i+1 <<
": " << std::setprecision(10) << lanczos_eigenvalues[i] << std::endl;
A reader and writer for the matrix market format is implemented here.
Implementation of the compressed_matrix class.
std::vector< typename viennacl::result_of::cpu_value_type< typename MatrixT::value_type >::type > eig(MatrixT const &matrix, lanczos_tag const &tag)
Implementation of the calculation of eigenvalues using lanczos.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
long read_matrix_market_file(MatrixT &mat, const char *file, long index_base=1)
Reads a sparse matrix from a file (MatrixMarket format)
Implementation of the ViennaCL scalar class.
A tag for the lanczos algorithm.
Generic interface for the Lanczos algorithm.