mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Avoid leading underscore followed by cap in template identifiers
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
5ad8b9bfe2
commit
4ba872bd75
@@ -55,23 +55,23 @@ struct get_boxes_helper<ObjectList, VolumeList, int> {
|
||||
/** \class KdBVH
|
||||
* \brief A simple bounding volume hierarchy based on AlignedBox
|
||||
*
|
||||
* \param _Scalar The underlying scalar type of the bounding boxes
|
||||
* \param _Dim The dimension of the space in which the hierarchy lives
|
||||
* \param Scalar_ The underlying scalar type of the bounding boxes
|
||||
* \param Dim_ The dimension of the space in which the hierarchy lives
|
||||
* \param _Object The object type that lives in the hierarchy. It must have value semantics. Either bounding_box(_Object) must
|
||||
* be defined and return an AlignedBox<_Scalar, _Dim> or bounding boxes must be provided to the tree initializer.
|
||||
* be defined and return an AlignedBox<Scalar_, Dim_> or bounding boxes must be provided to the tree initializer.
|
||||
*
|
||||
* This class provides a simple (as opposed to optimized) implementation of a bounding volume hierarchy analogous to a Kd-tree.
|
||||
* Given a sequence of objects, it computes their bounding boxes, constructs a Kd-tree of their centers
|
||||
* and builds a BVH with the structure of that Kd-tree. When the elements of the tree are too expensive to be copied around,
|
||||
* it is useful for _Object to be a pointer.
|
||||
*/
|
||||
template<typename _Scalar, int _Dim, typename _Object> class KdBVH
|
||||
template<typename Scalar_, int Dim_, typename _Object> class KdBVH
|
||||
{
|
||||
public:
|
||||
enum { Dim = _Dim };
|
||||
enum { Dim = Dim_ };
|
||||
typedef _Object Object;
|
||||
typedef std::vector<Object, aligned_allocator<Object> > ObjectList;
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef AlignedBox<Scalar, Dim> Volume;
|
||||
typedef std::vector<Volume, aligned_allocator<Volume> > VolumeList;
|
||||
typedef int Index;
|
||||
|
||||
@@ -92,18 +92,18 @@ namespace Eigen
|
||||
*
|
||||
* More information about Euler angles: https://en.wikipedia.org/wiki/Euler_angles
|
||||
*
|
||||
* \tparam _Scalar the scalar type, i.e. the type of the angles.
|
||||
* \tparam Scalar_ the scalar type, i.e. the type of the angles.
|
||||
*
|
||||
* \tparam _System the EulerSystem to use, which represents the axes of rotation.
|
||||
*/
|
||||
template <typename _Scalar, class _System>
|
||||
class EulerAngles : public RotationBase<EulerAngles<_Scalar, _System>, 3>
|
||||
template <typename Scalar_, class _System>
|
||||
class EulerAngles : public RotationBase<EulerAngles<Scalar_, _System>, 3>
|
||||
{
|
||||
public:
|
||||
typedef RotationBase<EulerAngles<_Scalar, _System>, 3> Base;
|
||||
typedef RotationBase<EulerAngles<Scalar_, _System>, 3> Base;
|
||||
|
||||
/** the scalar type of the angles */
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
|
||||
/** the EulerSystem to use, which represents the axes of rotation. */
|
||||
@@ -322,10 +322,10 @@ EIGEN_EULER_ANGLES_TYPEDEFS(double, d)
|
||||
|
||||
namespace internal
|
||||
{
|
||||
template<typename _Scalar, class _System>
|
||||
struct traits<EulerAngles<_Scalar, _System> >
|
||||
template<typename Scalar_, class _System>
|
||||
struct traits<EulerAngles<Scalar_, _System> >
|
||||
{
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
};
|
||||
|
||||
// set from a rotation matrix
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
namespace Eigen
|
||||
{
|
||||
// Forward declarations
|
||||
template <typename _Scalar, class _System>
|
||||
template <typename Scalar_, class _System>
|
||||
class EulerAngles;
|
||||
|
||||
namespace internal
|
||||
@@ -272,7 +272,7 @@ namespace Eigen
|
||||
res.gamma() = -res.gamma();
|
||||
}
|
||||
|
||||
template <typename _Scalar, class _System>
|
||||
template <typename Scalar_, class _System>
|
||||
friend class Eigen::EulerAngles;
|
||||
|
||||
template<typename System,
|
||||
|
||||
@@ -173,10 +173,10 @@ namespace internal {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename _Scalar>
|
||||
template <typename Scalar_>
|
||||
struct fftw_impl
|
||||
{
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef std::complex<Scalar> Complex;
|
||||
|
||||
inline
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace internal {
|
||||
// This FFT implementation was derived from kissfft http:sourceforge.net/projects/kissfft
|
||||
// Copyright 2003-2009 Mark Borgerding
|
||||
|
||||
template <typename _Scalar>
|
||||
template <typename Scalar_>
|
||||
struct kiss_cpx_fft
|
||||
{
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef std::complex<Scalar> Complex;
|
||||
std::vector<Complex> m_twiddles;
|
||||
std::vector<int> m_stageRadix;
|
||||
@@ -90,9 +90,9 @@ struct kiss_cpx_fft
|
||||
}while(n>1);
|
||||
}
|
||||
|
||||
template <typename _Src>
|
||||
template <typename Src_>
|
||||
inline
|
||||
void work( int stage,Complex * xout, const _Src * xin, size_t fstride,size_t in_stride)
|
||||
void work( int stage,Complex * xout, const Src_ * xin, size_t fstride,size_t in_stride)
|
||||
{
|
||||
int p = m_stageRadix[stage];
|
||||
int m = m_stageRemainder[stage];
|
||||
@@ -292,10 +292,10 @@ struct kiss_cpx_fft
|
||||
}
|
||||
};
|
||||
|
||||
template <typename _Scalar>
|
||||
template <typename Scalar_>
|
||||
struct kissfft_impl
|
||||
{
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef std::complex<Scalar> Complex;
|
||||
|
||||
void clear()
|
||||
|
||||
@@ -14,17 +14,17 @@
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
template< typename _MatrixType,
|
||||
typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> >
|
||||
template< typename MatrixType_,
|
||||
typename Preconditioner_ = DiagonalPreconditioner<typename MatrixType_::Scalar> >
|
||||
class DGMRES;
|
||||
|
||||
namespace internal {
|
||||
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
struct traits<DGMRES<_MatrixType,_Preconditioner> >
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
struct traits<DGMRES<MatrixType_,Preconditioner_> >
|
||||
{
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef _Preconditioner Preconditioner;
|
||||
typedef MatrixType_ MatrixType;
|
||||
typedef Preconditioner_ Preconditioner;
|
||||
};
|
||||
|
||||
/** \brief Computes a permutation vector to have a sorted sequence
|
||||
@@ -68,8 +68,8 @@ void sortWithPermutation (VectorType& vec, IndexType& perm, typename IndexType::
|
||||
* the IncompleteLUT for instance. The preconditioner is applied
|
||||
* at right of the matrix and the combination is multiplicative.
|
||||
*
|
||||
* \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
|
||||
* \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
|
||||
* \tparam MatrixType_ the type of the sparse matrix A, can be a dense or a sparse matrix.
|
||||
* \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
|
||||
* Typical usage :
|
||||
* \code
|
||||
* SparseMatrix<double> A;
|
||||
@@ -97,8 +97,8 @@ void sortWithPermutation (VectorType& vec, IndexType& perm, typename IndexType::
|
||||
|
||||
*
|
||||
*/
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
class DGMRES : public IterativeSolverBase<DGMRES<_MatrixType,_Preconditioner> >
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
class DGMRES : public IterativeSolverBase<DGMRES<MatrixType_,Preconditioner_> >
|
||||
{
|
||||
typedef IterativeSolverBase<DGMRES> Base;
|
||||
using Base::matrix;
|
||||
@@ -110,11 +110,11 @@ class DGMRES : public IterativeSolverBase<DGMRES<_MatrixType,_Preconditioner> >
|
||||
public:
|
||||
using Base::_solve_impl;
|
||||
using Base::_solve_with_guess_impl;
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef MatrixType_ MatrixType;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename MatrixType::StorageIndex StorageIndex;
|
||||
typedef typename MatrixType::RealScalar RealScalar;
|
||||
typedef _Preconditioner Preconditioner;
|
||||
typedef Preconditioner_ Preconditioner;
|
||||
typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
|
||||
typedef Matrix<RealScalar,Dynamic,Dynamic> DenseRealMatrix;
|
||||
typedef Matrix<Scalar,Dynamic,1> DenseVector;
|
||||
@@ -223,9 +223,9 @@ class DGMRES : public IterativeSolverBase<DGMRES<_MatrixType,_Preconditioner> >
|
||||
* A right preconditioner is used combined with deflation.
|
||||
*
|
||||
*/
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
template<typename Rhs, typename Dest>
|
||||
void DGMRES<_MatrixType, _Preconditioner>::dgmres(const MatrixType& mat,const Rhs& rhs, Dest& x,
|
||||
void DGMRES<MatrixType_, Preconditioner_>::dgmres(const MatrixType& mat,const Rhs& rhs, Dest& x,
|
||||
const Preconditioner& precond) const
|
||||
{
|
||||
const RealScalar considerAsZero = (std::numeric_limits<RealScalar>::min)();
|
||||
@@ -281,9 +281,9 @@ void DGMRES<_MatrixType, _Preconditioner>::dgmres(const MatrixType& mat,const Rh
|
||||
* \param normRhs The norm of the right hand side vector
|
||||
* \param nbIts The number of iterations
|
||||
*/
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
template<typename Dest>
|
||||
Index DGMRES<_MatrixType, _Preconditioner>::dgmresCycle(const MatrixType& mat, const Preconditioner& precond, Dest& x, DenseVector& r0, RealScalar& beta, const RealScalar& normRhs, Index& nbIts) const
|
||||
Index DGMRES<MatrixType_, Preconditioner_>::dgmresCycle(const MatrixType& mat, const Preconditioner& precond, Dest& x, DenseVector& r0, RealScalar& beta, const RealScalar& normRhs, Index& nbIts) const
|
||||
{
|
||||
//Initialization
|
||||
DenseVector g(m_restart+1); // Right hand side of the least square problem
|
||||
@@ -374,8 +374,8 @@ Index DGMRES<_MatrixType, _Preconditioner>::dgmresCycle(const MatrixType& mat, c
|
||||
}
|
||||
|
||||
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
void DGMRES<_MatrixType, _Preconditioner>::dgmresInitDeflation(Index& rows) const
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
void DGMRES<MatrixType_, Preconditioner_>::dgmresInitDeflation(Index& rows) const
|
||||
{
|
||||
m_U.resize(rows, m_maxNeig);
|
||||
m_MU.resize(rows, m_maxNeig);
|
||||
@@ -384,14 +384,14 @@ void DGMRES<_MatrixType, _Preconditioner>::dgmresInitDeflation(Index& rows) cons
|
||||
m_isDeflAllocated = true;
|
||||
}
|
||||
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
inline typename DGMRES<_MatrixType, _Preconditioner>::ComplexVector DGMRES<_MatrixType, _Preconditioner>::schurValues(const ComplexSchur<DenseMatrix>& schurofH) const
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
inline typename DGMRES<MatrixType_, Preconditioner_>::ComplexVector DGMRES<MatrixType_, Preconditioner_>::schurValues(const ComplexSchur<DenseMatrix>& schurofH) const
|
||||
{
|
||||
return schurofH.matrixT().diagonal();
|
||||
}
|
||||
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
inline typename DGMRES<_MatrixType, _Preconditioner>::ComplexVector DGMRES<_MatrixType, _Preconditioner>::schurValues(const RealSchur<DenseMatrix>& schurofH) const
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
inline typename DGMRES<MatrixType_, Preconditioner_>::ComplexVector DGMRES<MatrixType_, Preconditioner_>::schurValues(const RealSchur<DenseMatrix>& schurofH) const
|
||||
{
|
||||
const DenseMatrix& T = schurofH.matrixT();
|
||||
Index it = T.rows();
|
||||
@@ -415,8 +415,8 @@ inline typename DGMRES<_MatrixType, _Preconditioner>::ComplexVector DGMRES<_Matr
|
||||
return eig;
|
||||
}
|
||||
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
Index DGMRES<_MatrixType, _Preconditioner>::dgmresComputeDeflationData(const MatrixType& mat, const Preconditioner& precond, const Index& it, StorageIndex& neig) const
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
Index DGMRES<MatrixType_, Preconditioner_>::dgmresComputeDeflationData(const MatrixType& mat, const Preconditioner& precond, const Index& it, StorageIndex& neig) const
|
||||
{
|
||||
// First, find the Schur form of the Hessenberg matrix H
|
||||
typename internal::conditional<NumTraits<Scalar>::IsComplex, ComplexSchur<DenseMatrix>, RealSchur<DenseMatrix> >::type schurofH;
|
||||
@@ -498,9 +498,9 @@ Index DGMRES<_MatrixType, _Preconditioner>::dgmresComputeDeflationData(const Mat
|
||||
m_isDeflInitialized = true;
|
||||
return 0;
|
||||
}
|
||||
template<typename _MatrixType, typename _Preconditioner>
|
||||
template<typename MatrixType_, typename Preconditioner_>
|
||||
template<typename RhsType, typename DestType>
|
||||
Index DGMRES<_MatrixType, _Preconditioner>::dgmresApplyDeflation(const RhsType &x, DestType &y) const
|
||||
Index DGMRES<MatrixType_, Preconditioner_>::dgmresApplyDeflation(const RhsType &x, DestType &y) const
|
||||
{
|
||||
DenseVector x1 = m_U.leftCols(m_r).transpose() * x;
|
||||
y = x + m_U.leftCols(m_r) * ( m_lambdaN * m_luT.solve(x1) - x1);
|
||||
|
||||
@@ -216,17 +216,17 @@ bool gmres(const MatrixType & mat, const Rhs & rhs, Dest & x, const Precondition
|
||||
|
||||
}
|
||||
|
||||
template< typename _MatrixType,
|
||||
typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> >
|
||||
template< typename MatrixType_,
|
||||
typename Preconditioner_ = DiagonalPreconditioner<typename MatrixType_::Scalar> >
|
||||
class GMRES;
|
||||
|
||||
namespace internal {
|
||||
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
struct traits<GMRES<_MatrixType,_Preconditioner> >
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
struct traits<GMRES<MatrixType_,Preconditioner_> >
|
||||
{
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef _Preconditioner Preconditioner;
|
||||
typedef MatrixType_ MatrixType;
|
||||
typedef Preconditioner_ Preconditioner;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -237,8 +237,8 @@ struct traits<GMRES<_MatrixType,_Preconditioner> >
|
||||
* This class allows to solve for A.x = b sparse linear problems using a generalized minimal
|
||||
* residual method. The vectors x and b can be either dense or sparse.
|
||||
*
|
||||
* \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
|
||||
* \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
|
||||
* \tparam MatrixType_ the type of the sparse matrix A, can be a dense or a sparse matrix.
|
||||
* \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
|
||||
*
|
||||
* The maximal number of iterations and tolerance value can be controlled via the setMaxIterations()
|
||||
* and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations
|
||||
@@ -265,8 +265,8 @@ struct traits<GMRES<_MatrixType,_Preconditioner> >
|
||||
*
|
||||
* \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
|
||||
*/
|
||||
template< typename _MatrixType, typename _Preconditioner>
|
||||
class GMRES : public IterativeSolverBase<GMRES<_MatrixType,_Preconditioner> >
|
||||
template< typename MatrixType_, typename Preconditioner_>
|
||||
class GMRES : public IterativeSolverBase<GMRES<MatrixType_,Preconditioner_> >
|
||||
{
|
||||
typedef IterativeSolverBase<GMRES> Base;
|
||||
using Base::matrix;
|
||||
@@ -280,10 +280,10 @@ private:
|
||||
|
||||
public:
|
||||
using Base::_solve_impl;
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef MatrixType_ MatrixType;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename MatrixType::RealScalar RealScalar;
|
||||
typedef _Preconditioner Preconditioner;
|
||||
typedef Preconditioner_ Preconditioner;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -271,17 +271,17 @@ namespace Eigen
|
||||
|
||||
} // namespace internal
|
||||
|
||||
template <typename _MatrixType, typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> >
|
||||
template <typename MatrixType_, typename Preconditioner_ = DiagonalPreconditioner<typename MatrixType_::Scalar> >
|
||||
class IDRS;
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <typename _MatrixType, typename _Preconditioner>
|
||||
struct traits<Eigen::IDRS<_MatrixType, _Preconditioner> >
|
||||
template <typename MatrixType_, typename Preconditioner_>
|
||||
struct traits<Eigen::IDRS<MatrixType_, Preconditioner_> >
|
||||
{
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef _Preconditioner Preconditioner;
|
||||
typedef MatrixType_ MatrixType;
|
||||
typedef Preconditioner_ Preconditioner;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
@@ -305,8 +305,8 @@ namespace Eigen
|
||||
* and uses 7 vectors. GMRES terminates in at most N iterations, and uses I+3 vectors, with I the number of iterations.
|
||||
* Restarting GMRES limits the memory consumption, but destroys the finite termination property.
|
||||
*
|
||||
* \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
|
||||
* \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
|
||||
* \tparam MatrixType_ the type of the sparse matrix A, can be a dense or a sparse matrix.
|
||||
* \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
|
||||
*
|
||||
* \implsparsesolverconcept
|
||||
*
|
||||
@@ -327,15 +327,15 @@ namespace Eigen
|
||||
*
|
||||
* \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
|
||||
*/
|
||||
template <typename _MatrixType, typename _Preconditioner>
|
||||
class IDRS : public IterativeSolverBase<IDRS<_MatrixType, _Preconditioner> >
|
||||
template <typename MatrixType_, typename Preconditioner_>
|
||||
class IDRS : public IterativeSolverBase<IDRS<MatrixType_, Preconditioner_> >
|
||||
{
|
||||
|
||||
public:
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef MatrixType_ MatrixType;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename MatrixType::RealScalar RealScalar;
|
||||
typedef _Preconditioner Preconditioner;
|
||||
typedef Preconditioner_ Preconditioner;
|
||||
|
||||
private:
|
||||
typedef IterativeSolverBase<IDRS> Base;
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
template <typename _Scalar>
|
||||
class IncompleteLU : public SparseSolverBase<IncompleteLU<_Scalar> >
|
||||
template <typename Scalar_>
|
||||
class IncompleteLU : public SparseSolverBase<IncompleteLU<Scalar_> >
|
||||
{
|
||||
protected:
|
||||
typedef SparseSolverBase<IncompleteLU<_Scalar> > Base;
|
||||
typedef SparseSolverBase<IncompleteLU<Scalar_> > Base;
|
||||
using Base::m_isInitialized;
|
||||
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef Matrix<Scalar,Dynamic,1> Vector;
|
||||
typedef typename Vector::Index Index;
|
||||
typedef SparseMatrix<Scalar,RowMajor> FactorType;
|
||||
|
||||
@@ -138,17 +138,17 @@ namespace Eigen {
|
||||
|
||||
}
|
||||
|
||||
template< typename _MatrixType, int _UpLo=Lower,
|
||||
typename _Preconditioner = IdentityPreconditioner>
|
||||
template< typename MatrixType_, int UpLo_=Lower,
|
||||
typename Preconditioner_ = IdentityPreconditioner>
|
||||
class MINRES;
|
||||
|
||||
namespace internal {
|
||||
|
||||
template< typename _MatrixType, int _UpLo, typename _Preconditioner>
|
||||
struct traits<MINRES<_MatrixType,_UpLo,_Preconditioner> >
|
||||
template< typename MatrixType_, int UpLo_, typename Preconditioner_>
|
||||
struct traits<MINRES<MatrixType_,UpLo_,Preconditioner_> >
|
||||
{
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef _Preconditioner Preconditioner;
|
||||
typedef MatrixType_ MatrixType;
|
||||
typedef Preconditioner_ Preconditioner;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -160,10 +160,10 @@ namespace Eigen {
|
||||
* of Paige and Saunders (1975). The sparse matrix A must be symmetric (possibly indefinite).
|
||||
* The vectors x and b can be either dense or sparse.
|
||||
*
|
||||
* \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
|
||||
* \tparam _UpLo the triangular part that will be used for the computations. It can be Lower,
|
||||
* \tparam MatrixType_ the type of the sparse matrix A, can be a dense or a sparse matrix.
|
||||
* \tparam UpLo_ the triangular part that will be used for the computations. It can be Lower,
|
||||
* Upper, or Lower|Upper in which the full matrix entries will be considered. Default is Lower.
|
||||
* \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
|
||||
* \tparam Preconditioner_ the type of the preconditioner. Default is DiagonalPreconditioner
|
||||
*
|
||||
* The maximal number of iterations and tolerance value can be controlled via the setMaxIterations()
|
||||
* and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations
|
||||
@@ -191,8 +191,8 @@ namespace Eigen {
|
||||
*
|
||||
* \sa class ConjugateGradient, BiCGSTAB, SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
|
||||
*/
|
||||
template< typename _MatrixType, int _UpLo, typename _Preconditioner>
|
||||
class MINRES : public IterativeSolverBase<MINRES<_MatrixType,_UpLo,_Preconditioner> >
|
||||
template< typename MatrixType_, int UpLo_, typename Preconditioner_>
|
||||
class MINRES : public IterativeSolverBase<MINRES<MatrixType_,UpLo_,Preconditioner_> >
|
||||
{
|
||||
|
||||
typedef IterativeSolverBase<MINRES> Base;
|
||||
@@ -203,12 +203,12 @@ namespace Eigen {
|
||||
using Base::m_isInitialized;
|
||||
public:
|
||||
using Base::_solve_impl;
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef MatrixType_ MatrixType;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename MatrixType::RealScalar RealScalar;
|
||||
typedef _Preconditioner Preconditioner;
|
||||
typedef Preconditioner_ Preconditioner;
|
||||
|
||||
enum {UpLo = _UpLo};
|
||||
enum {UpLo = UpLo_};
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -38,17 +38,17 @@ namespace Eigen {
|
||||
* x = scal.RightScaling().cwiseProduct(x);
|
||||
* \endcode
|
||||
*
|
||||
* \tparam _MatrixType the type of the matrix. It should be a real square sparsematrix
|
||||
* \tparam MatrixType_ the type of the matrix. It should be a real square sparsematrix
|
||||
*
|
||||
* References : D. Ruiz and B. Ucar, A Symmetry Preserving Algorithm for Matrix Scaling, INRIA Research report RR-7552
|
||||
*
|
||||
* \sa \ref IncompleteLUT
|
||||
*/
|
||||
template<typename _MatrixType>
|
||||
template<typename MatrixType_>
|
||||
class IterScaling
|
||||
{
|
||||
public:
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef MatrixType_ MatrixType;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename MatrixType::Index Index;
|
||||
|
||||
|
||||
@@ -198,11 +198,11 @@ void KroneckerProductSparse<Lhs,Rhs>::evalTo(Dest& dst) const
|
||||
|
||||
namespace internal {
|
||||
|
||||
template<typename _Lhs, typename _Rhs>
|
||||
struct traits<KroneckerProduct<_Lhs,_Rhs> >
|
||||
template<typename Lhs_, typename Rhs_>
|
||||
struct traits<KroneckerProduct<Lhs_,Rhs_> >
|
||||
{
|
||||
typedef typename remove_all<_Lhs>::type Lhs;
|
||||
typedef typename remove_all<_Rhs>::type Rhs;
|
||||
typedef typename remove_all<Lhs_>::type Lhs;
|
||||
typedef typename remove_all<Rhs_>::type Rhs;
|
||||
typedef typename ScalarBinaryOpTraits<typename Lhs::Scalar, typename Rhs::Scalar>::ReturnType Scalar;
|
||||
typedef typename promote_index_type<typename Lhs::StorageIndex, typename Rhs::StorageIndex>::type StorageIndex;
|
||||
|
||||
@@ -216,12 +216,12 @@ struct traits<KroneckerProduct<_Lhs,_Rhs> >
|
||||
typedef Matrix<Scalar,Rows,Cols> ReturnType;
|
||||
};
|
||||
|
||||
template<typename _Lhs, typename _Rhs>
|
||||
struct traits<KroneckerProductSparse<_Lhs,_Rhs> >
|
||||
template<typename Lhs_, typename Rhs_>
|
||||
struct traits<KroneckerProductSparse<Lhs_,Rhs_> >
|
||||
{
|
||||
typedef MatrixXpr XprKind;
|
||||
typedef typename remove_all<_Lhs>::type Lhs;
|
||||
typedef typename remove_all<_Rhs>::type Rhs;
|
||||
typedef typename remove_all<Lhs_>::type Lhs;
|
||||
typedef typename remove_all<Rhs_>::type Rhs;
|
||||
typedef typename ScalarBinaryOpTraits<typename Lhs::Scalar, typename Rhs::Scalar>::ReturnType Scalar;
|
||||
typedef typename cwise_promote_storage_type<typename traits<Lhs>::StorageKind, typename traits<Rhs>::StorageKind, scalar_product_op<typename Lhs::Scalar, typename Rhs::Scalar> >::ret StorageKind;
|
||||
typedef typename promote_index_type<typename Lhs::StorageIndex, typename Rhs::StorageIndex>::type StorageIndex;
|
||||
|
||||
@@ -98,9 +98,9 @@ void lmqrsolv(
|
||||
x = iPerm * wa;
|
||||
}
|
||||
|
||||
template <typename Scalar, int _Options, typename Index>
|
||||
template <typename Scalar, int Options_, typename Index>
|
||||
void lmqrsolv(
|
||||
SparseMatrix<Scalar,_Options,Index> &s,
|
||||
SparseMatrix<Scalar,Options_,Index> &s,
|
||||
const PermutationMatrix<Dynamic,Dynamic> &iPerm,
|
||||
const Matrix<Scalar,Dynamic,1> &diag,
|
||||
const Matrix<Scalar,Dynamic,1> &qtb,
|
||||
|
||||
@@ -38,10 +38,10 @@ namespace LevenbergMarquardtSpace {
|
||||
};
|
||||
}
|
||||
|
||||
template <typename _Scalar, int NX=Dynamic, int NY=Dynamic>
|
||||
template <typename Scalar_, int NX=Dynamic, int NY=Dynamic>
|
||||
struct DenseFunctor
|
||||
{
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
enum {
|
||||
InputsAtCompileTime = NX,
|
||||
ValuesAtCompileTime = NY
|
||||
@@ -65,11 +65,11 @@ struct DenseFunctor
|
||||
// should be defined in derived classes
|
||||
};
|
||||
|
||||
template <typename _Scalar, typename _Index>
|
||||
template <typename Scalar_, typename Index_>
|
||||
struct SparseFunctor
|
||||
{
|
||||
typedef _Scalar Scalar;
|
||||
typedef _Index Index;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef Index_ Index;
|
||||
typedef Matrix<Scalar,Dynamic,1> InputType;
|
||||
typedef Matrix<Scalar,Dynamic,1> ValueType;
|
||||
typedef SparseMatrix<Scalar, ColMajor, Index> JacobianType;
|
||||
@@ -106,11 +106,11 @@ void lmpar2(const QRSolver &qr, const VectorType &diag, const VectorType &qtb,
|
||||
* Check wikipedia for more information.
|
||||
* http://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm
|
||||
*/
|
||||
template<typename _FunctorType>
|
||||
template<typename FunctorType_>
|
||||
class LevenbergMarquardt : internal::no_assignment_operator
|
||||
{
|
||||
public:
|
||||
typedef _FunctorType FunctorType;
|
||||
typedef FunctorType_ FunctorType;
|
||||
typedef typename FunctorType::QRSolver QRSolver;
|
||||
typedef typename FunctorType::JacobianType JacobianType;
|
||||
typedef typename JacobianType::Scalar Scalar;
|
||||
|
||||
@@ -32,11 +32,11 @@ enum NumericalDiffMode {
|
||||
*
|
||||
* Currently only "Forward" and "Central" scheme are implemented.
|
||||
*/
|
||||
template<typename _Functor, NumericalDiffMode mode=Forward>
|
||||
class NumericalDiff : public _Functor
|
||||
template<typename Functor_, NumericalDiffMode mode=Forward>
|
||||
class NumericalDiff : public Functor_
|
||||
{
|
||||
public:
|
||||
typedef _Functor Functor;
|
||||
typedef Functor_ Functor;
|
||||
typedef typename Functor::Scalar Scalar;
|
||||
typedef typename Functor::InputType InputType;
|
||||
typedef typename Functor::ValueType ValueType;
|
||||
|
||||
@@ -29,18 +29,18 @@ 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_1=decrement_if_fixed_size<Deg>::ret
|
||||
};
|
||||
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
typedef Matrix<Scalar, Deg, 1> RightColumn;
|
||||
//typedef DiagonalMatrix< Scalar, Deg_1, Deg_1 > BottomLeftDiagonal;
|
||||
@@ -54,7 +54,7 @@ class companion
|
||||
typedef DenseIndex Index;
|
||||
|
||||
public:
|
||||
EIGEN_STRONG_INLINE const _Scalar operator()(Index row, Index col ) const
|
||||
EIGEN_STRONG_INLINE const Scalar_ operator()(Index row, Index col ) const
|
||||
{
|
||||
if( m_bl_diag.rows() > col )
|
||||
{
|
||||
@@ -130,9 +130,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
|
||||
@@ -184,9 +184,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; }
|
||||
@@ -197,7 +197,7 @@ bool companion<_Scalar,_Deg>::balancedR( RealScalar colNorm, RealScalar rowNorm,
|
||||
* of the row and column norm
|
||||
*/
|
||||
const RealScalar q = colNorm/rowNorm;
|
||||
if( !isApprox( q, _Scalar(1) ) )
|
||||
if( !isApprox( q, Scalar_(1) ) )
|
||||
{
|
||||
rowB = sqrt( colNorm/rowNorm );
|
||||
colB = RealScalar(1)/rowB;
|
||||
@@ -211,8 +211,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 );
|
||||
|
||||
@@ -25,13 +25,13 @@ 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 Scalar_ Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
typedef std::complex<RealScalar> RootType;
|
||||
typedef Matrix<RootType,_Deg,1> RootsType;
|
||||
@@ -59,7 +59,7 @@ class PolynomialSolverBase
|
||||
* i.e. the real part of the complex roots that have an imaginary part which
|
||||
* absolute value is smaller than absImaginaryThreshold.
|
||||
* absImaginaryThreshold takes the dummy_precision associated
|
||||
* with the _Scalar template parameter of the PolynomialSolver class as the default value.
|
||||
* with the Scalar_ template parameter of the PolynomialSolver class as the default value.
|
||||
*
|
||||
* \param[out] bi_seq : the back insertion sequence (stl concept)
|
||||
* \param[in] absImaginaryThreshold : the maximum bound of the imaginary part of a complex
|
||||
@@ -200,7 +200,7 @@ class PolynomialSolverBase
|
||||
* A real root is defined as the real part of a complex root with absolute imaginary
|
||||
* part smallest than absImaginaryThreshold.
|
||||
* absImaginaryThreshold takes the dummy_precision associated
|
||||
* with the _Scalar template parameter of the PolynomialSolver class as the default value.
|
||||
* with the Scalar_ template parameter of the PolynomialSolver class as the default value.
|
||||
* If no real root is found the boolean hasArealRoot is set to false and the real part of
|
||||
* the root with smallest absolute imaginary part is returned instead.
|
||||
*
|
||||
@@ -223,7 +223,7 @@ class PolynomialSolverBase
|
||||
* A real root is defined as the real part of a complex root with absolute imaginary
|
||||
* part smallest than absImaginaryThreshold.
|
||||
* absImaginaryThreshold takes the dummy_precision associated
|
||||
* with the _Scalar template parameter of the PolynomialSolver class as the default value.
|
||||
* with the Scalar_ template parameter of the PolynomialSolver class as the default value.
|
||||
* If no real root is found the boolean hasArealRoot is set to false and the real part of
|
||||
* the root with smallest absolute imaginary part is returned instead.
|
||||
*
|
||||
@@ -246,7 +246,7 @@ class PolynomialSolverBase
|
||||
* A real root is defined as the real part of a complex root with absolute imaginary
|
||||
* part smallest than absImaginaryThreshold.
|
||||
* absImaginaryThreshold takes the dummy_precision associated
|
||||
* with the _Scalar template parameter of the PolynomialSolver class as the default value.
|
||||
* with the Scalar_ template parameter of the PolynomialSolver class as the default value.
|
||||
* If no real root is found the boolean hasArealRoot is set to false and the real part of
|
||||
* the root with smallest absolute imaginary part is returned instead.
|
||||
*
|
||||
@@ -269,7 +269,7 @@ class PolynomialSolverBase
|
||||
* A real root is defined as the real part of a complex root with absolute imaginary
|
||||
* part smallest than absImaginaryThreshold.
|
||||
* absImaginaryThreshold takes the dummy_precision associated
|
||||
* with the _Scalar template parameter of the PolynomialSolver class as the default value.
|
||||
* with the Scalar_ template parameter of the PolynomialSolver class as the default value.
|
||||
* If no real root is found the boolean hasArealRoot is set to false and the real part of
|
||||
* the root with smallest absolute imaginary part is returned instead.
|
||||
*
|
||||
@@ -306,7 +306,7 @@ class PolynomialSolverBase
|
||||
*
|
||||
* Computes the complex roots of a real polynomial.
|
||||
*
|
||||
* \param _Scalar the scalar type, i.e., the type of the polynomial coefficients
|
||||
* \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.
|
||||
*
|
||||
@@ -327,13 +327,13 @@ 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;
|
||||
@@ -395,11 +395,11 @@ class PolynomialSolver : public PolynomialSolverBase<_Scalar,_Deg>
|
||||
};
|
||||
|
||||
|
||||
template< typename _Scalar >
|
||||
class PolynomialSolver<_Scalar,1> : public PolynomialSolverBase<_Scalar,1>
|
||||
template< typename Scalar_ >
|
||||
class PolynomialSolver<Scalar_,1> : public PolynomialSolverBase<Scalar_,1>
|
||||
{
|
||||
public:
|
||||
typedef PolynomialSolverBase<_Scalar,1> PS_Base;
|
||||
typedef PolynomialSolverBase<Scalar_,1> PS_Base;
|
||||
EIGEN_POLYNOMIAL_SOLVER_BASE_INHERITED_TYPES( PS_Base )
|
||||
|
||||
public:
|
||||
|
||||
@@ -116,7 +116,7 @@ protected:
|
||||
* using the default algorithm.
|
||||
*/
|
||||
template<typename MatrixType>
|
||||
//template<typename _Scalar>
|
||||
//template<typename Scalar_>
|
||||
void SkylineInplaceLU<MatrixType>::compute() {
|
||||
const size_t rows = m_lu.rows();
|
||||
const size_t cols = m_lu.cols();
|
||||
|
||||
@@ -24,16 +24,16 @@ namespace Eigen {
|
||||
* This class implements a skyline matrix using the very uncommon storage
|
||||
* scheme.
|
||||
*
|
||||
* \param _Scalar the scalar type, i.e. the type of the coefficients
|
||||
* \param _Options Union of bit flags controlling the storage scheme. Currently the only possibility
|
||||
* \param Scalar_ the scalar type, i.e. the type of the coefficients
|
||||
* \param Options_ Union of bit flags controlling the storage scheme. Currently the only possibility
|
||||
* is RowMajor. The default is 0 which means column-major.
|
||||
*
|
||||
*
|
||||
*/
|
||||
namespace internal {
|
||||
template<typename _Scalar, int _Options>
|
||||
struct traits<SkylineMatrix<_Scalar, _Options> > {
|
||||
typedef _Scalar Scalar;
|
||||
template<typename Scalar_, int Options_>
|
||||
struct traits<SkylineMatrix<Scalar_, Options_> > {
|
||||
typedef Scalar_ Scalar;
|
||||
typedef Sparse StorageKind;
|
||||
|
||||
enum {
|
||||
@@ -41,15 +41,15 @@ struct traits<SkylineMatrix<_Scalar, _Options> > {
|
||||
ColsAtCompileTime = Dynamic,
|
||||
MaxRowsAtCompileTime = Dynamic,
|
||||
MaxColsAtCompileTime = Dynamic,
|
||||
Flags = SkylineBit | _Options,
|
||||
Flags = SkylineBit | Options_,
|
||||
CoeffReadCost = NumTraits<Scalar>::ReadCost,
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
template<typename _Scalar, int _Options>
|
||||
template<typename Scalar_, int Options_>
|
||||
class SkylineMatrix
|
||||
: public SkylineMatrixBase<SkylineMatrix<_Scalar, _Options> > {
|
||||
: public SkylineMatrixBase<SkylineMatrix<Scalar_, Options_> > {
|
||||
public:
|
||||
EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(SkylineMatrix)
|
||||
EIGEN_SKYLINE_INHERIT_ASSIGNMENT_OPERATOR(SkylineMatrix, +=)
|
||||
@@ -731,15 +731,15 @@ public:
|
||||
Scalar sum() const;
|
||||
};
|
||||
|
||||
template<typename Scalar, int _Options>
|
||||
class SkylineMatrix<Scalar, _Options>::InnerUpperIterator {
|
||||
template<typename Scalar, int Options_>
|
||||
class SkylineMatrix<Scalar, Options_>::InnerUpperIterator {
|
||||
public:
|
||||
|
||||
InnerUpperIterator(const SkylineMatrix& mat, Index outer)
|
||||
: m_matrix(mat), m_outer(outer),
|
||||
m_id(_Options == RowMajor ? mat.m_colStartIndex[outer] : mat.m_rowStartIndex[outer] + 1),
|
||||
m_id(Options_ == RowMajor ? mat.m_colStartIndex[outer] : mat.m_rowStartIndex[outer] + 1),
|
||||
m_start(m_id),
|
||||
m_end(_Options == RowMajor ? mat.m_colStartIndex[outer + 1] : mat.m_rowStartIndex[outer + 1] + 1) {
|
||||
m_end(Options_ == RowMajor ? mat.m_colStartIndex[outer + 1] : mat.m_rowStartIndex[outer + 1] + 1) {
|
||||
}
|
||||
|
||||
inline InnerUpperIterator & operator++() {
|
||||
@@ -793,16 +793,16 @@ protected:
|
||||
const Index m_end;
|
||||
};
|
||||
|
||||
template<typename Scalar, int _Options>
|
||||
class SkylineMatrix<Scalar, _Options>::InnerLowerIterator {
|
||||
template<typename Scalar, int Options_>
|
||||
class SkylineMatrix<Scalar, Options_>::InnerLowerIterator {
|
||||
public:
|
||||
|
||||
InnerLowerIterator(const SkylineMatrix& mat, Index outer)
|
||||
: m_matrix(mat),
|
||||
m_outer(outer),
|
||||
m_id(_Options == RowMajor ? mat.m_rowStartIndex[outer] : mat.m_colStartIndex[outer] + 1),
|
||||
m_id(Options_ == RowMajor ? mat.m_rowStartIndex[outer] : mat.m_colStartIndex[outer] + 1),
|
||||
m_start(m_id),
|
||||
m_end(_Options == RowMajor ? mat.m_rowStartIndex[outer + 1] : mat.m_colStartIndex[outer + 1] + 1) {
|
||||
m_end(Options_ == RowMajor ? mat.m_rowStartIndex[outer + 1] : mat.m_colStartIndex[outer + 1] + 1) {
|
||||
}
|
||||
|
||||
inline InnerLowerIterator & operator++() {
|
||||
|
||||
@@ -120,17 +120,17 @@ protected:
|
||||
|
||||
template<typename Lhs, typename Rhs, typename Dest>
|
||||
EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs& lhs, const Rhs& rhs, Dest& dst) {
|
||||
typedef typename remove_all<Lhs>::type _Lhs;
|
||||
typedef typename remove_all<Rhs>::type _Rhs;
|
||||
typedef typename remove_all<Lhs>::type Lhs_;
|
||||
typedef typename remove_all<Rhs>::type Rhs_;
|
||||
typedef typename traits<Lhs>::Scalar Scalar;
|
||||
|
||||
enum {
|
||||
LhsIsRowMajor = (_Lhs::Flags & RowMajorBit) == RowMajorBit,
|
||||
LhsIsSelfAdjoint = (_Lhs::Flags & SelfAdjointBit) == SelfAdjointBit,
|
||||
LhsIsRowMajor = (Lhs_::Flags & RowMajorBit) == RowMajorBit,
|
||||
LhsIsSelfAdjoint = (Lhs_::Flags & SelfAdjointBit) == SelfAdjointBit,
|
||||
ProcessFirstHalf = LhsIsSelfAdjoint
|
||||
&& (((_Lhs::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
|
||||
|| ((_Lhs::Flags & UpperTriangularBit) && !LhsIsRowMajor)
|
||||
|| ((_Lhs::Flags & LowerTriangularBit) && LhsIsRowMajor)),
|
||||
&& (((Lhs_::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
|
||||
|| ((Lhs_::Flags & UpperTriangularBit) && !LhsIsRowMajor)
|
||||
|| ((Lhs_::Flags & LowerTriangularBit) && LhsIsRowMajor)),
|
||||
ProcessSecondHalf = LhsIsSelfAdjoint && (!ProcessFirstHalf)
|
||||
};
|
||||
|
||||
@@ -142,7 +142,7 @@ EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs& lhs, cons
|
||||
}
|
||||
//Use matrix lower triangular part
|
||||
for (Index row = 0; row < lhs.rows(); row++) {
|
||||
typename _Lhs::InnerLowerIterator lIt(lhs, row);
|
||||
typename Lhs_::InnerLowerIterator lIt(lhs, row);
|
||||
const Index stop = lIt.col() + lIt.size();
|
||||
for (Index col = 0; col < rhs.cols(); col++) {
|
||||
|
||||
@@ -162,7 +162,7 @@ EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs& lhs, cons
|
||||
|
||||
//Use matrix upper triangular part
|
||||
for (Index lhscol = 0; lhscol < lhs.cols(); lhscol++) {
|
||||
typename _Lhs::InnerUpperIterator uIt(lhs, lhscol);
|
||||
typename Lhs_::InnerUpperIterator uIt(lhs, lhscol);
|
||||
const Index stop = uIt.size() + uIt.row();
|
||||
for (Index rhscol = 0; rhscol < rhs.cols(); rhscol++) {
|
||||
|
||||
@@ -183,17 +183,17 @@ EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs& lhs, cons
|
||||
|
||||
template<typename Lhs, typename Rhs, typename Dest>
|
||||
EIGEN_DONT_INLINE void skyline_col_major_time_dense_product(const Lhs& lhs, const Rhs& rhs, Dest& dst) {
|
||||
typedef typename remove_all<Lhs>::type _Lhs;
|
||||
typedef typename remove_all<Rhs>::type _Rhs;
|
||||
typedef typename remove_all<Lhs>::type Lhs_;
|
||||
typedef typename remove_all<Rhs>::type Rhs_;
|
||||
typedef typename traits<Lhs>::Scalar Scalar;
|
||||
|
||||
enum {
|
||||
LhsIsRowMajor = (_Lhs::Flags & RowMajorBit) == RowMajorBit,
|
||||
LhsIsSelfAdjoint = (_Lhs::Flags & SelfAdjointBit) == SelfAdjointBit,
|
||||
LhsIsRowMajor = (Lhs_::Flags & RowMajorBit) == RowMajorBit,
|
||||
LhsIsSelfAdjoint = (Lhs_::Flags & SelfAdjointBit) == SelfAdjointBit,
|
||||
ProcessFirstHalf = LhsIsSelfAdjoint
|
||||
&& (((_Lhs::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
|
||||
|| ((_Lhs::Flags & UpperTriangularBit) && !LhsIsRowMajor)
|
||||
|| ((_Lhs::Flags & LowerTriangularBit) && LhsIsRowMajor)),
|
||||
&& (((Lhs_::Flags & (UpperTriangularBit | LowerTriangularBit)) == 0)
|
||||
|| ((Lhs_::Flags & UpperTriangularBit) && !LhsIsRowMajor)
|
||||
|| ((Lhs_::Flags & LowerTriangularBit) && LhsIsRowMajor)),
|
||||
ProcessSecondHalf = LhsIsSelfAdjoint && (!ProcessFirstHalf)
|
||||
};
|
||||
|
||||
@@ -206,7 +206,7 @@ EIGEN_DONT_INLINE void skyline_col_major_time_dense_product(const Lhs& lhs, cons
|
||||
|
||||
//Use matrix upper triangular part
|
||||
for (Index row = 0; row < lhs.rows(); row++) {
|
||||
typename _Lhs::InnerUpperIterator uIt(lhs, row);
|
||||
typename Lhs_::InnerUpperIterator uIt(lhs, row);
|
||||
const Index stop = uIt.col() + uIt.size();
|
||||
for (Index col = 0; col < rhs.cols(); col++) {
|
||||
|
||||
@@ -227,7 +227,7 @@ EIGEN_DONT_INLINE void skyline_col_major_time_dense_product(const Lhs& lhs, cons
|
||||
|
||||
//Use matrix lower triangular part
|
||||
for (Index lhscol = 0; lhscol < lhs.cols(); lhscol++) {
|
||||
typename _Lhs::InnerLowerIterator lIt(lhs, lhscol);
|
||||
typename Lhs_::InnerLowerIterator lIt(lhs, lhscol);
|
||||
const Index stop = lIt.size() + lIt.row();
|
||||
for (Index rhscol = 0; rhscol < rhs.cols(); rhscol++) {
|
||||
|
||||
@@ -272,7 +272,7 @@ struct skyline_product_selector<Lhs, Rhs, ResultType, ColMajor> {
|
||||
// template<typename Derived>
|
||||
// template<typename Lhs, typename Rhs >
|
||||
// Derived & MatrixBase<Derived>::lazyAssign(const SkylineProduct<Lhs, Rhs, SkylineTimeDenseProduct>& product) {
|
||||
// typedef typename internal::remove_all<Lhs>::type _Lhs;
|
||||
// typedef typename internal::remove_all<Lhs>::type Lhs_;
|
||||
// internal::skyline_product_selector<typename internal::remove_all<Lhs>::type,
|
||||
// typename internal::remove_all<Rhs>::type,
|
||||
// Derived>::run(product.lhs(), product.rhs(), derived());
|
||||
|
||||
@@ -61,10 +61,10 @@ EIGEN_STRONG_INLINE Derived& operator Op(const Other& scalar) \
|
||||
_EIGEN_SKYLINE_GENERIC_PUBLIC_INTERFACE(Derived, Eigen::SkylineMatrixBase<Derived>)
|
||||
|
||||
template<typename Derived> class SkylineMatrixBase;
|
||||
template<typename _Scalar, int _Flags = 0> class SkylineMatrix;
|
||||
template<typename _Scalar, int _Flags = 0> class DynamicSkylineMatrix;
|
||||
template<typename _Scalar, int _Flags = 0> class SkylineVector;
|
||||
template<typename _Scalar, int _Flags = 0> class MappedSkylineMatrix;
|
||||
template<typename Scalar_, int _Flags = 0> class SkylineMatrix;
|
||||
template<typename Scalar_, int _Flags = 0> class DynamicSkylineMatrix;
|
||||
template<typename Scalar_, int _Flags = 0> class SkylineVector;
|
||||
template<typename Scalar_, int _Flags = 0> class MappedSkylineMatrix;
|
||||
|
||||
namespace internal {
|
||||
|
||||
@@ -73,13 +73,13 @@ template<typename Lhs, typename Rhs, int ProductMode = skyline_product_mode<Lhs,
|
||||
|
||||
template<typename T> class eval<T,IsSkyline>
|
||||
{
|
||||
typedef typename traits<T>::Scalar _Scalar;
|
||||
typedef typename traits<T>::Scalar Scalar_;
|
||||
enum {
|
||||
_Flags = traits<T>::Flags
|
||||
};
|
||||
|
||||
public:
|
||||
typedef SkylineMatrix<_Scalar, _Flags> type;
|
||||
typedef SkylineMatrix<Scalar_, _Flags> type;
|
||||
};
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Eigen {
|
||||
|
||||
#if 0
|
||||
|
||||
// NOTE Have to be reimplemented as a specialization of BlockImpl< DynamicSparseMatrix<_Scalar, _Options, _Index>, ... >
|
||||
// NOTE Have to be reimplemented as a specialization of BlockImpl< DynamicSparseMatrix<Scalar_, Options_, Index_>, ... >
|
||||
// See SparseBlock.h for an example
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@ namespace Eigen {
|
||||
* specialisation for DynamicSparseMatrix
|
||||
***************************************************************************/
|
||||
|
||||
template<typename _Scalar, int _Options, typename _Index, int Size>
|
||||
class SparseInnerVectorSet<DynamicSparseMatrix<_Scalar, _Options, _Index>, Size>
|
||||
: public SparseMatrixBase<SparseInnerVectorSet<DynamicSparseMatrix<_Scalar, _Options, _Index>, Size> >
|
||||
template<typename Scalar_, int Options_, typename Index_, int Size>
|
||||
class SparseInnerVectorSet<DynamicSparseMatrix<Scalar_, Options_, Index_>, Size>
|
||||
: public SparseMatrixBase<SparseInnerVectorSet<DynamicSparseMatrix<Scalar_, Options_, Index_>, Size> >
|
||||
{
|
||||
typedef DynamicSparseMatrix<_Scalar, _Options, _Index> MatrixType;
|
||||
typedef DynamicSparseMatrix<Scalar_, Options_, Index_> MatrixType;
|
||||
public:
|
||||
|
||||
enum { IsRowMajor = internal::traits<SparseInnerVectorSet>::IsRowMajor };
|
||||
|
||||
@@ -46,21 +46,21 @@ namespace Eigen {
|
||||
* It is obviously required to describe the block layout beforehand by calling either
|
||||
* setBlockSize() for fixed-size blocks or setBlockLayout for variable-size blocks.
|
||||
*
|
||||
* \tparam _Scalar The Scalar type
|
||||
* \tparam Scalar_ The Scalar type
|
||||
* \tparam _BlockAtCompileTime The block layout option. It takes the following values
|
||||
* Dynamic : block size known at runtime
|
||||
* a numeric number : fixed-size block known at compile time
|
||||
*/
|
||||
template<typename _Scalar, int _BlockAtCompileTime=Dynamic, int _Options=ColMajor, typename _StorageIndex=int> class BlockSparseMatrix;
|
||||
template<typename Scalar_, int _BlockAtCompileTime=Dynamic, int Options_=ColMajor, typename StorageIndex_=int> class BlockSparseMatrix;
|
||||
|
||||
template<typename BlockSparseMatrixT> class BlockSparseMatrixView;
|
||||
|
||||
namespace internal {
|
||||
template<typename _Scalar, int _BlockAtCompileTime, int _Options, typename _Index>
|
||||
struct traits<BlockSparseMatrix<_Scalar,_BlockAtCompileTime,_Options, _Index> >
|
||||
template<typename Scalar_, int _BlockAtCompileTime, int Options_, typename Index_>
|
||||
struct traits<BlockSparseMatrix<Scalar_,_BlockAtCompileTime,Options_, Index_> >
|
||||
{
|
||||
typedef _Scalar Scalar;
|
||||
typedef _Index Index;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef Index_ Index;
|
||||
typedef Sparse StorageKind; // FIXME Where is it used ??
|
||||
typedef MatrixXpr XprKind;
|
||||
enum {
|
||||
@@ -69,7 +69,7 @@ struct traits<BlockSparseMatrix<_Scalar,_BlockAtCompileTime,_Options, _Index> >
|
||||
MaxRowsAtCompileTime = Dynamic,
|
||||
MaxColsAtCompileTime = Dynamic,
|
||||
BlockSize = _BlockAtCompileTime,
|
||||
Flags = _Options | NestByRefBit | LvalueBit,
|
||||
Flags = Options_ | NestByRefBit | LvalueBit,
|
||||
CoeffReadCost = NumTraits<Scalar>::ReadCost,
|
||||
SupportedAccessPatterns = InnerRandomAccessPattern
|
||||
};
|
||||
@@ -280,17 +280,17 @@ class BlockSparseTimeDenseProduct
|
||||
BlockSparseTimeDenseProduct& operator=(const BlockSparseTimeDenseProduct&);
|
||||
};
|
||||
|
||||
template<typename _Scalar, int _BlockAtCompileTime, int _Options, typename _StorageIndex>
|
||||
class BlockSparseMatrix : public SparseMatrixBase<BlockSparseMatrix<_Scalar,_BlockAtCompileTime, _Options,_StorageIndex> >
|
||||
template<typename Scalar_, int _BlockAtCompileTime, int Options_, typename StorageIndex_>
|
||||
class BlockSparseMatrix : public SparseMatrixBase<BlockSparseMatrix<Scalar_,_BlockAtCompileTime, Options_,StorageIndex_> >
|
||||
{
|
||||
public:
|
||||
typedef _Scalar Scalar;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
typedef _StorageIndex StorageIndex;
|
||||
typedef typename internal::ref_selector<BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex> >::type Nested;
|
||||
typedef StorageIndex_ StorageIndex;
|
||||
typedef typename internal::ref_selector<BlockSparseMatrix<Scalar_, _BlockAtCompileTime, Options_, StorageIndex_> >::type Nested;
|
||||
|
||||
enum {
|
||||
Options = _Options,
|
||||
Options = Options_,
|
||||
Flags = Options,
|
||||
BlockSize=_BlockAtCompileTime,
|
||||
RowsAtCompileTime = Dynamic,
|
||||
@@ -968,13 +968,13 @@ class BlockSparseMatrix : public SparseMatrixBase<BlockSparseMatrix<_Scalar,_Blo
|
||||
Index m_blockSize; // Size of a block for fixed-size blocks, otherwise -1
|
||||
};
|
||||
|
||||
template<typename _Scalar, int _BlockAtCompileTime, int _Options, typename _StorageIndex>
|
||||
class BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex>::BlockInnerIterator
|
||||
template<typename Scalar_, int _BlockAtCompileTime, int Options_, typename StorageIndex_>
|
||||
class BlockSparseMatrix<Scalar_, _BlockAtCompileTime, Options_, StorageIndex_>::BlockInnerIterator
|
||||
{
|
||||
public:
|
||||
|
||||
enum{
|
||||
Flags = _Options
|
||||
Flags = Options_
|
||||
};
|
||||
|
||||
BlockInnerIterator(const BlockSparseMatrix& mat, const Index outer)
|
||||
@@ -1010,14 +1010,14 @@ class BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex>::
|
||||
inline operator bool() const { return (m_id < m_end); }
|
||||
|
||||
protected:
|
||||
const BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, StorageIndex>& m_mat;
|
||||
const BlockSparseMatrix<Scalar_, _BlockAtCompileTime, Options_, StorageIndex>& m_mat;
|
||||
const Index m_outer;
|
||||
Index m_id;
|
||||
Index m_end;
|
||||
};
|
||||
|
||||
template<typename _Scalar, int _BlockAtCompileTime, int _Options, typename _StorageIndex>
|
||||
class BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex>::InnerIterator
|
||||
template<typename Scalar_, int _BlockAtCompileTime, int Options_, typename StorageIndex_>
|
||||
class BlockSparseMatrix<Scalar_, _BlockAtCompileTime, Options_, StorageIndex_>::InnerIterator
|
||||
{
|
||||
public:
|
||||
InnerIterator(const BlockSparseMatrix& mat, Index outer)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Eigen {
|
||||
*
|
||||
* \brief A sparse matrix class designed for matrix assembly purpose
|
||||
*
|
||||
* \param _Scalar the scalar type, i.e. the type of the coefficients
|
||||
* \param Scalar_ the scalar type, i.e. the type of the coefficients
|
||||
*
|
||||
* Unlike SparseMatrix, this class provides a much higher degree of flexibility. In particular, it allows
|
||||
* random read/write accesses in log(rho*outer_size) where \c rho is the probability that a coefficient is
|
||||
@@ -33,11 +33,11 @@ namespace Eigen {
|
||||
*/
|
||||
|
||||
namespace internal {
|
||||
template<typename _Scalar, int _Options, typename _StorageIndex>
|
||||
struct traits<DynamicSparseMatrix<_Scalar, _Options, _StorageIndex> >
|
||||
template<typename Scalar_, int Options_, typename StorageIndex_>
|
||||
struct traits<DynamicSparseMatrix<Scalar_, Options_, StorageIndex_> >
|
||||
{
|
||||
typedef _Scalar Scalar;
|
||||
typedef _StorageIndex StorageIndex;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef StorageIndex_ StorageIndex;
|
||||
typedef Sparse StorageKind;
|
||||
typedef MatrixXpr XprKind;
|
||||
enum {
|
||||
@@ -45,16 +45,16 @@ struct traits<DynamicSparseMatrix<_Scalar, _Options, _StorageIndex> >
|
||||
ColsAtCompileTime = Dynamic,
|
||||
MaxRowsAtCompileTime = Dynamic,
|
||||
MaxColsAtCompileTime = Dynamic,
|
||||
Flags = _Options | NestByRefBit | LvalueBit,
|
||||
Flags = Options_ | NestByRefBit | LvalueBit,
|
||||
CoeffReadCost = NumTraits<Scalar>::ReadCost,
|
||||
SupportedAccessPatterns = OuterRandomAccessPattern
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
template<typename _Scalar, int _Options, typename _StorageIndex>
|
||||
template<typename Scalar_, int Options_, typename StorageIndex_>
|
||||
class DynamicSparseMatrix
|
||||
: public SparseMatrixBase<DynamicSparseMatrix<_Scalar, _Options, _StorageIndex> >
|
||||
: public SparseMatrixBase<DynamicSparseMatrix<Scalar_, Options_, StorageIndex_> >
|
||||
{
|
||||
typedef SparseMatrixBase<DynamicSparseMatrix> Base;
|
||||
using Base::convert_index;
|
||||
@@ -67,7 +67,7 @@ template<typename _Scalar, int _Options, typename _StorageIndex>
|
||||
using Base::IsRowMajor;
|
||||
using Base::operator=;
|
||||
enum {
|
||||
Options = _Options
|
||||
Options = Options_
|
||||
};
|
||||
|
||||
protected:
|
||||
@@ -334,10 +334,10 @@ template<typename _Scalar, int _Options, typename _StorageIndex>
|
||||
# endif
|
||||
};
|
||||
|
||||
template<typename Scalar, int _Options, typename _StorageIndex>
|
||||
class DynamicSparseMatrix<Scalar,_Options,_StorageIndex>::InnerIterator : public SparseVector<Scalar,_Options,_StorageIndex>::InnerIterator
|
||||
template<typename Scalar, int Options_, typename StorageIndex_>
|
||||
class DynamicSparseMatrix<Scalar,Options_,StorageIndex_>::InnerIterator : public SparseVector<Scalar,Options_,StorageIndex_>::InnerIterator
|
||||
{
|
||||
typedef typename SparseVector<Scalar,_Options,_StorageIndex>::InnerIterator Base;
|
||||
typedef typename SparseVector<Scalar,Options_,StorageIndex_>::InnerIterator Base;
|
||||
public:
|
||||
InnerIterator(const DynamicSparseMatrix& mat, Index outer)
|
||||
: Base(mat.m_data[outer]), m_outer(outer)
|
||||
@@ -351,10 +351,10 @@ class DynamicSparseMatrix<Scalar,_Options,_StorageIndex>::InnerIterator : public
|
||||
const Index m_outer;
|
||||
};
|
||||
|
||||
template<typename Scalar, int _Options, typename _StorageIndex>
|
||||
class DynamicSparseMatrix<Scalar,_Options,_StorageIndex>::ReverseInnerIterator : public SparseVector<Scalar,_Options,_StorageIndex>::ReverseInnerIterator
|
||||
template<typename Scalar, int Options_, typename StorageIndex_>
|
||||
class DynamicSparseMatrix<Scalar,Options_,StorageIndex_>::ReverseInnerIterator : public SparseVector<Scalar,Options_,StorageIndex_>::ReverseInnerIterator
|
||||
{
|
||||
typedef typename SparseVector<Scalar,_Options,_StorageIndex>::ReverseInnerIterator Base;
|
||||
typedef typename SparseVector<Scalar,Options_,StorageIndex_>::ReverseInnerIterator Base;
|
||||
public:
|
||||
ReverseInnerIterator(const DynamicSparseMatrix& mat, Index outer)
|
||||
: Base(mat.m_data[outer]), m_outer(outer)
|
||||
@@ -370,17 +370,17 @@ class DynamicSparseMatrix<Scalar,_Options,_StorageIndex>::ReverseInnerIterator :
|
||||
|
||||
namespace internal {
|
||||
|
||||
template<typename _Scalar, int _Options, typename _StorageIndex>
|
||||
struct evaluator<DynamicSparseMatrix<_Scalar,_Options,_StorageIndex> >
|
||||
: evaluator_base<DynamicSparseMatrix<_Scalar,_Options,_StorageIndex> >
|
||||
template<typename Scalar_, int Options_, typename StorageIndex_>
|
||||
struct evaluator<DynamicSparseMatrix<Scalar_,Options_,StorageIndex_> >
|
||||
: evaluator_base<DynamicSparseMatrix<Scalar_,Options_,StorageIndex_> >
|
||||
{
|
||||
typedef _Scalar Scalar;
|
||||
typedef DynamicSparseMatrix<_Scalar,_Options,_StorageIndex> SparseMatrixType;
|
||||
typedef Scalar_ Scalar;
|
||||
typedef DynamicSparseMatrix<Scalar_,Options_,StorageIndex_> SparseMatrixType;
|
||||
typedef typename SparseMatrixType::InnerIterator InnerIterator;
|
||||
typedef typename SparseMatrixType::ReverseInnerIterator ReverseInnerIterator;
|
||||
|
||||
enum {
|
||||
CoeffReadCost = NumTraits<_Scalar>::ReadCost,
|
||||
CoeffReadCost = NumTraits<Scalar_>::ReadCost,
|
||||
Flags = SparseMatrixType::Flags
|
||||
};
|
||||
|
||||
|
||||
@@ -25,18 +25,18 @@ namespace Eigen
|
||||
* C(u) & = \sum_{i=0}^{n}N_{i,p}(u)P_i
|
||||
* \f}
|
||||
*
|
||||
* \tparam _Scalar The underlying data type (typically float or double)
|
||||
* \tparam _Dim The curve dimension (e.g. 2 or 3)
|
||||
* \tparam Scalar_ The underlying data type (typically float or double)
|
||||
* \tparam Dim_ The curve dimension (e.g. 2 or 3)
|
||||
* \tparam _Degree Per default set to Dynamic; could be set to the actual desired
|
||||
* degree for optimization purposes (would result in stack allocation
|
||||
* of several temporary variables).
|
||||
**/
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
class Spline
|
||||
{
|
||||
public:
|
||||
typedef _Scalar Scalar; /*!< The spline curve's scalar type. */
|
||||
enum { Dimension = _Dim /*!< The spline curve's dimension. */ };
|
||||
typedef Scalar_ Scalar; /*!< The spline curve's scalar type. */
|
||||
enum { Dimension = Dim_ /*!< The spline curve's dimension. */ };
|
||||
enum { Degree = _Degree /*!< The spline curve's degree. */ };
|
||||
|
||||
/** \brief The point type the spline is representing. */
|
||||
@@ -223,18 +223,18 @@ namespace Eigen
|
||||
|
||||
template <typename DerivativeType>
|
||||
static void BasisFunctionDerivativesImpl(
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
|
||||
const DenseIndex order,
|
||||
const DenseIndex p,
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& U,
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& U,
|
||||
DerivativeType& N_);
|
||||
};
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
DenseIndex Spline<_Scalar, _Dim, _Degree>::Span(
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::Scalar u,
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
DenseIndex Spline<Scalar_, Dim_, _Degree>::Span(
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::Scalar u,
|
||||
DenseIndex degree,
|
||||
const typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::KnotVectorType& knots)
|
||||
const typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::KnotVectorType& knots)
|
||||
{
|
||||
// Piegl & Tiller, "The NURBS Book", A2.1 (p. 68)
|
||||
if (u <= knots(0)) return degree;
|
||||
@@ -242,12 +242,12 @@ namespace Eigen
|
||||
return static_cast<DenseIndex>( std::distance(knots.data(), pos) - 1 );
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename Spline<_Scalar, _Dim, _Degree>::BasisVectorType
|
||||
Spline<_Scalar, _Dim, _Degree>::BasisFunctions(
|
||||
typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename Spline<Scalar_, Dim_, _Degree>::BasisVectorType
|
||||
Spline<Scalar_, Dim_, _Degree>::BasisFunctions(
|
||||
typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
|
||||
DenseIndex degree,
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& knots)
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& knots)
|
||||
{
|
||||
const DenseIndex p = degree;
|
||||
const DenseIndex i = Spline::Span(u, degree, knots);
|
||||
@@ -276,8 +276,8 @@ namespace Eigen
|
||||
return N;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
DenseIndex Spline<_Scalar, _Dim, _Degree>::degree() const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
DenseIndex Spline<Scalar_, Dim_, _Degree>::degree() const
|
||||
{
|
||||
if (_Degree == Dynamic)
|
||||
return m_knots.size() - m_ctrls.cols() - 1;
|
||||
@@ -285,14 +285,14 @@ namespace Eigen
|
||||
return _Degree;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
DenseIndex Spline<_Scalar, _Dim, _Degree>::span(Scalar u) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
DenseIndex Spline<Scalar_, Dim_, _Degree>::span(Scalar u) const
|
||||
{
|
||||
return Spline::Span(u, degree(), knots());
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename Spline<_Scalar, _Dim, _Degree>::PointType Spline<_Scalar, _Dim, _Degree>::operator()(Scalar u) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename Spline<Scalar_, Dim_, _Degree>::PointType Spline<Scalar_, Dim_, _Degree>::operator()(Scalar u) const
|
||||
{
|
||||
enum { Order = SplineTraits<Spline>::OrderAtCompileTime };
|
||||
|
||||
@@ -337,28 +337,28 @@ namespace Eigen
|
||||
}
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::DerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::derivatives(Scalar u, DenseIndex order) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::DerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::derivatives(Scalar u, DenseIndex order) const
|
||||
{
|
||||
typename SplineTraits< Spline >::DerivativeType res;
|
||||
derivativesImpl(*this, u, order, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
template <int DerivativeOrder>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::DerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::derivatives(Scalar u, DenseIndex order) const
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree>, DerivativeOrder >::DerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::derivatives(Scalar u, DenseIndex order) const
|
||||
{
|
||||
typename SplineTraits< Spline, DerivativeOrder >::DerivativeType res;
|
||||
derivativesImpl(*this, u, order, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::BasisVectorType
|
||||
Spline<_Scalar, _Dim, _Degree>::basisFunctions(Scalar u) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::BasisVectorType
|
||||
Spline<Scalar_, Dim_, _Degree>::basisFunctions(Scalar u) const
|
||||
{
|
||||
return Spline::BasisFunctions(u, degree(), knots());
|
||||
}
|
||||
@@ -366,16 +366,16 @@ namespace Eigen
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
template <typename DerivativeType>
|
||||
void Spline<_Scalar, _Dim, _Degree>::BasisFunctionDerivativesImpl(
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
|
||||
void Spline<Scalar_, Dim_, _Degree>::BasisFunctionDerivativesImpl(
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
|
||||
const DenseIndex order,
|
||||
const DenseIndex p,
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& U,
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& U,
|
||||
DerivativeType& N_)
|
||||
{
|
||||
typedef Spline<_Scalar, _Dim, _Degree> SplineType;
|
||||
typedef Spline<Scalar_, Dim_, _Degree> SplineType;
|
||||
enum { Order = SplineTraits<SplineType>::OrderAtCompileTime };
|
||||
|
||||
const DenseIndex span = SplineType::Span(u, p, U);
|
||||
@@ -471,32 +471,32 @@ namespace Eigen
|
||||
}
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree> >::BasisDerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
|
||||
{
|
||||
typename SplineTraits<Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType der;
|
||||
typename SplineTraits<Spline<Scalar_, Dim_, _Degree> >::BasisDerivativeType der;
|
||||
BasisFunctionDerivativesImpl(u, order, degree(), knots(), der);
|
||||
return der;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
template <int DerivativeOrder>
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::BasisDerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree>, DerivativeOrder >::BasisDerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
|
||||
{
|
||||
typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::BasisDerivativeType der;
|
||||
typename SplineTraits< Spline<Scalar_, Dim_, _Degree>, DerivativeOrder >::BasisDerivativeType der;
|
||||
BasisFunctionDerivativesImpl(u, order, degree(), knots(), der);
|
||||
return der;
|
||||
}
|
||||
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
typename SplineTraits<Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType
|
||||
Spline<_Scalar, _Dim, _Degree>::BasisFunctionDerivatives(
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
typename SplineTraits<Spline<Scalar_, Dim_, _Degree> >::BasisDerivativeType
|
||||
Spline<Scalar_, Dim_, _Degree>::BasisFunctionDerivatives(
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::Scalar u,
|
||||
const DenseIndex order,
|
||||
const DenseIndex degree,
|
||||
const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& knots)
|
||||
const typename Spline<Scalar_, Dim_, _Degree>::KnotVectorType& knots)
|
||||
{
|
||||
typename SplineTraits<Spline>::BasisDerivativeType der;
|
||||
BasisFunctionDerivativesImpl(u, order, degree, knots, der);
|
||||
|
||||
@@ -22,11 +22,11 @@ namespace Eigen
|
||||
* \ingroup Splines_Module
|
||||
* \brief Compile-time attributes of the Spline class for Dynamic degree.
|
||||
**/
|
||||
template <typename _Scalar, int _Dim, int _Degree>
|
||||
struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, Dynamic >
|
||||
template <typename Scalar_, int Dim_, int _Degree>
|
||||
struct SplineTraits< Spline<Scalar_, Dim_, _Degree>, Dynamic >
|
||||
{
|
||||
typedef _Scalar Scalar; /*!< The spline curve's scalar type. */
|
||||
enum { Dimension = _Dim /*!< The spline curve's dimension. */ };
|
||||
typedef Scalar_ Scalar; /*!< The spline curve's scalar type. */
|
||||
enum { Dimension = Dim_ /*!< The spline curve's dimension. */ };
|
||||
enum { Degree = _Degree /*!< The spline curve's degree. */ };
|
||||
|
||||
enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 /*!< The spline curve's order at compile-time. */ };
|
||||
@@ -62,19 +62,19 @@ namespace Eigen
|
||||
*
|
||||
* The traits class inherits all attributes from the SplineTraits of Dynamic degree.
|
||||
**/
|
||||
template < typename _Scalar, int _Dim, int _Degree, int _DerivativeOrder >
|
||||
struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, _DerivativeOrder > : public SplineTraits< Spline<_Scalar, _Dim, _Degree> >
|
||||
template < typename Scalar_, int Dim_, int _Degree, int _DerivativeOrder >
|
||||
struct SplineTraits< Spline<Scalar_, Dim_, _Degree>, _DerivativeOrder > : public SplineTraits< Spline<Scalar_, Dim_, _Degree> >
|
||||
{
|
||||
enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 /*!< The spline curve's order at compile-time. */ };
|
||||
enum { NumOfDerivativesAtCompileTime = _DerivativeOrder==Dynamic ? Dynamic : _DerivativeOrder+1 /*!< The number of derivatives defined for the current spline. */ };
|
||||
|
||||
enum { DerivativeMemoryLayout = _Dim==1 ? RowMajor : ColMajor /*!< The derivative type's memory layout. */ };
|
||||
enum { DerivativeMemoryLayout = Dim_==1 ? RowMajor : ColMajor /*!< The derivative type's memory layout. */ };
|
||||
|
||||
/** \brief The data type used to store the values of the basis function derivatives. */
|
||||
typedef Array<_Scalar,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
|
||||
typedef Array<Scalar_,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
|
||||
|
||||
/** \brief The data type used to store the spline's derivative values. */
|
||||
typedef Array<_Scalar,_Dim,Dynamic,DerivativeMemoryLayout,_Dim,NumOfDerivativesAtCompileTime> DerivativeType;
|
||||
typedef Array<Scalar_,Dim_,Dynamic,DerivativeMemoryLayout,Dim_,NumOfDerivativesAtCompileTime> DerivativeType;
|
||||
};
|
||||
|
||||
/** \brief 2D float B-spline with dynamic degree. */
|
||||
|
||||
Reference in New Issue
Block a user