mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Reduce usage of reserved names
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
c61b3cb0db
commit
8d81a2339c
@@ -31,14 +31,14 @@ struct decrement_if_fixed_size
|
||||
|
||||
#endif
|
||||
|
||||
template< typename Scalar_, int _Deg >
|
||||
template< typename Scalar_, int Deg_ >
|
||||
class companion
|
||||
{
|
||||
public:
|
||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,_Deg==Dynamic ? Dynamic : _Deg)
|
||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,Deg_==Dynamic ? Dynamic : Deg_)
|
||||
|
||||
enum {
|
||||
Deg = _Deg,
|
||||
Deg = Deg_,
|
||||
Deg_1=decrement_if_fixed_size<Deg>::ret
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ class companion
|
||||
typedef Matrix<Scalar, Deg_1, 1> BottomLeftDiagonal;
|
||||
|
||||
typedef Matrix<Scalar, Deg, Deg> DenseCompanionMatrixType;
|
||||
typedef Matrix< Scalar, _Deg, Deg_1 > LeftBlock;
|
||||
typedef Matrix< Scalar, Deg_, Deg_1 > LeftBlock;
|
||||
typedef Matrix< Scalar, Deg_1, Deg_1 > BottomLeftBlock;
|
||||
typedef Matrix< Scalar, 1, Deg_1 > LeftBlockFirstRow;
|
||||
|
||||
@@ -132,9 +132,9 @@ class companion
|
||||
|
||||
|
||||
|
||||
template< typename Scalar_, int _Deg >
|
||||
template< typename Scalar_, int Deg_ >
|
||||
inline
|
||||
bool companion<Scalar_,_Deg>::balanced( RealScalar colNorm, RealScalar rowNorm,
|
||||
bool companion<Scalar_,Deg_>::balanced( RealScalar colNorm, RealScalar rowNorm,
|
||||
bool& isBalanced, RealScalar& colB, RealScalar& rowB )
|
||||
{
|
||||
if( RealScalar(0) == colNorm || RealScalar(0) == rowNorm
|
||||
@@ -186,9 +186,9 @@ bool companion<Scalar_,_Deg>::balanced( RealScalar colNorm, RealScalar rowNorm,
|
||||
}
|
||||
}
|
||||
|
||||
template< typename Scalar_, int _Deg >
|
||||
template< typename Scalar_, int Deg_ >
|
||||
inline
|
||||
bool companion<Scalar_,_Deg>::balancedR( RealScalar colNorm, RealScalar rowNorm,
|
||||
bool companion<Scalar_,Deg_>::balancedR( RealScalar colNorm, RealScalar rowNorm,
|
||||
bool& isBalanced, RealScalar& colB, RealScalar& rowB )
|
||||
{
|
||||
if( RealScalar(0) == colNorm || RealScalar(0) == rowNorm ){ return true; }
|
||||
@@ -213,8 +213,8 @@ bool companion<Scalar_,_Deg>::balancedR( RealScalar colNorm, RealScalar rowNorm,
|
||||
}
|
||||
|
||||
|
||||
template< typename Scalar_, int _Deg >
|
||||
void companion<Scalar_,_Deg>::balance()
|
||||
template< typename Scalar_, int Deg_ >
|
||||
void companion<Scalar_,Deg_>::balance()
|
||||
{
|
||||
using std::abs;
|
||||
EIGEN_STATIC_ASSERT( Deg == Dynamic || 1 < Deg, YOU_MADE_A_PROGRAMMING_MISTAKE );
|
||||
|
||||
@@ -27,16 +27,16 @@ namespace Eigen {
|
||||
* It stores the set of roots as a vector of complexes.
|
||||
*
|
||||
*/
|
||||
template< typename Scalar_, int _Deg >
|
||||
template< typename Scalar_, int Deg_ >
|
||||
class PolynomialSolverBase
|
||||
{
|
||||
public:
|
||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,_Deg==Dynamic ? Dynamic : _Deg)
|
||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,Deg_==Dynamic ? Dynamic : Deg_)
|
||||
|
||||
typedef Scalar_ Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
typedef std::complex<RealScalar> RootType;
|
||||
typedef Matrix<RootType,_Deg,1> RootsType;
|
||||
typedef Matrix<RootType,Deg_,1> RootsType;
|
||||
|
||||
typedef DenseIndex Index;
|
||||
|
||||
@@ -309,8 +309,8 @@ class PolynomialSolverBase
|
||||
* Computes the complex roots of a real polynomial.
|
||||
*
|
||||
* \param Scalar_ the scalar type, i.e., the type of the polynomial coefficients
|
||||
* \param _Deg the degree of the polynomial, can be a compile time value or Dynamic.
|
||||
* Notice that the number of polynomial coefficients is _Deg+1.
|
||||
* \param Deg_ the degree of the polynomial, can be a compile time value or Dynamic.
|
||||
* Notice that the number of polynomial coefficients is Deg_+1.
|
||||
*
|
||||
* This class implements a polynomial solver and provides convenient methods such as
|
||||
* - real roots,
|
||||
@@ -329,16 +329,16 @@ class PolynomialSolverBase
|
||||
* However, almost always, correct accuracy is reached even in these cases for 64bit
|
||||
* (double) floating types and small polynomial degree (<20).
|
||||
*/
|
||||
template<typename Scalar_, int _Deg>
|
||||
class PolynomialSolver : public PolynomialSolverBase<Scalar_,_Deg>
|
||||
template<typename Scalar_, int Deg_>
|
||||
class PolynomialSolver : public PolynomialSolverBase<Scalar_,Deg_>
|
||||
{
|
||||
public:
|
||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,_Deg==Dynamic ? Dynamic : _Deg)
|
||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_,Deg_==Dynamic ? Dynamic : Deg_)
|
||||
|
||||
typedef PolynomialSolverBase<Scalar_,_Deg> PS_Base;
|
||||
typedef PolynomialSolverBase<Scalar_,Deg_> PS_Base;
|
||||
EIGEN_POLYNOMIAL_SOLVER_BASE_INHERITED_TYPES( PS_Base )
|
||||
|
||||
typedef Matrix<Scalar,_Deg,_Deg> CompanionMatrixType;
|
||||
typedef Matrix<Scalar,Deg_,Deg_> CompanionMatrixType;
|
||||
typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
|
||||
ComplexEigenSolver<CompanionMatrixType>,
|
||||
EigenSolver<CompanionMatrixType> >::type EigenSolverType;
|
||||
@@ -353,7 +353,7 @@ class PolynomialSolver : public PolynomialSolverBase<Scalar_,_Deg>
|
||||
eigen_assert( poly.size() > 1 );
|
||||
if(poly.size() > 2 )
|
||||
{
|
||||
internal::companion<Scalar,_Deg> companion( poly );
|
||||
internal::companion<Scalar,Deg_> companion( poly );
|
||||
companion.balance();
|
||||
m_eigenSolver.compute( companion.denseMatrix() );
|
||||
m_roots = m_eigenSolver.eigenvalues();
|
||||
|
||||
Reference in New Issue
Block a user