Go to the documentation of this file.
41 #include <Eigen/Eigenvalues>
42 #include <Eigen/Geometry>
45 using namespace Eigen;
48 template<
typename Matrix,
typename Roots>
52 const Scalar s_inv3 = 1.0/3.0;
58 Scalar c0 =
m(0,0)*
m(1,1)*
m(2,2) +
Scalar(2)*
m(0,1)*
m(0,2)*
m(1,2) -
m(0,0)*
m(1,2)*
m(1,2) -
m(1,1)*
m(0,2)*
m(0,2) -
m(2,2)*
m(0,1)*
m(0,1);
59 Scalar c1 =
m(0,0)*
m(1,1) -
m(0,1)*
m(0,1) +
m(0,0)*
m(2,2) -
m(0,2)*
m(0,2) +
m(1,1)*
m(2,2) -
m(1,2)*
m(1,2);
71 Scalar q = half_b*half_b + a_over_3*a_over_3*a_over_3;
80 roots(2) = c2_over_3 +
Scalar(2)*rho*cos_theta;
81 roots(0) = c2_over_3 - rho*(cos_theta + s_sqrt3*sin_theta);
82 roots(1) = c2_over_3 - rho*(cos_theta - s_sqrt3*sin_theta);
85 template<
typename Matrix,
typename Vector>
94 scaledMat.diagonal().array() -= shift;
143 tmp.diagonal ().array () -= evals (2);
144 evecs.col (2) = tmp.row (0).cross (tmp.row (1)).normalized ();
147 tmp.diagonal ().array () -= evals (1);
148 evecs.col(1) = tmp.row (0).cross(tmp.row (1));
151 evecs.col(1) = evecs.col(2).unitOrthogonal();
156 evecs.col(1) = evecs.col(2).cross(evecs.col(1).cross(evecs.col(2))).normalized();
157 evecs.col(0) = evecs.col(2).cross(evecs.col(1));
162 evals.array()+=shift;
170 typedef Matrix3d
Mat;
171 typedef Vector3d
Vec;
172 Mat A = Mat::Random(3,3);
179 std::cout <<
"Eigen iterative: " <<
t.best() <<
"s\n";
182 std::cout <<
"Eigen direct : " <<
t.best() <<
"s\n";
187 std::cout <<
"Direct: " <<
t.best() <<
"s\n\n";
Namespace containing all symbols from the Eigen library.
Jet< T, N > sin(const Jet< T, N > &f)
void eigen33(const Matrix &mat, Matrix &evecs, Vector &evals)
Jet< T, N > cos(const Jet< T, N > &f)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
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 y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics scale
Computes eigenvalues and eigenvectors of selfadjoint matrices.
EIGEN_DEVICE_FUNC const Scalar & q
#define BENCH(TIMER, TRIES, REP, CODE)
Matrix< Scalar, Dynamic, Dynamic > Mat
SelfAdjointEigenSolver< PlainMatrixType > eig(mat, computeVectors?ComputeEigenvectors:EigenvaluesOnly)
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
The matrix class, also used for vectors and row-vectors.
internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Scalar Scalar
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Jet< T, N > sqrt(const Jet< T, N > &f)
Matrix< Scalar, Dynamic, 1 > Vec
void computeRoots(const Matrix &m, Roots &roots)
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:14