Go to the documentation of this file.
15 #include "../MatOp/internal/ArnoldiOp.h"
16 #include "../Util/TypeTraits.h"
17 #include "../Util/SimpleRandom.h"
30 template <
typename Scalar,
typename ArnoldiOpType>
71 SimpleRandom<Scalar>
rng(seed + 123 *
iter);
72 f.noalias() =
rng.random_vec(
m_n);
74 m_op.trans_product(
V,
f, Vf);
75 f.noalias() -=
V * Vf;
113 throw std::invalid_argument(
"initial residual vector cannot be zero");
119 v.noalias() =
v0 / v0norm;
123 m_op.perform_op(
v.data(),
w.data());
155 std::stringstream
msg;
156 msg <<
"Arnoldi: from_k (= " << from_k <<
") is larger than the current subspace dimension (= " <<
m_k <<
")";
157 throw std::invalid_argument(
msg.str());
170 for (
Index i = from_k;
i <= to_m - 1;
i++)
172 bool restart =
false;
199 m_op.trans_product(Vs,
w,
h);
211 Scalar ortho_err = Vf.head(
i1).cwiseAbs().maxCoeff();
231 h.noalias() += Vf.head(
i1);
236 ortho_err = Vf.head(
i1).cwiseAbs().maxCoeff();
271 Vs.col(
i).noalias() =
m_fac_V.leftCols(nnz) *
q;
Namespace containing all symbols from the Eigen library.
Index subspace_dim() const
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
void init(MapConstVec &v0, Index &op_counter)
const Matrix & matrix_H() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(DenseBase< OtherDerived > &other)
const Matrix & matrix_V() const
Eigen::Map< const Matrix > MapConstMat
Eigen::Map< const Vector > MapConstVec
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
const Vector & vector_f() const
void expand_basis(MapConstMat &V, const Index seed, Vector &f, Scalar &fnorm)
void matrix_QtHQ(Matrix &dest) const
Eigen::Map< Vector > MapVec
EIGEN_DEVICE_FUNC const Scalar & q
Arnoldi(const ArnoldiOpType &op, Index m)
A matrix or vector expression mapping an existing array of data.
void compress_H(const DoubleShiftQR< Scalar > &decomp)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
The quaternion class used to represent 3D orientations and rotations.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
void compress_H(const UpperHessenbergQR< Scalar > &decomp)
iterator iter(handle obj)
Eigen::Map< Matrix > MapMat
Array< int, Dynamic, 1 > v
virtual void factorize_from(Index from_k, Index to_m, Index &op_counter)
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar * data() const
void compress_V(const Matrix &Q)
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
virtual void matrix_QtHQ(Matrix &dest) const
Jet< T, N > sqrt(const Jet< T, N > &f)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:06