Go to the documentation of this file.
10 #ifndef EIGEN_COMPANION_H
11 #define EIGEN_COMPANION_H
21 #ifndef EIGEN_PARSED_BY_DOXYGEN
32 template<
typename _Scalar,
int _Deg >
68 template<
typename VectorType>
71 const Index deg = poly.size()-1;
72 m_monic = -poly.head(deg)/poly[deg];
76 template<
typename VectorType>
84 const Index deg_1 = deg-1;
88 << LeftBlockFirstRow::Zero(1,deg_1),
89 BottomLeftBlock::Identity(deg-1,deg-1)*
m_bl_diag.asDiagonal() ).finished()
133 template<
typename _Scalar,
int _Deg >
152 rowB = rowNorm / radix;
166 scout = colNorm * (colB / radix) * colB;
167 while (scout >= rowNorm)
174 if ((rowNorm + radix * scout) <
RealScalar(0.95) *
s * colB)
187 template<
typename _Scalar,
int _Deg >
202 rowB =
sqrt( colNorm/rowNorm );
214 template<
typename _Scalar,
int _Deg >
219 const Index deg = m_monic.size();
220 const Index deg_1 = deg-1;
222 bool hasConverged=
false;
223 while( !hasConverged )
231 colNorm =
abs(m_bl_diag[0]);
232 rowNorm =
abs(m_monic[0]);
235 if( !balanced( colNorm, rowNorm, hasConverged, colB, rowB ) )
237 m_bl_diag[0] *= colB;
246 colNorm =
abs(m_bl_diag[
i]);
249 rowNorm =
abs(m_bl_diag[
i-1]) +
abs(m_monic[
i]);
252 if( !balanced( colNorm, rowNorm, hasConverged, colB, rowB ) )
254 m_bl_diag[
i] *= colB;
255 m_bl_diag[
i-1] *= rowB;
262 const Index ebl = m_bl_diag.size()-1;
264 colNorm = headMonic.array().abs().sum();
265 rowNorm =
abs( m_bl_diag[ebl] );
268 if( !balanced( colNorm, rowNorm, hasConverged, colB, rowB ) )
271 m_bl_diag[ebl] *= rowB;
280 #endif // EIGEN_COMPANION_H
NumTraits< Scalar >::Real RealScalar
Namespace containing all symbols from the Eigen library.
bool balanced(RealScalar colNorm, RealScalar rowNorm, bool &isBalanced, RealScalar &colB, RealScalar &rowB)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isfinite(const Eigen::bfloat16 &h)
companion(const VectorType &poly)
bool balancedR(RealScalar colNorm, RealScalar rowNorm, bool &isBalanced, RealScalar &colB, RealScalar &rowB)
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
DenseCompanionMatrixType denseMatrix() const
EIGEN_DEVICE_FUNC const Scalar & q
EIGEN_DEVICE_FUNC Derived & setOnes(Index size)
Matrix< Scalar, 1, Deg_1 > LeftBlockFirstRow
BottomLeftDiagonal m_bl_diag
Matrix< Scalar, Deg, 1 > RightColumn
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
#define EIGEN_STRONG_INLINE
Matrix< Scalar, Deg_1, Deg_1 > BottomLeftBlock
Matrix< Scalar, _Deg, Deg_1 > LeftBlock
NumTraits< Scalar >::Real RealScalar
Matrix< Scalar, Deg, Deg > DenseCompanionMatrixType
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Matrix< Scalar, Deg_1, 1 > BottomLeftDiagonal
Expression of a fixed-size or dynamic-size sub-vector.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Jet< T, N > sqrt(const Jet< T, N > &f)
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar, Size)
const EIGEN_STRONG_INLINE _Scalar operator()(Index row, Index col) const
void setPolynomial(const VectorType &poly)
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:16