27template <
typename number>
38template <
typename number>
51template <
typename number>
57 typename std::vector<number>::const_iterator i;
58 typename std::vector<number>::const_iterator e;
61 for (i =
diagonal.begin(); i != e; ++i)
66 for (i = left.begin(); i != e; ++i)
71 for (i = right.begin(); i != e; ++i)
79template <
typename number>
83 const bool adding)
const
96 typename std::vector<number>::const_iterator d =
diagonal.begin();
97 typename std::vector<number>::const_iterator r = right.begin();
100 typename std::vector<number>::const_iterator l = left.begin();
109 w(0) += (*d) * v(0) + (*r) * v(1);
113 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
114 w(i) += (*l) * v(i - 1) + (*d) * v(i) + (*r) * v(i + 1);
116 w(e) += (*l) * v(e - 1) + (*d) * v(e);
120 w(0) = (*d) * v(0) + (*r) * v(1);
123 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
124 w(i) = (*l) * v(i - 1) + (*d) * v(i) + (*r) * v(i + 1);
125 w(e) = (*l) * v(e - 1) + (*d) * v(e);
130template <
typename number>
140template <
typename number>
144 const bool adding)
const
155 typename std::vector<number>::const_iterator d =
diagonal.begin();
156 typename std::vector<number>::const_iterator r = right.begin();
157 typename std::vector<number>::const_iterator l = left.begin();
165 w(0) += (*d) * v(0) + (*l) * v(1);
168 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
169 w(i) += (*l) * v(i + 1) + (*d) * v(i) + (*r) * v(i - 1);
170 w(e) += (*d) * v(e) + (*r) * v(e - 1);
174 w(0) = (*d) * v(0) + (*l) * v(1);
177 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
178 w(i) = (*l) * v(i + 1) + (*d) * v(i) + (*r) * v(i - 1);
179 w(e) = (*d) * v(e) + (*r) * v(e - 1);
185template <
typename number>
195template <
typename number>
203 typename std::vector<number>::const_iterator d =
diagonal.begin();
204 typename std::vector<number>::const_iterator r = right.begin();
205 typename std::vector<number>::const_iterator l = left.begin();
211 number result = w(0) * ((*d) * v(0) + (*r) * v(1));
214 for (
size_type i = 1; i < e; ++i, ++d, ++r, ++l)
215 result += w(i) * ((*l) * v(i - 1) + (*d) * v(i) + (*r) * v(i + 1));
216 result += w(e) * ((*l) * v(e - 1) + (*d) * v(e));
222template <
typename number>
226 return matrix_scalar_product(v, v);
231template <
typename number>
235#ifdef DEAL_II_WITH_LAPACK
245 static_cast<number *
>(
nullptr),
247 static_cast<number *
>(
nullptr),
259template <
typename number>
272#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
#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 > &)