16#ifndef dealii_lapack_full_matrix_h
17#define dealii_lapack_full_matrix_h
37template <
typename number>
39template <
typename number>
41template <
typename number>
43template <
typename number>
58template <
typename number>
65 using size_type = std::make_unsigned<types::blas_int>::type;
109 template <
typename number2>
119 template <
typename number2>
196 const bool left =
true);
204 template <
typename MatrixType>
306 template <
typename MatrixType>
313 const number factor = 1.,
344 template <
typename number2>
348 const bool adding =
false)
const;
356 const bool adding =
false)
const;
364 template <
typename number2>
385 template <
typename number2>
389 const bool adding =
false)
const;
397 const bool adding =
false)
const;
405 template <
typename number2>
433 const bool adding =
false)
const;
442 const bool adding =
false)
const;
461 const bool adding =
false)
const;
470 const bool adding =
false)
const;
491 const bool adding =
false)
const;
510 const bool adding =
false)
const;
519 const bool adding =
false)
const;
539 const bool adding =
false)
const;
548 const bool adding =
false)
const;
696 const bool left_eigenvectors =
false);
719 const number upper_bound,
720 const number abs_accuracy,
754 const number upper_bound,
755 const number abs_accuracy,
889 const unsigned int precision = 3,
890 const bool scientific =
true,
891 const unsigned int width = 0,
892 const char * zero_string =
" ",
893 const double denominator = 1.,
894 const double threshold = 0.)
const;
901 norm(
const char type)
const;
918 mutable std::vector<number>
work;
923 mutable std::vector<types::blas_int>
iwork;
931 std::vector<types::blas_int>
ipiv;
942 std::vector<typename numbers::NumberTraits<number>::real_type>
wr;
948 std::vector<number>
wi;
953 std::vector<number>
vl;
958 std::vector<number>
vr;
964 std::unique_ptr<LAPACKFullMatrix<number>>
svd_u;
970 std::unique_ptr<LAPACKFullMatrix<number>>
svd_vt;
985template <
typename number>
1009template <
typename number>
1015 (*this)(i, j) = value;
1019template <
typename number>
1023 return static_cast<size_type>(this->n_rows());
1026template <
typename number>
1030 return static_cast<size_type>(this->n_cols());
1033template <
typename number>
1034template <
typename MatrixType>
1038 this->
reinit(M.m(), M.n());
1043 for (
size_type row = 0; row < M.m(); ++row)
1045 const typename MatrixType::const_iterator end_row = M.end(row);
1046 for (
typename MatrixType::const_iterator entry = M.begin(row);
1049 this->el(row, entry->column()) = entry->value();
1057template <
typename number>
1058template <
typename MatrixType>
1065 const number factor,
1070 for (
size_type row = src_offset_i; row < M.m(); ++row)
1072 const typename MatrixType::const_iterator end_row = M.end(row);
1073 for (
typename MatrixType::const_iterator entry = M.begin(row);
1080 const size_type dst_i = dst_offset_i + i - src_offset_i;
1081 const size_type dst_j = dst_offset_j + j - src_offset_j;
1082 if (dst_i < this->n_rows() && dst_j < this->n_cols())
1083 (*this)(dst_i, dst_j) = factor * entry->value();
1091template <
typename number>
1092template <
typename number2>
1099 ExcMessage(
"LAPACKFullMatrix<number>::vmult must be called with a "
1100 "matching Vector<double> vector type."));
1104template <
typename number>
1105template <
typename number2>
1111 ExcMessage(
"LAPACKFullMatrix<number>::vmult_add must be called with a "
1112 "matching Vector<double> vector type."));
1116template <
typename number>
1117template <
typename number2>
1124 ExcMessage(
"LAPACKFullMatrix<number>::Tvmult must be called with a "
1125 "matching Vector<double> vector type."));
1129template <
typename number>
1130template <
typename number2>
1137 "LAPACKFullMatrix<number>::Tvmult_add must be called with a "
1138 "matching Vector<double> vector type."));
1142template <
typename number>
1143inline std::complex<number>
1152 return std::complex<number>(wi[i]);
1154 return std::complex<number>(wr[i], wi[i]);
1158template <
typename number>
1170template <
typename number>
1181template <
typename number>
LAPACKFullMatrix< number > & operator*=(const number factor)
number reciprocal_condition_number() const
void Tmmult(LAPACKFullMatrix< number > &C, const LAPACKFullMatrix< number > &B, const bool adding=false) const
void copy_from(const MatrixType &)
void scale_rows(const Vector< number > &V)
void add(const number a, const LAPACKFullMatrix< number > &B)
void Tvmult(Vector< number2 > &w, const Vector< number2 > &v, const bool adding=false) const
void transpose(LAPACKFullMatrix< number > &B) const
void mTmult(LAPACKFullMatrix< number > &C, const LAPACKFullMatrix< number > &B, const bool adding=false) const
std::vector< typename numbers::NumberTraits< number >::real_type > wr
void compute_eigenvalues_symmetric(const number lower_bound, const number upper_bound, const number abs_accuracy, Vector< number > &eigenvalues, FullMatrix< number > &eigenvectors)
const LAPACKFullMatrix< number > & get_svd_u() const
void vmult(Vector< number2 > &w, const Vector< number2 > &v, const bool adding=false) const
void reinit(const size_type size)
std::make_unsigned< types::blas_int >::type size_type
void compute_cholesky_factorization()
LAPACKFullMatrix< number > & operator=(const LAPACKFullMatrix< number > &)
void compute_lu_factorization()
std::unique_ptr< LAPACKFullMatrix< number > > svd_vt
std::complex< number > eigenvalue(const size_type i) const
void print_formatted(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const unsigned int width=0, const char *zero_string=" ", const double denominator=1., const double threshold=0.) const
std::vector< number > work
void grow_or_shrink(const size_type size)
void apply_givens_rotation(const std::array< number, 3 > &csr, const size_type i, const size_type k, const bool left=true)
void set_property(const LAPACKSupport::Property property)
number norm(const char type) const
void solve(Vector< number > &v, const bool transposed=false) const
void compute_eigenvalues(const bool right_eigenvectors=false, const bool left_eigenvectors=false)
LAPACKSupport::State state
std::vector< number > inv_work
number frobenius_norm() const
LAPACKFullMatrix(const size_type size=0)
LAPACKSupport::Property property
number singular_value(const size_type i) const
void set(const size_type i, const size_type j, const number value)
void compute_inverse_svd(const double threshold=0.)
void compute_generalized_eigenvalues_symmetric(LAPACKFullMatrix< number > &B, const number lower_bound, const number upper_bound, const number abs_accuracy, Vector< number > &eigenvalues, std::vector< Vector< number > > &eigenvectors, const types::blas_int itype=1)
void vmult_add(Vector< number2 > &w, const Vector< number2 > &v) const
number linfty_norm() const
void TmTmult(LAPACKFullMatrix< number > &C, const LAPACKFullMatrix< number > &B, const bool adding=false) const
const LAPACKFullMatrix< number > & get_svd_vt() const
std::unique_ptr< LAPACKFullMatrix< number > > svd_u
void compute_inverse_svd_with_kernel(const unsigned int kernel_size)
void Tvmult_add(Vector< number2 > &w, const Vector< number2 > &v) const
std::vector< types::blas_int > iwork
void rank1_update(const number a, const Vector< number > &v)
std::vector< types::blas_int > ipiv
void remove_row_and_column(const size_type row, const size_type col)
LAPACKFullMatrix< number > & operator/=(const number factor)
number determinant() const
void mmult(LAPACKFullMatrix< number > &C, const LAPACKFullMatrix< number > &B, const bool adding=false) const
void fill(const MatrixType &src, const size_type dst_offset_i=0, const size_type dst_offset_j=0, const size_type src_offset_i=0, const size_type src_offset_j=0, const number factor=1., const bool transpose=false)
void vmult(Vector< number > &, const Vector< number > &) const
SmartPointer< VectorMemory< Vector< number > >, PreconditionLU< number > > mem
void initialize(const LAPACKFullMatrix< number > &)
SmartPointer< const LAPACKFullMatrix< number >, PreconditionLU< number > > matrix
void Tvmult(Vector< number > &, const Vector< number > &) const
const TableIndices< N > & size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcInvalidState()
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcState(State arg1)
@ matrix
Contents is actually a matrix.
@ svd
Matrix contains singular value decomposition,.
@ inverse_svd
Matrix is the inverse of a singular value decomposition.
@ eigenvalues
Eigenvalue vector is filled.
SymmetricTensor< 2, dim, Number > C(const Tensor< 2, dim, Number > &F)
Tensor< 2, dim, Number > w(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
Iterator lower_bound(Iterator first, Iterator last, const T &val)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
std::array< std::pair< Number, Tensor< 1, dim, Number > >, std::integral_constant< int, dim >::value > eigenvectors(const SymmetricTensor< 2, dim, Number > &T, const SymmetricTensorEigenvectorMethod method=SymmetricTensorEigenvectorMethod::ql_implicit_shifts)