16#ifndef dealii_householder_h
17#define dealii_householder_h
33template <
typename number>
78template <
typename number>
95 template <
typename number2>
103 template <
typename number2>
117 template <
typename number2>
124 template <
typename number2>
133 template <
class VectorType>
135 vmult(VectorType &dst,
const VectorType &src)
const;
141 template <
class VectorType>
143 Tvmult(VectorType &dst,
const VectorType &src)
const;
166template <
typename number>
167template <
typename number2>
171 const size_type m = M.n_rows(), n = M.n_cols();
172 storage.reinit(m, n);
178 Assert(storage.n_cols() <= storage.n_rows(),
186 for (i = j; i < m; ++i)
187 sigma += storage(i, j) * storage(i, j);
195 number2 beta =
std::sqrt(1. / (sigma - s * storage(j, j)));
200 diagonal[j] = beta * (storage(j, j) - s);
203 for (i = j + 1; i < m; ++i)
204 storage(i, j) *= beta;
212 for (i = j + 1; i < m; ++i)
213 sum += storage(i, j) * storage(i, k);
216 for (i = j + 1; i < m; ++i)
217 storage(i, k) -=
sum * storage(i, j);
224template <
typename number>
225template <
typename number2>
233template <
typename number>
234template <
typename number2>
243 const size_type m = storage.m(), n = storage.n();
247 aux->reinit(src,
true);
258 sum +=
static_cast<number2
>(storage(i, j)) * (*aux)(i);
262 (*aux)(i) -=
sum *
static_cast<number2
>(storage(i, j));
267 sum += (*aux)(i) * (*aux)(i);
271 storage.backward(dst, *aux);
278template <
typename number>
279template <
typename number2>
288 const size_type m = storage.m(), n = storage.n();
292 aux->reinit(src,
true);
303 sum += storage(i, j) * (*aux)(i);
307 (*aux)(i) -=
sum * storage(i, j);
312 sum += (*aux)(i) * (*aux)(i);
322 storage.backward(v_dst, v_aux);
331template <
typename number>
332template <
class VectorType>
336 least_squares(dst, src);
340template <
typename number>
341template <
class VectorType>
void fill(const FullMatrix< number2 > &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)
SymmetricTensor< rank, dim, Number > sum(const SymmetricTensor< rank, dim, Number > &local, const MPI_Comm &mpi_communicator)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertIsFinite(number)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void vmult(VectorType &dst, const VectorType &src) const
double least_squares(BlockVector< number2 > &dst, const BlockVector< number2 > &src) const
void Tvmult(VectorType &dst, const VectorType &src) const
double least_squares(Vector< number2 > &dst, const Vector< number2 > &src) const
std::vector< number > diagonal
FullMatrix< double > storage
Householder(const FullMatrix< number2 > &A)
void initialize(const FullMatrix< number2 > &A)
Expression fabs(const Expression &x)
@ diagonal
Matrix is diagonal.
types::global_dof_index size_type
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
unsigned int global_dof_index