26template <
typename number>
37template <
typename number>
50template <
typename number>
56 typename std::vector<number>::const_iterator i;
57 typename std::vector<number>::const_iterator e;
60 for (i =
diagonal.begin(); i != e; ++i)
65 for (i = left.begin(); i != e; ++i)
70 for (i = right.begin(); i != e; ++i)
78template <
typename number>
82 const bool adding)
const
95 typename std::vector<number>::const_iterator d =
diagonal.begin();
96 typename std::vector<number>::const_iterator r = right.begin();
99 typename std::vector<number>::const_iterator l = left.begin();
108 w(0) += (*d) * v(0) + (*r) * v(1);
112 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
113 w(i) += (*l) * v(i - 1) + (*d) * v(i) + (*r) * v(i + 1);
115 w(e) += (*l) * v(e - 1) + (*d) * v(e);
119 w(0) = (*d) * v(0) + (*r) * v(1);
122 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
123 w(i) = (*l) * v(i - 1) + (*d) * v(i) + (*r) * v(i + 1);
124 w(e) = (*l) * v(e - 1) + (*d) * v(e);
129template <
typename number>
139template <
typename number>
143 const bool adding)
const
154 typename std::vector<number>::const_iterator d =
diagonal.begin();
155 typename std::vector<number>::const_iterator r = right.begin();
156 typename std::vector<number>::const_iterator l = left.begin();
164 w(0) += (*d) * v(0) + (*l) * v(1);
167 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
168 w(i) += (*l) * v(i + 1) + (*d) * v(i) + (*r) * v(i - 1);
169 w(e) += (*d) * v(e) + (*r) * v(e - 1);
173 w(0) = (*d) * v(0) + (*l) * v(1);
176 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
177 w(i) = (*l) * v(i + 1) + (*d) * v(i) + (*r) * v(i - 1);
178 w(e) = (*d) * v(e) + (*r) * v(e - 1);
184template <
typename number>
194template <
typename number>
202 typename std::vector<number>::const_iterator d =
diagonal.begin();
203 typename std::vector<number>::const_iterator r = right.begin();
204 typename std::vector<number>::const_iterator l = left.begin();
210 number result = w(0) * ((*d) * v(0) + (*r) * v(1));
213 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
214 result += w(i) * ((*l) * v(i - 1) + (*d) * v(i) + (*r) * v(i + 1));
215 result += w(e) * ((*l) * v(e - 1) + (*d) * v(e));
221template <
typename number>
225 return matrix_scalar_product(v, v);
230template <
typename number>
234#ifdef DEAL_II_WITH_LAPACK
244 static_cast<number *
>(
nullptr),
246 static_cast<number *
>(
nullptr),
258template <
typename number>
271#ifdef DEAL_II_WITH_COMPLEX_VALUES
void Tvmult_add(Vector< number > &w, const Vector< number > &v) const
void vmult(Vector< number > &w, const Vector< number > &v, const bool adding=false) const
number matrix_norm_square(const Vector< number > &v) const
void reinit(size_type n, bool symmetric=false)
void vmult_add(Vector< number > &w, const Vector< number > &v) const
void compute_eigenvalues()
void Tvmult(Vector< number > &w, const Vector< number > &v, const bool adding=false) const
number eigenvalue(const size_type i) const
TridiagonalMatrix(size_type n=0, bool symmetric=false)
number matrix_scalar_product(const Vector< number > &u, const Vector< number > &v) const
virtual size_type size() const override
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNeedsLAPACK()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcState(State arg1)
#define AssertThrow(cond, exc)
void stev(const char *, const ::types::blas_int *, number1 *, number2 *, number3 *, const ::types::blas_int *, number4 *, ::types::blas_int *)
@ matrix
Contents is actually a matrix.
@ eigenvalues
Eigenvalue vector is filled.
@ symmetric
Matrix is symmetric.
@ diagonal
Matrix is diagonal.
static const types::blas_int one
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)