Go to the documentation of this file.
7 #ifndef DOUBLE_SHIFT_QR_H
8 #define DOUBLE_SHIFT_QR_H
16 #include "../Util/TypeTraits.h"
20 template <
typename Scalar =
double>
76 x2x3 = Eigen::numext::hypot(
x2,
x3);
81 Scalar x1_new =
x1 - ((
x1 <= 0) - (
x1 > 0)) * Eigen::numext::hypot(
x1, x2x3);
82 Scalar x_norm = Eigen::numext::hypot(x1_new, x2x3);
89 u[0] = x1_new / x_norm;
103 const Index bsize = iu - il + 1;
145 for (
Index i = 1;
i < bsize - 2;
i++)
176 const Index nrow =
X.rows();
177 const Index ncol =
X.cols();
180 if (nr == 2 || nrow == 2)
182 for (
Index i = 0;
i < ncol;
i++, xptr += stride)
184 const Scalar tmp = u0_2 * xptr[0] + u1_2 * xptr[1];
193 for (
Index i = 0;
i < ncol;
i++, xptr += stride)
195 const Scalar tmp = u0_2 * xptr[0] + u1_2 * xptr[1] + u2_2 * xptr[2];
216 const bool nr_is_2 = (nr == 2);
236 const int nrow =
X.rows();
237 const int ncol =
X.cols();
238 Scalar *X0 =
X.data(), *
X1 = X0 + stride;
240 if (nr == 2 || ncol == 2)
247 const Scalar tmp = u0_2 * X0[
i] + u1_2 *
X1[
i];
259 const Scalar tmp = u0_2 * X0[
i] + u1_2 *
X1[
i] + u2_2 *
X2[
i];
299 throw std::invalid_argument(
"DoubleShiftQR: matrix must be square");
312 std::vector<int> zero_ind;
313 zero_ind.reserve(
m_n - 1);
314 zero_ind.push_back(0);
323 zero_ind.push_back(
i + 1);
329 zero_ind.push_back(
m_n);
331 for (std::vector<int>::size_type
i = 0;
i < zero_ind.size() - 1;
i++)
333 const Index start = zero_ind[
i];
345 throw std::logic_error(
"DoubleShiftQR: need to call compute() first");
355 throw std::logic_error(
"DoubleShiftQR: need to call compute() first");
370 throw std::logic_error(
"DoubleShiftQR: need to call compute() first");
372 const Index nrow =
Y.rows();
384 #endif // DOUBLE_SHIFT_QR_H
Namespace containing all symbols from the Eigen library.
Eigen::Array< unsigned char, Eigen::Dynamic, 1 > IntArray
GaussianFactorGraphValuePair Y
void apply_XP(GenericMatrix X, Index stride, Index u_ind) const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
const typedef Eigen::Ref< const Matrix > ConstGenericMatrix
void compute_reflector(const Scalar &x1, const Scalar &x2, const Scalar &x3, Index ind)
void compute(ConstGenericMatrix &mat, const Scalar &s, const Scalar &t)
DoubleShiftQR(Index size)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
void apply_YQ(GenericMatrix Y) const
Pose3 x3(Rot3::Ypr(M_PI/4.0, 0.0, 0.0), l2)
void matrix_QtHQ(Matrix &dest) const
void compute_reflector(const Scalar *x, Index ind)
void update_block(Index il, Index iu)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & coeff(Index rowId, Index colId) const
void apply_PX(Scalar *x, Index u_ind) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
A matrix or vector expression mapping an existing expression.
void apply_PX(GenericMatrix X, Index stride, Index u_ind) const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & coeff(Index rowId, Index colId) const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar * data() const
DoubleShiftQR(ConstGenericMatrix &mat, const Scalar &s, const Scalar &t)
static const EIGEN_DEPRECATED end_t end
Eigen::Matrix< Scalar, 3, Eigen::Dynamic > Matrix3X
Eigen::Ref< Matrix > GenericMatrix
void apply_QtY(Vector &y) const
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:14