MatrixPower.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2012, 2013 Chen-Pang He <jdh8@ms63.hinet.net>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_MATRIX_POWER
11 #define EIGEN_MATRIX_POWER
12 
13 namespace Eigen {
14 
15 template<typename MatrixType> class MatrixPower;
16 
30 /* TODO This class is only used by MatrixPower, so it should be nested
31  * into MatrixPower, like MatrixPower::ReturnValue. However, my
32  * compiler complained about unused template parameter in the
33  * following declaration in namespace internal.
34  *
35  * template<typename MatrixType>
36  * struct traits<MatrixPower<MatrixType>::ReturnValue>;
37  */
38 template<typename MatrixType>
39 class MatrixPowerParenthesesReturnValue : public ReturnByValue< MatrixPowerParenthesesReturnValue<MatrixType> >
40 {
41  public:
43 
51  { }
52 
58  template<typename ResultType>
59  inline void evalTo(ResultType& result) const
60  { m_pow.compute(result, m_p); }
61 
62  Index rows() const { return m_pow.rows(); }
63  Index cols() const { return m_pow.cols(); }
64 
65  private:
67  const RealScalar m_p;
68 };
69 
85 template<typename MatrixType>
87 {
88  private:
89  enum {
90  RowsAtCompileTime = MatrixType::RowsAtCompileTime,
91  MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime
92  };
93  typedef typename MatrixType::Scalar Scalar;
95  typedef std::complex<RealScalar> ComplexScalar;
97 
98  const MatrixType& m_A;
100 
101  void computePade(int degree, const MatrixType& IminusT, ResultType& res) const;
102  void compute2x2(ResultType& res, RealScalar p) const;
103  void computeBig(ResultType& res) const;
104  static int getPadeDegree(float normIminusT);
105  static int getPadeDegree(double normIminusT);
106  static int getPadeDegree(long double normIminusT);
109 
110  public:
123 
130  void compute(ResultType& res) const;
131 };
132 
133 template<typename MatrixType>
135  m_A(T), m_p(p)
136 {
137  eigen_assert(T.rows() == T.cols());
138  eigen_assert(p > -1 && p < 1);
139 }
140 
141 template<typename MatrixType>
143 {
144  using std::pow;
145  switch (m_A.rows()) {
146  case 0:
147  break;
148  case 1:
149  res(0,0) = pow(m_A(0,0), m_p);
150  break;
151  case 2:
152  compute2x2(res, m_p);
153  break;
154  default:
155  computeBig(res);
156  }
157 }
158 
159 template<typename MatrixType>
161 {
162  int i = 2*degree;
163  res = (m_p-RealScalar(degree)) / RealScalar(2*i-2) * IminusT;
164 
165  for (--i; i; --i) {
166  res = (MatrixType::Identity(IminusT.rows(), IminusT.cols()) + res).template triangularView<Upper>()
167  .solve((i==1 ? -m_p : i&1 ? (-m_p-RealScalar(i/2))/RealScalar(2*i) : (m_p-RealScalar(i/2))/RealScalar(2*i-2)) * IminusT).eval();
168  }
169  res += MatrixType::Identity(IminusT.rows(), IminusT.cols());
170 }
171 
172 // This function assumes that res has the correct size (see bug 614)
173 template<typename MatrixType>
175 {
176  using std::abs;
177  using std::pow;
178  res.coeffRef(0,0) = pow(m_A.coeff(0,0), p);
179 
180  for (Index i=1; i < m_A.cols(); ++i) {
181  res.coeffRef(i,i) = pow(m_A.coeff(i,i), p);
182  if (m_A.coeff(i-1,i-1) == m_A.coeff(i,i))
183  res.coeffRef(i-1,i) = p * pow(m_A.coeff(i,i), p-1);
184  else if (2*abs(m_A.coeff(i-1,i-1)) < abs(m_A.coeff(i,i)) || 2*abs(m_A.coeff(i,i)) < abs(m_A.coeff(i-1,i-1)))
185  res.coeffRef(i-1,i) = (res.coeff(i,i)-res.coeff(i-1,i-1)) / (m_A.coeff(i,i)-m_A.coeff(i-1,i-1));
186  else
187  res.coeffRef(i-1,i) = computeSuperDiag(m_A.coeff(i,i), m_A.coeff(i-1,i-1), p);
188  res.coeffRef(i-1,i) *= m_A.coeff(i-1,i);
189  }
190 }
191 
192 template<typename MatrixType>
194 {
195  using std::ldexp;
196  const int digits = std::numeric_limits<RealScalar>::digits;
197  const RealScalar maxNormForPade = RealScalar(
198  digits <= 24? 4.3386528e-1L // single precision
199  : digits <= 53? 2.789358995219730e-1L // double precision
200  : digits <= 64? 2.4471944416607995472e-1L // extended precision
201  : digits <= 106? 1.1016843812851143391275867258512e-1L // double-double
202  : 9.134603732914548552537150753385375e-2L); // quadruple precision
203  MatrixType IminusT, sqrtT, T = m_A.template triangularView<Upper>();
204  RealScalar normIminusT;
205  int degree, degree2, numberOfSquareRoots = 0;
206  bool hasExtraSquareRoot = false;
207 
208  for (Index i=0; i < m_A.cols(); ++i)
209  eigen_assert(m_A(i,i) != RealScalar(0));
210 
211  while (true) {
212  IminusT = MatrixType::Identity(m_A.rows(), m_A.cols()) - T;
213  normIminusT = IminusT.cwiseAbs().colwise().sum().maxCoeff();
214  if (normIminusT < maxNormForPade) {
215  degree = getPadeDegree(normIminusT);
216  degree2 = getPadeDegree(normIminusT/2);
217  if (degree - degree2 <= 1 || hasExtraSquareRoot)
218  break;
219  hasExtraSquareRoot = true;
220  }
221  matrix_sqrt_triangular(T, sqrtT);
222  T = sqrtT.template triangularView<Upper>();
223  ++numberOfSquareRoots;
224  }
225  computePade(degree, IminusT, res);
226 
227  for (; numberOfSquareRoots; --numberOfSquareRoots) {
228  compute2x2(res, ldexp(m_p, -numberOfSquareRoots));
229  res = res.template triangularView<Upper>() * res;
230  }
231  compute2x2(res, m_p);
232 }
233 
234 template<typename MatrixType>
235 inline int MatrixPowerAtomic<MatrixType>::getPadeDegree(float normIminusT)
236 {
237  const float maxNormForPade[] = { 2.8064004e-1f /* degree = 3 */ , 4.3386528e-1f };
238  int degree = 3;
239  for (; degree <= 4; ++degree)
240  if (normIminusT <= maxNormForPade[degree - 3])
241  break;
242  return degree;
243 }
244 
245 template<typename MatrixType>
246 inline int MatrixPowerAtomic<MatrixType>::getPadeDegree(double normIminusT)
247 {
248  const double maxNormForPade[] = { 1.884160592658218e-2 /* degree = 3 */ , 6.038881904059573e-2, 1.239917516308172e-1,
249  1.999045567181744e-1, 2.789358995219730e-1 };
250  int degree = 3;
251  for (; degree <= 7; ++degree)
252  if (normIminusT <= maxNormForPade[degree - 3])
253  break;
254  return degree;
255 }
256 
257 template<typename MatrixType>
258 inline int MatrixPowerAtomic<MatrixType>::getPadeDegree(long double normIminusT)
259 {
260 #if LDBL_MANT_DIG == 53
261  const int maxPadeDegree = 7;
262  const double maxNormForPade[] = { 1.884160592658218e-2L /* degree = 3 */ , 6.038881904059573e-2L, 1.239917516308172e-1L,
263  1.999045567181744e-1L, 2.789358995219730e-1L };
264 #elif LDBL_MANT_DIG <= 64
265  const int maxPadeDegree = 8;
266  const long double maxNormForPade[] = { 6.3854693117491799460e-3L /* degree = 3 */ , 2.6394893435456973676e-2L,
267  6.4216043030404063729e-2L, 1.1701165502926694307e-1L, 1.7904284231268670284e-1L, 2.4471944416607995472e-1L };
268 #elif LDBL_MANT_DIG <= 106
269  const int maxPadeDegree = 10;
270  const double maxNormForPade[] = { 1.0007161601787493236741409687186e-4L /* degree = 3 */ ,
271  1.0007161601787493236741409687186e-3L, 4.7069769360887572939882574746264e-3L, 1.3220386624169159689406653101695e-2L,
272  2.8063482381631737920612944054906e-2L, 4.9625993951953473052385361085058e-2L, 7.7367040706027886224557538328171e-2L,
273  1.1016843812851143391275867258512e-1L };
274 #else
275  const int maxPadeDegree = 10;
276  const double maxNormForPade[] = { 5.524506147036624377378713555116378e-5L /* degree = 3 */ ,
277  6.640600568157479679823602193345995e-4L, 3.227716520106894279249709728084626e-3L,
278  9.619593944683432960546978734646284e-3L, 2.134595382433742403911124458161147e-2L,
279  3.908166513900489428442993794761185e-2L, 6.266780814639442865832535460550138e-2L,
280  9.134603732914548552537150753385375e-2L };
281 #endif
282  int degree = 3;
283  for (; degree <= maxPadeDegree; ++degree)
284  if (normIminusT <= maxNormForPade[degree - 3])
285  break;
286  return degree;
287 }
288 
289 template<typename MatrixType>
292 {
293  using std::ceil;
294  using std::exp;
295  using std::log;
296  using std::sinh;
297 
298  ComplexScalar logCurr = log(curr);
299  ComplexScalar logPrev = log(prev);
300  RealScalar unwindingNumber = ceil((numext::imag(logCurr - logPrev) - RealScalar(EIGEN_PI)) / RealScalar(2*EIGEN_PI));
301  ComplexScalar w = numext::log1p((curr-prev)/prev)/RealScalar(2) + ComplexScalar(0, RealScalar(EIGEN_PI)*unwindingNumber);
302  return RealScalar(2) * exp(RealScalar(0.5) * p * (logCurr + logPrev)) * sinh(p * w) / (curr - prev);
303 }
304 
305 template<typename MatrixType>
308 {
309  using std::exp;
310  using std::log;
311  using std::sinh;
312 
313  RealScalar w = numext::log1p((curr-prev)/prev)/RealScalar(2);
314  return 2 * exp(p * (log(curr) + log(prev)) / 2) * sinh(p * w) / (curr - prev);
315 }
316 
336 template<typename MatrixType>
338 {
339  private:
340  typedef typename MatrixType::Scalar Scalar;
342 
343  public:
352  explicit MatrixPower(const MatrixType& A) :
353  m_A(A),
355  m_rank(A.cols()),
356  m_nulls(0)
357  { eigen_assert(A.rows() == A.cols()); }
358 
368 
376  template<typename ResultType>
377  void compute(ResultType& res, RealScalar p);
378 
379  Index rows() const { return m_A.rows(); }
380  Index cols() const { return m_A.cols(); }
381 
382  private:
383  typedef std::complex<RealScalar> ComplexScalar;
384  typedef Matrix<ComplexScalar, Dynamic, Dynamic, 0,
385  MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime> ComplexMatrix;
386 
388  typename MatrixType::Nested m_A;
389 
392 
395 
398 
406 
409 
412 
422  void split(RealScalar& p, RealScalar& intpart);
423 
425  void initialize();
426 
427  template<typename ResultType>
428  void computeIntPower(ResultType& res, RealScalar p);
429 
430  template<typename ResultType>
431  void computeFracPower(ResultType& res, RealScalar p);
432 
433  template<int Rows, int Cols, int Options, int MaxRows, int MaxCols>
434  static void revertSchur(
436  const ComplexMatrix& T,
437  const ComplexMatrix& U);
438 
439  template<int Rows, int Cols, int Options, int MaxRows, int MaxCols>
440  static void revertSchur(
442  const ComplexMatrix& T,
443  const ComplexMatrix& U);
444 };
445 
446 template<typename MatrixType>
447 template<typename ResultType>
449 {
450  using std::pow;
451  switch (cols()) {
452  case 0:
453  break;
454  case 1:
455  res(0,0) = pow(m_A.coeff(0,0), p);
456  break;
457  default:
458  RealScalar intpart;
459  split(p, intpart);
460 
461  res = MatrixType::Identity(rows(), cols());
462  computeIntPower(res, intpart);
463  if (p) computeFracPower(res, p);
464  }
465 }
466 
467 template<typename MatrixType>
469 {
470  using std::floor;
471  using std::pow;
472 
473  intpart = floor(p);
474  p -= intpart;
475 
476  // Perform Schur decomposition if it is not yet performed and the power is
477  // not an integer.
478  if (!m_conditionNumber && p)
479  initialize();
480 
481  // Choose the more stable of intpart = floor(p) and intpart = ceil(p).
482  if (p > RealScalar(0.5) && p > (1-p) * pow(m_conditionNumber, p)) {
483  --p;
484  ++intpart;
485  }
486 }
487 
488 template<typename MatrixType>
490 {
493  ComplexScalar eigenvalue;
494 
495  m_fT.resizeLike(m_A);
496  m_T = schurOfA.matrixT();
497  m_U = schurOfA.matrixU();
498  m_conditionNumber = m_T.diagonal().array().abs().maxCoeff() / m_T.diagonal().array().abs().minCoeff();
499 
500  // Move zero eigenvalues to the bottom right corner.
501  for (Index i = cols()-1; i>=0; --i) {
502  if (m_rank <= 2)
503  return;
504  if (m_T.coeff(i,i) == RealScalar(0)) {
505  for (Index j=i+1; j < m_rank; ++j) {
506  eigenvalue = m_T.coeff(j,j);
507  rot.makeGivens(m_T.coeff(j-1,j), eigenvalue);
508  m_T.applyOnTheRight(j-1, j, rot);
509  m_T.applyOnTheLeft(j-1, j, rot.adjoint());
510  m_T.coeffRef(j-1,j-1) = eigenvalue;
511  m_T.coeffRef(j,j) = RealScalar(0);
512  m_U.applyOnTheRight(j-1, j, rot);
513  }
514  --m_rank;
515  }
516  }
517 
518  m_nulls = rows() - m_rank;
519  if (m_nulls) {
520  eigen_assert(m_T.bottomRightCorner(m_nulls, m_nulls).isZero()
521  && "Base of matrix power should be invertible or with a semisimple zero eigenvalue.");
522  m_fT.bottomRows(m_nulls).fill(RealScalar(0));
523  }
524 }
525 
526 template<typename MatrixType>
527 template<typename ResultType>
529 {
530  using std::abs;
531  using std::fmod;
532  RealScalar pp = abs(p);
533 
534  if (p<0)
535  m_tmp = m_A.inverse();
536  else
537  m_tmp = m_A;
538 
539  while (true) {
540  if (fmod(pp, 2) >= 1)
541  res = m_tmp * res;
542  pp /= 2;
543  if (pp < 1)
544  break;
545  m_tmp *= m_tmp;
546  }
547 }
548 
549 template<typename MatrixType>
550 template<typename ResultType>
552 {
553  Block<ComplexMatrix,Dynamic,Dynamic> blockTp(m_fT, 0, 0, m_rank, m_rank);
554  eigen_assert(m_conditionNumber);
555  eigen_assert(m_rank + m_nulls == rows());
556 
557  MatrixPowerAtomic<ComplexMatrix>(m_T.topLeftCorner(m_rank, m_rank), p).compute(blockTp);
558  if (m_nulls) {
559  m_fT.topRightCorner(m_rank, m_nulls) = m_T.topLeftCorner(m_rank, m_rank).template triangularView<Upper>()
560  .solve(blockTp * m_T.topRightCorner(m_rank, m_nulls));
561  }
562  revertSchur(m_tmp, m_fT, m_U);
563  res = m_tmp * res;
564 }
565 
566 template<typename MatrixType>
567 template<int Rows, int Cols, int Options, int MaxRows, int MaxCols>
570  const ComplexMatrix& T,
571  const ComplexMatrix& U)
572 { res.noalias() = U * (T.template triangularView<Upper>() * U.adjoint()); }
573 
574 template<typename MatrixType>
575 template<int Rows, int Cols, int Options, int MaxRows, int MaxCols>
578  const ComplexMatrix& T,
579  const ComplexMatrix& U)
580 { res.noalias() = (U * (T.template triangularView<Upper>() * U.adjoint())).real(); }
581 
595 template<typename Derived>
596 class MatrixPowerReturnValue : public ReturnByValue< MatrixPowerReturnValue<Derived> >
597 {
598  public:
599  typedef typename Derived::PlainObject PlainObject;
600  typedef typename Derived::RealScalar RealScalar;
601 
608  MatrixPowerReturnValue(const Derived& A, RealScalar p) : m_A(A), m_p(p)
609  { }
610 
617  template<typename ResultType>
618  inline void evalTo(ResultType& result) const
620 
621  Index rows() const { return m_A.rows(); }
622  Index cols() const { return m_A.cols(); }
623 
624  private:
625  const Derived& m_A;
627 };
628 
642 template<typename Derived>
643 class MatrixComplexPowerReturnValue : public ReturnByValue< MatrixComplexPowerReturnValue<Derived> >
644 {
645  public:
646  typedef typename Derived::PlainObject PlainObject;
647  typedef typename std::complex<typename Derived::RealScalar> ComplexScalar;
648 
655  MatrixComplexPowerReturnValue(const Derived& A, const ComplexScalar& p) : m_A(A), m_p(p)
656  { }
657 
667  template<typename ResultType>
668  inline void evalTo(ResultType& result) const
669  { result = (m_p * m_A.log()).exp(); }
670 
671  Index rows() const { return m_A.rows(); }
672  Index cols() const { return m_A.cols(); }
673 
674  private:
675  const Derived& m_A;
677 };
678 
679 namespace internal {
680 
681 template<typename MatrixPowerType>
682 struct traits< MatrixPowerParenthesesReturnValue<MatrixPowerType> >
683 { typedef typename MatrixPowerType::PlainObject ReturnType; };
684 
685 template<typename Derived>
686 struct traits< MatrixPowerReturnValue<Derived> >
687 { typedef typename Derived::PlainObject ReturnType; };
688 
689 template<typename Derived>
691 { typedef typename Derived::PlainObject ReturnType; };
692 
693 }
694 
695 template<typename Derived>
697 { return MatrixPowerReturnValue<Derived>(derived(), p); }
698 
699 template<typename Derived>
700 const MatrixComplexPowerReturnValue<Derived> MatrixBase<Derived>::pow(const std::complex<RealScalar>& p) const
701 { return MatrixComplexPowerReturnValue<Derived>(derived(), p); }
702 
703 } // namespace Eigen
704 
705 #endif // EIGEN_MATRIX_POWER
w
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Eigen::MatrixComplexPowerReturnValue::cols
Index cols() const
Definition: MatrixPower.h:672
Eigen::MatrixPowerAtomic::RowsAtCompileTime
@ RowsAtCompileTime
Definition: MatrixPower.h:90
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::MatrixPowerParenthesesReturnValue::MatrixPowerParenthesesReturnValue
MatrixPowerParenthesesReturnValue(MatrixPower< MatrixType > &pow, RealScalar p)
Constructor.
Definition: MatrixPower.h:50
Eigen::ReturnByValue
Definition: ReturnByValue.h:50
Eigen::MatrixPowerReturnValue::PlainObject
Derived::PlainObject PlainObject
Definition: MatrixPower.h:599
Eigen::internal::noncopyable
Definition: Meta.h:422
Eigen::Block
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
Eigen::MatrixPower::cols
Index cols() const
Definition: MatrixPower.h:380
EIGEN_PI
#define EIGEN_PI
Definition: Eigen/src/Core/MathFunctions.h:16
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Eigen::MatrixPowerAtomic::ResultType
Block< MatrixType, Dynamic, Dynamic > ResultType
Definition: MatrixPower.h:96
MatrixType
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
Eigen::MatrixPowerReturnValue
Proxy for the matrix power of some matrix (expression).
Definition: ForwardDeclarations.h:308
Eigen::MatrixPowerParenthesesReturnValue::cols
Index cols() const
Definition: MatrixPower.h:63
Eigen::MatrixComplexPowerReturnValue::MatrixComplexPowerReturnValue
MatrixComplexPowerReturnValue(const Derived &A, const ComplexScalar &p)
Constructor.
Definition: MatrixPower.h:655
Eigen::MatrixPower::computeFracPower
void computeFracPower(ResultType &res, RealScalar p)
Definition: MatrixPower.h:551
Eigen::MatrixPower::m_T
ComplexMatrix m_T
Store the result of Schur decomposition.
Definition: MatrixPower.h:394
Eigen::MatrixPower::initialize
void initialize()
Perform Schur decomposition for fractional power.
Definition: MatrixPower.h:489
Eigen::MatrixPower::compute
void compute(ResultType &res, RealScalar p)
Compute the matrix power.
Definition: MatrixPower.h:448
T
Eigen::Triplet< double > T
Definition: Tutorial_sparse_example.cpp:6
Eigen::MatrixPowerAtomic::ComplexScalar
std::complex< RealScalar > ComplexScalar
Definition: MatrixPower.h:95
log
const EIGEN_DEVICE_FUNC LogReturnType log() const
Definition: ArrayCwiseUnaryOps.h:128
schurOfA
cout<< "Here is a random 4x4 matrix, A:"<< endl<< A<< endl<< endl;ComplexSchur< MatrixXcf > schurOfA(A, false)
Eigen::MatrixPowerAtomic::m_p
RealScalar m_p
Definition: MatrixPower.h:99
Eigen::internal::traits< MatrixComplexPowerReturnValue< Derived > >::ReturnType
Derived::PlainObject ReturnType
Definition: MatrixPower.h:691
res
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
exp
const EIGEN_DEVICE_FUNC ExpReturnType exp() const
Definition: ArrayCwiseUnaryOps.h:97
Eigen::MatrixPower::ComplexScalar
std::complex< RealScalar > ComplexScalar
Definition: MatrixPower.h:383
Eigen::MatrixPower::rows
Index rows() const
Definition: MatrixPower.h:379
Eigen::JacobiRotation
Rotation given by a cosine-sine pair.
Definition: ForwardDeclarations.h:283
result
Values result
Definition: OdometryOptimize.cpp:8
Eigen::MatrixPowerAtomic::MaxRowsAtCompileTime
@ MaxRowsAtCompileTime
Definition: MatrixPower.h:91
Eigen::MatrixPower::computeIntPower
void computeIntPower(ResultType &res, RealScalar p)
Definition: MatrixPower.h:528
Eigen::MatrixPower::operator()
const MatrixPowerParenthesesReturnValue< MatrixType > operator()(RealScalar p)
Returns the matrix power.
Definition: MatrixPower.h:366
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
Eigen::MatrixPower::RealScalar
MatrixType::RealScalar RealScalar
Definition: MatrixPower.h:341
Eigen::MatrixComplexPowerReturnValue::PlainObject
Derived::PlainObject PlainObject
Definition: MatrixPower.h:646
Eigen::MatrixPowerAtomic::MatrixPowerAtomic
MatrixPowerAtomic(const MatrixType &T, RealScalar p)
Constructor.
Definition: MatrixPower.h:134
Eigen::MatrixPowerReturnValue::evalTo
void evalTo(ResultType &result) const
Compute the matrix power.
Definition: MatrixPower.h:618
Eigen::MatrixPowerAtomic
Class for computing matrix powers.
Definition: MatrixPower.h:86
A
Definition: test_numpy_dtypes.cpp:298
Eigen::MatrixPower::Scalar
MatrixType::Scalar Scalar
Definition: MatrixPower.h:340
Eigen::bfloat16_impl::fmod
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 fmod(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:567
Eigen::MatrixPowerParenthesesReturnValue::evalTo
void evalTo(ResultType &result) const
Compute the matrix power.
Definition: MatrixPower.h:59
Eigen::MatrixPowerAtomic::getPadeDegree
static int getPadeDegree(float normIminusT)
Definition: MatrixPower.h:235
Eigen::internal::traits< MatrixPowerParenthesesReturnValue< MatrixPowerType > >::ReturnType
MatrixPowerType::PlainObject ReturnType
Definition: MatrixPower.h:683
Eigen::internal::traits< MatrixPowerReturnValue< Derived > >::ReturnType
Derived::PlainObject ReturnType
Definition: MatrixPower.h:687
j
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
Eigen::MatrixPowerReturnValue::cols
Index cols() const
Definition: MatrixPower.h:622
Eigen::MatrixPowerAtomic::m_A
const MatrixType & m_A
Definition: MatrixPower.h:98
Eigen::MatrixPower::ComplexMatrix
Matrix< ComplexScalar, Dynamic, Dynamic, 0, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime > ComplexMatrix
Definition: MatrixPower.h:385
Eigen::MatrixPowerAtomic::computeSuperDiag
static ComplexScalar computeSuperDiag(const ComplexScalar &, const ComplexScalar &, RealScalar p)
Definition: MatrixPower.h:291
Eigen::MatrixPowerReturnValue::m_p
const RealScalar m_p
Definition: MatrixPower.h:626
Eigen::Dynamic
const int Dynamic
Definition: Constants.h:22
Eigen::MatrixPower::revertSchur
static void revertSchur(Matrix< ComplexScalar, Rows, Cols, Options, MaxRows, MaxCols > &res, const ComplexMatrix &T, const ComplexMatrix &U)
Definition: MatrixPower.h:568
Eigen::MatrixPowerAtomic::Scalar
MatrixType::Scalar Scalar
Definition: MatrixPower.h:93
Eigen::MatrixPowerParenthesesReturnValue::rows
Index rows() const
Definition: MatrixPower.h:62
degree
const double degree
Definition: SimpleRotation.cpp:59
log1p
double log1p(double x)
Definition: unity.c:49
Eigen::MatrixPower
Class for computing matrix powers.
Definition: MatrixPower.h:15
L
MatrixXd L
Definition: LLT_example.cpp:6
imag
const EIGEN_DEVICE_FUNC ImagReturnType imag() const
Definition: CommonCwiseUnaryOps.h:109
Eigen::MatrixComplexPowerReturnValue::m_A
const Derived & m_A
Definition: MatrixPower.h:675
Eigen::Triplet< double >
Eigen::MatrixComplexPowerReturnValue
Proxy for the matrix power of some matrix (expression).
Definition: ForwardDeclarations.h:309
Eigen::matrix_sqrt_triangular
void matrix_sqrt_triangular(const MatrixType &arg, ResultType &result)
Compute matrix square root of triangular matrix.
Definition: MatrixSquareRoot.h:204
ceres::pow
Jet< T, N > pow(const Jet< T, N > &f, double g)
Definition: jet.h:570
Eigen::MatrixPower::m_rank
Index m_rank
Rank of m_A.
Definition: MatrixPower.h:408
Eigen::MatrixPowerParenthesesReturnValue::m_p
const RealScalar m_p
Definition: MatrixPower.h:67
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:47
Eigen::MatrixPowerReturnValue::MatrixPowerReturnValue
MatrixPowerReturnValue(const Derived &A, RealScalar p)
Constructor.
Definition: MatrixPower.h:608
Eigen::MatrixPowerParenthesesReturnValue::m_pow
MatrixPower< MatrixType > & m_pow
Definition: MatrixPower.h:66
Eigen::MatrixComplexPowerReturnValue::rows
Index rows() const
Definition: MatrixPower.h:671
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::MatrixPowerReturnValue::m_A
const Derived & m_A
Definition: MatrixPower.h:625
Eigen::MatrixComplexPowerReturnValue::evalTo
void evalTo(ResultType &result) const
Compute the matrix power.
Definition: MatrixPower.h:668
p
float * p
Definition: Tutorial_Map_using.cpp:9
Eigen::MatrixPower::m_A
MatrixType::Nested m_A
Reference to the base of matrix power.
Definition: MatrixPower.h:388
gtsam::split
void split(const G &g, const PredecessorMap< KEY > &tree, G &Ab1, G &Ab2)
Definition: graph-inl.h:245
Eigen::MatrixComplexPowerReturnValue::m_p
const ComplexScalar m_p
Definition: MatrixPower.h:676
U
@ U
Definition: testDecisionTree.cpp:342
ceil
const EIGEN_DEVICE_FUNC CeilReturnType ceil() const
Definition: ArrayCwiseUnaryOps.h:495
Eigen::MatrixPower::m_fT
ComplexMatrix m_fT
Store fractional power of m_T.
Definition: MatrixPower.h:397
Eigen::MatrixPower::split
void split(RealScalar &p, RealScalar &intpart)
Split p into integral part and fractional part.
Definition: MatrixPower.h:468
Eigen::MatrixPowerReturnValue::RealScalar
Derived::RealScalar RealScalar
Definition: MatrixPower.h:600
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition: 3rdparty/Eigen/Eigen/src/Core/Matrix.h:178
abs
#define abs(x)
Definition: datatypes.h:17
Eigen::MatrixPower::MatrixPower
MatrixPower(const MatrixType &A)
Constructor.
Definition: MatrixPower.h:352
Eigen::MatrixPowerAtomic::compute
void compute(ResultType &res) const
Compute the matrix power.
Definition: MatrixPower.h:142
internal
Definition: BandTriangularSolver.h:13
Eigen::MatrixPowerParenthesesReturnValue::RealScalar
MatrixType::RealScalar RealScalar
Definition: MatrixPower.h:42
Eigen::MatrixPower::m_U
ComplexMatrix m_U
Definition: MatrixPower.h:394
Eigen::MatrixPowerAtomic::RealScalar
MatrixType::RealScalar RealScalar
Definition: MatrixPower.h:94
Eigen::MatrixComplexPowerReturnValue::ComplexScalar
std::complex< typename Derived::RealScalar > ComplexScalar
Definition: MatrixPower.h:647
cols
int cols
Definition: Tutorial_commainit_02.cpp:1
Eigen::MatrixPowerAtomic::compute2x2
void compute2x2(ResultType &res, RealScalar p) const
Definition: MatrixPower.h:174
sinh
const EIGEN_DEVICE_FUNC SinhReturnType sinh() const
Definition: ArrayCwiseUnaryOps.h:339
Eigen::MatrixPowerReturnValue::rows
Index rows() const
Definition: MatrixPower.h:621
Eigen::MatrixPowerAtomic::computePade
void computePade(int degree, const MatrixType &IminusT, ResultType &res) const
Definition: MatrixPower.h:160
Eigen::ComplexSchur< MatrixType >
Eigen::MatrixPower::m_nulls
Index m_nulls
Rank deficiency of m_A.
Definition: MatrixPower.h:411
eval
internal::nested_eval< T, 1 >::type eval(const T &xpr)
Definition: sparse_permutations.cpp:38
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
gtsam::lago::initialize
Values initialize(const NonlinearFactorGraph &graph, bool useOdometricPath)
Definition: lago.cpp:375
Eigen::MatrixPower::m_tmp
MatrixType m_tmp
Temporary storage.
Definition: MatrixPower.h:391
Eigen::MatrixPower::m_conditionNumber
RealScalar m_conditionNumber
Condition number of m_A.
Definition: MatrixPower.h:405
floor
const EIGEN_DEVICE_FUNC FloorReturnType floor() const
Definition: ArrayCwiseUnaryOps.h:481
Eigen::MatrixPowerAtomic::computeBig
void computeBig(ResultType &res) const
Definition: MatrixPower.h:193
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
Eigen::MatrixPowerParenthesesReturnValue
Proxy for the matrix power of some matrix.
Definition: MatrixPower.h:39


gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:01:58