UpperHessenbergSchur.h
Go to the documentation of this file.
1 // The code was adapted from Eigen/src/Eigenvaleus/RealSchur.h
2 //
3 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
4 // Copyright (C) 2010,2012 Jitse Niesen <jitse@maths.leeds.ac.uk>
5 // Copyright (C) 2021-2025 Yixuan Qiu <yixuan.qiu@cos.name>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
10 
11 #ifndef SPECTRA_UPPER_HESSENBERG_SCHUR_H
12 #define SPECTRA_UPPER_HESSENBERG_SCHUR_H
13 
14 #include <Eigen/Core>
15 #include <Eigen/Jacobi>
16 #include <Eigen/Householder>
17 #include <stdexcept>
18 
19 #include "../Util/TypeTraits.h"
20 
21 namespace Spectra {
22 
23 template <typename Scalar = double>
25 {
26 private:
34 
35  Index m_n; // Size of the matrix
36  Matrix m_T; // T matrix, A = UTU'
37  Matrix m_U; // U matrix, A = UTU'
38  bool m_computed;
39 
40  // L1 norm of an upper Hessenberg matrix
42  {
43  const Index n = x.cols();
44  Scalar norm(0);
45  for (Index j = 0; j < n; j++)
46  norm += x.col(j).segment(0, (std::min)(n, j + 2)).cwiseAbs().sum();
47  return norm;
48  }
49 
50  // Look for single small sub-diagonal element and returns its index
51  Index find_small_subdiag(Index iu, const Scalar& near_0) const
52  {
53  using std::abs;
54 
56  Index res = iu;
57  while (res > 0)
58  {
59  Scalar s = abs(m_T.coeff(res - 1, res - 1)) + abs(m_T.coeff(res, res));
60  s = Eigen::numext::maxi<Scalar>(s * eps, near_0);
61  if (abs(m_T.coeff(res, res - 1)) <= s)
62  break;
63  res--;
64  }
65 
66  return res;
67  }
68 
69  // Update T given that rows iu-1 and iu decouple from the rest
70  void split_off_two_rows(Index iu, const Scalar& ex_shift)
71  {
72  using std::sqrt;
73  using std::abs;
74 
75  // The eigenvalues of the 2x2 matrix [a b; c d] are
76  // trace +/- sqrt(discr/4) where discr = tr^2 - 4*det, tr = a + d, det = ad - bc
77  Scalar p = Scalar(0.5) * (m_T.coeff(iu - 1, iu - 1) - m_T.coeff(iu, iu));
78  Scalar q = p * p + m_T.coeff(iu, iu - 1) * m_T.coeff(iu - 1, iu); // q = tr^2 / 4 - det = discr/4
79  m_T.coeffRef(iu, iu) += ex_shift;
80  m_T.coeffRef(iu - 1, iu - 1) += ex_shift;
81 
82  if (q >= Scalar(0)) // Two real eigenvalues
83  {
84  Scalar z = sqrt(abs(q));
86  rot.makeGivens((p >= Scalar(0)) ? (p + z) : (p - z), m_T.coeff(iu, iu - 1));
87  m_T.rightCols(m_n - iu + 1).applyOnTheLeft(iu - 1, iu, rot.adjoint());
88  m_T.topRows(iu + 1).applyOnTheRight(iu - 1, iu, rot);
89  m_T.coeffRef(iu, iu - 1) = Scalar(0);
90  m_U.applyOnTheRight(iu - 1, iu, rot);
91  }
92  if (iu > 1)
93  m_T.coeffRef(iu - 1, iu - 2) = Scalar(0);
94  }
95 
96  // Form shift in shift_info, and update ex_shift if an exceptional shift is performed
97  void compute_shift(Index iu, Index iter, Scalar& ex_shift, Vector3s& shift_info)
98  {
99  using std::sqrt;
100  using std::abs;
101 
102  shift_info.coeffRef(0) = m_T.coeff(iu, iu);
103  shift_info.coeffRef(1) = m_T.coeff(iu - 1, iu - 1);
104  shift_info.coeffRef(2) = m_T.coeff(iu, iu - 1) * m_T.coeff(iu - 1, iu);
105 
106  // Wilkinson's original ad hoc shift
107  if (iter == 10)
108  {
109  ex_shift += shift_info.coeff(0);
110  for (Index i = 0; i <= iu; ++i)
111  m_T.coeffRef(i, i) -= shift_info.coeff(0);
112  Scalar s = abs(m_T.coeff(iu, iu - 1)) + abs(m_T.coeff(iu - 1, iu - 2));
113  shift_info.coeffRef(0) = Scalar(0.75) * s;
114  shift_info.coeffRef(1) = Scalar(0.75) * s;
115  shift_info.coeffRef(2) = Scalar(-0.4375) * s * s;
116  }
117 
118  // MATLAB's new ad hoc shift
119  if (iter == 30)
120  {
121  Scalar s = (shift_info.coeff(1) - shift_info.coeff(0)) / Scalar(2);
122  s = s * s + shift_info.coeff(2);
123  if (s > Scalar(0))
124  {
125  s = sqrt(s);
126  if (shift_info.coeff(1) < shift_info.coeff(0))
127  s = -s;
128  s = s + (shift_info.coeff(1) - shift_info.coeff(0)) / Scalar(2);
129  s = shift_info.coeff(0) - shift_info.coeff(2) / s;
130  ex_shift += s;
131  for (Index i = 0; i <= iu; ++i)
132  m_T.coeffRef(i, i) -= s;
133  shift_info.setConstant(Scalar(0.964));
134  }
135  }
136  }
137 
138  // Compute index im at which Francis QR step starts and the first Householder vector
139  void init_francis_qr_step(Index il, Index iu, const Vector3s& shift_info, Index& im, Vector3s& first_householder_vec) const
140  {
141  using std::abs;
142 
144  Vector3s& v = first_householder_vec; // alias to save typing
145  for (im = iu - 2; im >= il; --im)
146  {
147  const Scalar Tmm = m_T.coeff(im, im);
148  const Scalar r = shift_info.coeff(0) - Tmm;
149  const Scalar s = shift_info.coeff(1) - Tmm;
150  v.coeffRef(0) = (r * s - shift_info.coeff(2)) / m_T.coeff(im + 1, im) + m_T.coeff(im, im + 1);
151  v.coeffRef(1) = m_T.coeff(im + 1, im + 1) - Tmm - r - s;
152  v.coeffRef(2) = m_T.coeff(im + 2, im + 1);
153  if (im == il)
154  break;
155  const Scalar lhs = m_T.coeff(im, im - 1) * (abs(v.coeff(1)) + abs(v.coeff(2)));
156  const Scalar rhs = v.coeff(0) * (abs(m_T.coeff(im - 1, im - 1)) + abs(Tmm) + abs(m_T.coeff(im + 1, im + 1)));
157  if (abs(lhs) < eps * rhs)
158  break;
159  }
160  }
161 
162  // P = I - tau * v * v' = P'
163  // PX = X - tau * v * (v'X), X [3 x c]
164  static void apply_householder_left(const Vector2s& ess, const Scalar& tau, Scalar* x, Index ncol, Index stride)
165  {
166  const Scalar v1 = ess.coeff(0), v2 = ess.coeff(1);
167  const Scalar* const x_end = x + ncol * stride;
168  for (; x < x_end; x += stride)
169  {
170  const Scalar tvx = tau * (x[0] + v1 * x[1] + v2 * x[2]);
171  x[0] -= tvx;
172  x[1] -= tvx * v1;
173  x[2] -= tvx * v2;
174  }
175  }
176 
177  // P = I - tau * v * v' = P'
178  // XP = X - tau * (X * v) * v', X [r x 3]
179  static void apply_householder_right(const Vector2s& ess, const Scalar& tau, Scalar* x, Index nrow, Index stride)
180  {
181  const Scalar v1 = ess.coeff(0), v2 = ess.coeff(1);
182  Scalar* x0 = x;
183  Scalar* x1 = x + stride;
184  Scalar* x2 = x1 + stride;
185  for (Index i = 0; i < nrow; i++)
186  {
187  const Scalar txv = tau * (x0[i] + v1 * x1[i] + v2 * x2[i]);
188  x0[i] -= txv;
189  x1[i] -= txv * v1;
190  x2[i] -= txv * v2;
191  }
192  }
193 
194  // SIMD version of apply_householder_right()
195  // Inspired by apply_rotation_in_the_plane_selector() in Eigen/src/Jacobi/Jacobi.h
196  static void apply_householder_right_simd(const Vector2s& ess, const Scalar& tau, Scalar* x, Index nrow, Index stride)
197  {
198  // Packet type
202  using Eigen::internal::padd;
203  using Eigen::internal::psub;
204  using Eigen::internal::pmul;
206  constexpr unsigned char PacketSize = Eigen::internal::packet_traits<Scalar>::size;
207  constexpr unsigned char Peeling = 2;
208  constexpr unsigned char Increment = Peeling * PacketSize;
209 
210  // Column heads
211  Scalar* x0 = x;
212  Scalar* x1 = x + stride;
213  Scalar* x2 = x1 + stride;
214  // Pointers for the current row
215  Scalar* px0 = x0;
216  Scalar* px1 = x1;
217  Scalar* px2 = x2;
218 
219  // Householder reflectors
220  const Scalar v1 = ess.coeff(0), v2 = ess.coeff(1);
221  // Vectorized versions
222  const Packet vtau = pset1<Packet>(tau);
223  const Packet vv1 = pset1<Packet>(v1);
224  const Packet vv2 = pset1<Packet>(v2);
225 
226  // n % (2^k) == n & (2^k-1), see https://stackoverflow.com/q/3072665
227  // const Index peeling_end = nrow - nrow % Increment;
228  const Index aligned_end = nrow - (nrow & (PacketSize - 1));
229  const Index peeling_end = nrow - (nrow & (Increment - 1));
230  for (Index i = 0; i < peeling_end; i += Increment)
231  {
232  Packet vx01 = ploadu<Packet>(px0);
233  Packet vx02 = ploadu<Packet>(px0 + PacketSize);
234  Packet vx11 = ploadu<Packet>(px1);
235  Packet vx12 = ploadu<Packet>(px1 + PacketSize);
236  Packet vx21 = ploadu<Packet>(px2);
237  Packet vx22 = ploadu<Packet>(px2 + PacketSize);
238 
239  // Packet txv1 = vtau * (vx01 + vv1 * vx11 + vv2 * vx21);
240  Packet txv1 = pmul(vtau, padd(padd(vx01, pmul(vv1, vx11)), pmul(vv2, vx21)));
241  Packet txv2 = pmul(vtau, padd(padd(vx02, pmul(vv1, vx12)), pmul(vv2, vx22)));
242 
243  pstoreu(px0, psub(vx01, txv1));
244  pstoreu(px0 + PacketSize, psub(vx02, txv2));
245  pstoreu(px1, psub(vx11, pmul(txv1, vv1)));
246  pstoreu(px1 + PacketSize, psub(vx12, pmul(txv2, vv1)));
247  pstoreu(px2, psub(vx21, pmul(txv1, vv2)));
248  pstoreu(px2 + PacketSize, psub(vx22, pmul(txv2, vv2)));
249 
250  px0 += Increment;
251  px1 += Increment;
252  px2 += Increment;
253  }
254  if (aligned_end != peeling_end)
255  {
256  px0 = x0 + peeling_end;
257  px1 = x1 + peeling_end;
258  px2 = x2 + peeling_end;
259 
260  Packet x0_p = ploadu<Packet>(px0);
261  Packet x1_p = ploadu<Packet>(px1);
262  Packet x2_p = ploadu<Packet>(px2);
263  Packet txv = pmul(vtau, padd(padd(x0_p, pmul(vv1, x1_p)), pmul(vv2, x2_p)));
264 
265  pstoreu(px0, psub(x0_p, txv));
266  pstoreu(px1, psub(x1_p, pmul(txv, vv1)));
267  pstoreu(px2, psub(x2_p, pmul(txv, vv2)));
268  }
269 
270  // Remaining rows
271  for (Index i = aligned_end; i < nrow; i++)
272  {
273  const Scalar txv = tau * (x0[i] + v1 * x1[i] + v2 * x2[i]);
274  x0[i] -= txv;
275  x1[i] -= txv * v1;
276  x2[i] -= txv * v2;
277  }
278  }
279 
280  // Perform a Francis QR step involving rows il:iu and columns im:iu
281  void perform_francis_qr_step(Index il, Index im, Index iu, const Vector3s& first_householder_vec, const Scalar& near_0)
282  {
283  using std::abs;
284 
285  for (Index k = im; k <= iu - 2; ++k)
286  {
287  const bool first_iter = (k == im);
288  Vector3s v;
289  if (first_iter)
290  v = first_householder_vec;
291  else
292  v = m_T.template block<3, 1>(k, k - 1);
293 
294  Scalar tau, beta;
295  Vector2s ess;
296  v.makeHouseholder(ess, tau, beta);
297 
298  if (abs(beta) > near_0) // if v is not zero
299  {
300  if (first_iter && k > il)
301  m_T.coeffRef(k, k - 1) = -m_T.coeff(k, k - 1);
302  else if (!first_iter)
303  m_T.coeffRef(k, k - 1) = beta;
304 
305  // These Householder transformations form the O(n^3) part of the algorithm
306  // m_T.block(k, k, 3, m_n - k).applyHouseholderOnTheLeft(ess, tau, workspace);
307  // m_T.block(0, k, (std::min)(iu, k + 3) + 1, 3).applyHouseholderOnTheRight(ess, tau, workspace);
308  // m_U.block(0, k, m_n, 3).applyHouseholderOnTheRight(ess, tau, workspace);
309  apply_householder_left(ess, tau, &m_T.coeffRef(k, k), m_n - k, m_n);
310  apply_householder_right_simd(ess, tau, &m_T.coeffRef(0, k), (std::min)(iu, k + 3) + 1, m_n);
311  apply_householder_right_simd(ess, tau, &m_U.coeffRef(0, k), m_n, m_n);
312  }
313  }
314 
315  // The last 2-row block
317  Scalar beta;
318  rot.makeGivens(m_T.coeff(iu - 1, iu - 2), m_T.coeff(iu, iu - 2), &beta);
319 
320  if (abs(beta) > near_0) // if v is not zero
321  {
322  m_T.coeffRef(iu - 1, iu - 2) = beta;
323  m_T.rightCols(m_n - iu + 1).applyOnTheLeft(iu - 1, iu, rot.adjoint());
324  m_T.topRows(iu + 1).applyOnTheRight(iu - 1, iu, rot);
325  m_U.applyOnTheRight(iu - 1, iu, rot);
326  }
327 
328  // clean up pollution due to round-off errors
329  for (Index i = im + 2; i <= iu; ++i)
330  {
331  m_T.coeffRef(i, i - 2) = Scalar(0);
332  if (i > im + 2)
333  m_T.coeffRef(i, i - 3) = Scalar(0);
334  }
335  }
336 
337 public:
339  m_n(0), m_computed(false)
340  {}
341 
343  m_n(mat.rows()), m_computed(false)
344  {
345  compute(mat);
346  }
347 
349  {
350  using std::abs;
351  using std::sqrt;
352 
353  if (mat.rows() != mat.cols())
354  throw std::invalid_argument("UpperHessenbergSchur: matrix must be square");
355 
356  m_n = mat.rows();
357  m_T.resize(m_n, m_n);
358  m_U.resize(m_n, m_n);
359  constexpr Index max_iter_per_row = 40;
360  const Index max_iter = m_n * max_iter_per_row;
361 
362  m_T.noalias() = mat;
363  m_U.setIdentity();
364 
365  // The matrix m_T is divided in three parts.
366  // Rows 0,...,il-1 are decoupled from the rest because m_T(il,il-1) is zero.
367  // Rows il,...,iu is the part we are working on (the active window).
368  // Rows iu+1,...,end are already brought in triangular form.
369  Index iu = m_n - 1;
370  Index iter = 0; // iteration count for current eigenvalue
371  Index total_iter = 0; // iteration count for whole matrix
372  Scalar ex_shift(0); // sum of exceptional shifts
373  const Scalar norm = upper_hessenberg_l1_norm(m_T);
374  // sub-diagonal entries smaller than near_0 will be treated as zero.
375  // We use eps^2 to enable more precision in small eigenvalues.
377  const Scalar near_0 = Eigen::numext::maxi<Scalar>(norm * eps * eps, TypeTraits<Scalar>::min());
378 
379  if (norm != Scalar(0))
380  {
381  while (iu >= 0)
382  {
383  Index il = find_small_subdiag(iu, near_0);
384 
385  // Check for convergence
386  if (il == iu) // One root found
387  {
388  m_T.coeffRef(iu, iu) += ex_shift;
389  if (iu > 0)
390  m_T.coeffRef(iu, iu - 1) = Scalar(0);
391  iu--;
392  iter = 0;
393  }
394  else if (il == iu - 1) // Two roots found
395  {
396  split_off_two_rows(iu, ex_shift);
397  iu -= 2;
398  iter = 0;
399  }
400  else // No convergence yet
401  {
402  Vector3s first_householder_vec = Vector3s::Zero(), shift_info;
403  compute_shift(iu, iter, ex_shift, shift_info);
404  iter++;
405  total_iter++;
406  if (total_iter > max_iter)
407  break;
408  Index im;
409  init_francis_qr_step(il, iu, shift_info, im, first_householder_vec);
410  perform_francis_qr_step(il, im, iu, first_householder_vec, near_0);
411  }
412  }
413  }
414 
415  if (total_iter > max_iter)
416  throw std::runtime_error("UpperHessenbergSchur: Schur decomposition failed");
417 
418  m_computed = true;
419  }
420 
421  const Matrix& matrix_T() const
422  {
423  if (!m_computed)
424  throw std::logic_error("UpperHessenbergSchur: need to call compute() first");
425 
426  return m_T;
427  }
428 
429  const Matrix& matrix_U() const
430  {
431  if (!m_computed)
432  throw std::logic_error("UpperHessenbergSchur: need to call compute() first");
433 
434  return m_U;
435  }
436 
438  {
439  m_T.swap(other);
440  }
441 
443  {
444  m_U.swap(other);
445  }
446 };
447 
448 } // namespace Spectra
449 
450 #endif // SPECTRA_UPPER_HESSENBERG_SCHUR_H
Spectra::UpperHessenbergSchur::apply_householder_left
static void apply_householder_left(const Vector2s &ess, const Scalar &tau, Scalar *x, Index ncol, Index stride)
Definition: UpperHessenbergSchur.h:164
Spectra::UpperHessenbergSchur::m_n
Index m_n
Definition: UpperHessenbergSchur.h:35
Eigen::internal::pstoreu
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:700
Spectra::UpperHessenbergSchur::matrix_T
const Matrix & matrix_T() const
Definition: UpperHessenbergSchur.h:421
s
RealScalar s
Definition: level1_cplx_impl.h:126
Eigen::PlainObjectBase::swap
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(DenseBase< OtherDerived > &other)
Definition: PlainObjectBase.h:953
x
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
Definition: gnuplot_common_settings.hh:12
Eigen::internal::packet_traits
Definition: GenericPacketMath.h:106
Spectra::UpperHessenbergSchur::UpperHessenbergSchur
UpperHessenbergSchur()
Definition: UpperHessenbergSchur.h:338
Spectra::UpperHessenbergSchur::find_small_subdiag
Index find_small_subdiag(Index iu, const Scalar &near_0) const
Definition: UpperHessenbergSchur.h:51
Spectra::UpperHessenbergSchur::m_computed
bool m_computed
Definition: UpperHessenbergSchur.h:38
Spectra::UpperHessenbergSchur::compute_shift
void compute_shift(Index iu, Index iter, Scalar &ex_shift, Vector3s &shift_info)
Definition: UpperHessenbergSchur.h:97
mat
MatrixXf mat
Definition: Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
res
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
Eigen::PlainObjectBase::resize
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:271
Eigen::JacobiRotation
Rotation given by a cosine-sine pair.
Definition: ForwardDeclarations.h:283
beta
double beta(double a, double b)
Definition: beta.c:61
rot
int EIGEN_BLAS_FUNC() rot(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, RealScalar *ps)
Definition: level1_real_impl.h:79
rows
int rows
Definition: Tutorial_commainit_02.cpp:1
Spectra::UpperHessenbergSchur::init_francis_qr_step
void init_francis_qr_step(Index il, Index iu, const Vector3s &shift_info, Index &im, Vector3s &first_householder_vec) const
Definition: UpperHessenbergSchur.h:139
n
int n
Definition: BiCGSTAB_simple.cpp:1
epsilon
static double epsilon
Definition: testRot3.cpp:37
Eigen::PlainObjectBase::setConstant
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
Definition: CwiseNullaryOp.h:361
Spectra::UpperHessenbergSchur::apply_householder_right
static void apply_householder_right(const Vector2s &ess, const Scalar &tau, Scalar *x, Index nrow, Index stride)
Definition: UpperHessenbergSchur.h:179
j
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
Eigen::numext::q
EIGEN_DEVICE_FUNC const Scalar & q
Definition: SpecialFunctionsImpl.h:1984
x1
Pose3 x1
Definition: testPose3.cpp:692
Spectra::UpperHessenbergSchur::compute
void compute(ConstGenericMatrix &mat)
Definition: UpperHessenbergSchur.h:348
Spectra::UpperHessenbergSchur< double >::Index
Eigen::Index Index
Definition: UpperHessenbergSchur.h:27
x0
static Symbol x0('x', 0)
Eigen::Matrix::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
Definition: PlainObjectBase.h:175
Spectra::UpperHessenbergSchur::m_T
Matrix m_T
Definition: UpperHessenbergSchur.h:36
Eigen::internal::psub
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:222
pybind_wrapper_test_script.z
z
Definition: pybind_wrapper_test_script.py:61
Eigen::Triplet< double >
Spectra::UpperHessenbergSchur::upper_hessenberg_l1_norm
static Scalar upper_hessenberg_l1_norm(ConstGenericMatrix &x)
Definition: UpperHessenbergSchur.h:41
Spectra::UpperHessenbergSchur::swap_U
void swap_U(Matrix &other)
Definition: UpperHessenbergSchur.h:442
Spectra::UpperHessenbergSchur::apply_householder_right_simd
static void apply_householder_right_simd(const Vector2s &ess, const Scalar &tau, Scalar *x, Index nrow, Index stride)
Definition: UpperHessenbergSchur.h:196
Spectra::UpperHessenbergSchur::perform_francis_qr_step
void perform_francis_qr_step(Index il, Index im, Index iu, const Vector3s &first_householder_vec, const Scalar &near_0)
Definition: UpperHessenbergSchur.h:281
Eigen::Ref
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:281
Spectra::UpperHessenbergSchur::matrix_U
const Matrix & matrix_U() const
Definition: UpperHessenbergSchur.h:429
Eigen::internal::pmul
EIGEN_DEVICE_FUNC Packet pmul(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:237
Spectra::UpperHessenbergSchur::swap_T
void swap_T(Matrix &other)
Definition: UpperHessenbergSchur.h:437
iter
iterator iter(handle obj)
Definition: pytypes.h:2477
p
float * p
Definition: Tutorial_Map_using.cpp:9
v2
Vector v2
Definition: testSerializationBase.cpp:39
Eigen::PlainObjectBase::coeff
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & coeff(Index rowId, Index colId) const
Definition: PlainObjectBase.h:152
Spectra
Definition: LOBPCGSolver.h:19
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
Spectra::UpperHessenbergSchur
Definition: UpperHessenbergSchur.h:24
Spectra::UpperHessenbergSchur::split_off_two_rows
void split_off_two_rows(Index iu, const Scalar &ex_shift)
Definition: UpperHessenbergSchur.h:70
Eigen::internal::padd
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:215
min
#define min(a, b)
Definition: datatypes.h:19
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >
abs
#define abs(x)
Definition: datatypes.h:17
Eigen::internal::pset1
EIGEN_DEVICE_FUNC Packet pset1(const typename unpacket_traits< Packet >::type &a)
Definition: GenericPacketMath.h:615
Spectra::UpperHessenbergSchur::m_U
Matrix m_U
Definition: UpperHessenbergSchur.h:37
Eigen::internal::ploadu
EIGEN_DEVICE_FUNC Packet ploadu(const typename unpacket_traits< Packet >::type *from)
Definition: GenericPacketMath.h:603
x2
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
ceres::sqrt
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:418
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
Spectra::UpperHessenbergSchur::UpperHessenbergSchur
UpperHessenbergSchur(ConstGenericMatrix &mat)
Definition: UpperHessenbergSchur.h:342
v1
Vector v1
Definition: testSerializationBase.cpp:38
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74


gtsam
Author(s):
autogenerated on Wed Apr 16 2025 03:10:02