1 #ifndef VIENNACL_LINALG_DETAIL_SPAI_SMALL_MATRIX_HPP
2 #define VIENNACL_LINALG_DETAIL_SPAI_SMALL_MATRIX_HPP
35 #include "boost/numeric/ublas/vector.hpp"
36 #include "boost/numeric/ublas/matrix.hpp"
37 #include "boost/numeric/ublas/matrix_proxy.hpp"
38 #include "boost/numeric/ublas/vector_proxy.hpp"
39 #include "boost/numeric/ublas/storage.hpp"
40 #include "boost/numeric/ublas/io.hpp"
41 #include "boost/numeric/ublas/lu.hpp"
42 #include "boost/numeric/ublas/triangular.hpp"
43 #include "boost/numeric/ublas/matrix_expression.hpp"
44 #include "boost/numeric/ublas/detail/matrix_assign.hpp"
60 template<
typename MatrixT>
65 mat.resize(new_size, new_size,
false);
68 double val = 1.0 / std::sqrt(2.0);
73 for (
vcl_size_t i=off_diagonal_distance; i<new_size; ++i)
75 mat(i-off_diagonal_distance, i) = val;
76 mat(i, i-off_diagonal_distance) = -val;
83 template<
typename MatrixT>
84 double determinant(boost::numeric::ublas::matrix_expression<MatrixT>
const & mat_r)
89 boost::numeric::ublas::permutation_matrix<vcl_size_t> pivots(mat_r().
size1());
91 int is_singular =
static_cast<int>(
lu_factorize(mLu, pivots));
vcl_size_t size1(MatrixType const &mat)
Generic routine for obtaining the number of rows of a matrix (ViennaCL, uBLAS, etc.)
This file provides the forward declarations for the main types used within ViennaCL.
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
void make_rotation_matrix(MatrixT &mat, vcl_size_t new_size, vcl_size_t off_diagonal_distance=4)
double determinant(boost::numeric::ublas::matrix_expression< MatrixT > const &mat_r)
void lu_factorize(matrix< NumericT, viennacl::row_major > &A)
LU factorization of a row-major dense matrix.