mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #86 : use internal:: namespace instead of ei_ prefix
This commit is contained in:
@@ -42,11 +42,15 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(double, Dim)
|
||||
double radius;
|
||||
};
|
||||
|
||||
namespace Eigen {
|
||||
namespace internal {
|
||||
|
||||
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> ei_bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
|
||||
template<int Dim> AlignedBox<double, Dim> ei_bounding_box(const Ball<Dim> &b)
|
||||
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
|
||||
template<int Dim> AlignedBox<double, Dim> bounding_box(const Ball<Dim> &b)
|
||||
{ return AlignedBox<double, Dim>(b.center.array() - b.radius, b.center.array() + b.radius); }
|
||||
|
||||
} // end namespace internal
|
||||
}
|
||||
|
||||
template<int Dim>
|
||||
struct BallPointStuff //this class provides functions to be both an intersector and a minimizer, both for a ball and a point and for two trees
|
||||
@@ -113,7 +117,7 @@ struct TreeTest
|
||||
{
|
||||
BallTypeList b;
|
||||
for(int i = 0; i < 500; ++i) {
|
||||
b.push_back(BallType(VectorType::Random(), 0.5 * ei_random(0., 1.)));
|
||||
b.push_back(BallType(VectorType::Random(), 0.5 * internal::random(0., 1.)));
|
||||
}
|
||||
KdBVH<double, Dim, BallType> tree(b.begin(), b.end());
|
||||
|
||||
@@ -132,7 +136,7 @@ struct TreeTest
|
||||
{
|
||||
BallTypeList b;
|
||||
for(int i = 0; i < 500; ++i) {
|
||||
b.push_back(BallType(VectorType::Random(), 0.01 * ei_random(0., 1.)));
|
||||
b.push_back(BallType(VectorType::Random(), 0.01 * internal::random(0., 1.)));
|
||||
}
|
||||
KdBVH<double, Dim, BallType> tree(b.begin(), b.end());
|
||||
|
||||
@@ -155,7 +159,7 @@ struct TreeTest
|
||||
VectorTypeList v;
|
||||
|
||||
for(int i = 0; i < 50; ++i) {
|
||||
b.push_back(BallType(VectorType::Random(), 0.5 * ei_random(0., 1.)));
|
||||
b.push_back(BallType(VectorType::Random(), 0.5 * internal::random(0., 1.)));
|
||||
for(int j = 0; j < 3; ++j)
|
||||
v.push_back(VectorType::Random());
|
||||
}
|
||||
@@ -180,7 +184,7 @@ struct TreeTest
|
||||
VectorTypeList v;
|
||||
|
||||
for(int i = 0; i < 50; ++i) {
|
||||
b.push_back(BallType(VectorType::Random(), 1e-7 + 1e-6 * ei_random(0., 1.)));
|
||||
b.push_back(BallType(VectorType::Random(), 1e-7 + 1e-6 * internal::random(0., 1.)));
|
||||
for(int j = 0; j < 3; ++j)
|
||||
v.push_back(VectorType::Random());
|
||||
}
|
||||
|
||||
@@ -66,11 +66,11 @@ void testChkder()
|
||||
/* checking the jacobian matrix. */
|
||||
x << 9.2e-1, 1.3e-1, 5.4e-1;
|
||||
|
||||
ei_chkder(x, fvec, fjac, xp, fvecp, 1, err);
|
||||
internal::chkder(x, fvec, fjac, xp, fvecp, 1, err);
|
||||
fcn_chkder(x, fvec, fjac, 1);
|
||||
fcn_chkder(x, fvec, fjac, 2);
|
||||
fcn_chkder(xp, fvecp, fjac, 1);
|
||||
ei_chkder(x, fvec, fjac, xp, fvecp, 2, err);
|
||||
internal::chkder(x, fvec, fjac, xp, fvecp, 2, err);
|
||||
|
||||
fvecp -= fvec;
|
||||
|
||||
@@ -220,7 +220,7 @@ void testLmder()
|
||||
|
||||
// check covariance
|
||||
covfac = fnorm*fnorm/(m-n);
|
||||
ei_covar(lm.fjac, lm.permutation.indices()); // TODO : move this as a function of lm
|
||||
internal::covar(lm.fjac, lm.permutation.indices()); // TODO : move this as a function of lm
|
||||
|
||||
MatrixXd cov_ref(n,n);
|
||||
cov_ref <<
|
||||
@@ -611,7 +611,7 @@ void testLmdif()
|
||||
|
||||
// check covariance
|
||||
covfac = fnorm*fnorm/(m-n);
|
||||
ei_covar(lm.fjac, lm.permutation.indices()); // TODO : move this as a function of lm
|
||||
internal::covar(lm.fjac, lm.permutation.indices()); // TODO : move this as a function of lm
|
||||
|
||||
MatrixXd cov_ref(n,n);
|
||||
cov_ref <<
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
template<typename Scalar>
|
||||
void alignedvector3()
|
||||
{
|
||||
Scalar s1 = ei_random<Scalar>();
|
||||
Scalar s2 = ei_random<Scalar>();
|
||||
Scalar s1 = internal::random<Scalar>();
|
||||
Scalar s2 = internal::random<Scalar>();
|
||||
typedef Matrix<Scalar,3,1> RefType;
|
||||
typedef Matrix<Scalar,3,3> Mat33;
|
||||
typedef AlignedVector3<Scalar> FastType;
|
||||
|
||||
@@ -127,7 +127,7 @@ void randomTest(const MatrixType& m, double tol)
|
||||
MatrixType m1(rows, cols), m2(rows, cols), m3(rows, cols),
|
||||
identity = MatrixType::Identity(rows, rows);
|
||||
|
||||
typedef typename NumTraits<typename ei_traits<MatrixType>::Scalar>::Real RealScalar;
|
||||
typedef typename NumTraits<typename internal::traits<MatrixType>::Scalar>::Real RealScalar;
|
||||
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
m1 = MatrixType::Random(rows, cols);
|
||||
|
||||
@@ -45,15 +45,15 @@ MatrixType randomMatrixWithRealEivals(const typename MatrixType::Index size)
|
||||
typedef typename MatrixType::RealScalar RealScalar;
|
||||
MatrixType diag = MatrixType::Zero(size, size);
|
||||
for (Index i = 0; i < size; ++i) {
|
||||
diag(i, i) = Scalar(RealScalar(ei_random<int>(0,2)))
|
||||
+ ei_random<Scalar>() * Scalar(RealScalar(0.01));
|
||||
diag(i, i) = Scalar(RealScalar(internal::random<int>(0,2)))
|
||||
+ internal::random<Scalar>() * Scalar(RealScalar(0.01));
|
||||
}
|
||||
MatrixType A = MatrixType::Random(size, size);
|
||||
HouseholderQR<MatrixType> QRofA(A);
|
||||
return QRofA.householderQ().inverse() * diag * QRofA.householderQ();
|
||||
}
|
||||
|
||||
template <typename MatrixType, int IsComplex = NumTraits<typename ei_traits<MatrixType>::Scalar>::IsComplex>
|
||||
template <typename MatrixType, int IsComplex = NumTraits<typename internal::traits<MatrixType>::Scalar>::IsComplex>
|
||||
struct randomMatrixWithImagEivals
|
||||
{
|
||||
// Returns a matrix with eigenvalues clustered around 0 and +/- i.
|
||||
@@ -71,12 +71,12 @@ struct randomMatrixWithImagEivals<MatrixType, 0>
|
||||
MatrixType diag = MatrixType::Zero(size, size);
|
||||
Index i = 0;
|
||||
while (i < size) {
|
||||
Index randomInt = ei_random<Index>(-1, 1);
|
||||
Index randomInt = internal::random<Index>(-1, 1);
|
||||
if (randomInt == 0 || i == size-1) {
|
||||
diag(i, i) = ei_random<Scalar>() * Scalar(0.01);
|
||||
diag(i, i) = internal::random<Scalar>() * Scalar(0.01);
|
||||
++i;
|
||||
} else {
|
||||
Scalar alpha = Scalar(randomInt) + ei_random<Scalar>() * Scalar(0.01);
|
||||
Scalar alpha = Scalar(randomInt) + internal::random<Scalar>() * Scalar(0.01);
|
||||
diag(i, i+1) = alpha;
|
||||
diag(i+1, i) = -alpha;
|
||||
i += 2;
|
||||
@@ -100,8 +100,8 @@ struct randomMatrixWithImagEivals<MatrixType, 1>
|
||||
const Scalar imagUnit(0, 1);
|
||||
MatrixType diag = MatrixType::Zero(size, size);
|
||||
for (Index i = 0; i < size; ++i) {
|
||||
diag(i, i) = Scalar(RealScalar(ei_random<Index>(-1, 1))) * imagUnit
|
||||
+ ei_random<Scalar>() * Scalar(RealScalar(0.01));
|
||||
diag(i, i) = Scalar(RealScalar(internal::random<Index>(-1, 1))) * imagUnit
|
||||
+ internal::random<Scalar>() * Scalar(RealScalar(0.01));
|
||||
}
|
||||
MatrixType A = MatrixType::Random(size, size);
|
||||
HouseholderQR<MatrixType> QRofA(A);
|
||||
@@ -113,7 +113,7 @@ struct randomMatrixWithImagEivals<MatrixType, 1>
|
||||
template<typename MatrixType>
|
||||
void testMatrixExponential(const MatrixType& A)
|
||||
{
|
||||
typedef typename ei_traits<MatrixType>::Scalar Scalar;
|
||||
typedef typename internal::traits<MatrixType>::Scalar Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
typedef std::complex<RealScalar> ComplexScalar;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ void test_mpreal_support()
|
||||
std::cerr << "lowest = " << NumTraits<mpreal>::lowest() << "\n";
|
||||
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
int s = ei_random<int>(1,100);
|
||||
int s = Eigen::internal::random<int>(1,100);
|
||||
MatrixXmp A = MatrixXmp::Random(s,s);
|
||||
MatrixXmp B = MatrixXmp::Random(s,s);
|
||||
MatrixXmp S = A.adjoint() * A;
|
||||
|
||||
@@ -160,10 +160,10 @@ void test_openglsupport()
|
||||
VERIFY_MATRIX(glMultMatrix(md44), md44);
|
||||
|
||||
// Quaternion
|
||||
Quaterniond qd(AngleAxisd(ei_random<double>(), Vector3d::Random()));
|
||||
Quaterniond qd(AngleAxisd(internal::random<double>(), Vector3d::Random()));
|
||||
VERIFY_MATRIX(glRotate(qd), Projective3d(qd).matrix());
|
||||
|
||||
Quaternionf qf(AngleAxisf(ei_random<double>(), Vector3f::Random()));
|
||||
Quaternionf qf(AngleAxisf(internal::random<double>(), Vector3f::Random()));
|
||||
VERIFY_MATRIX(glRotate(qf), Projective3f(qf).matrix());
|
||||
|
||||
// 3D Transform
|
||||
@@ -222,10 +222,10 @@ void test_openglsupport()
|
||||
Vector3d vd3; vd3.setRandom();
|
||||
VERIFY_MATRIX(glScale(vd3), Projective3d(Scaling(vd3)).matrix());
|
||||
|
||||
UniformScaling<float> usf(ei_random<float>());
|
||||
UniformScaling<float> usf(internal::random<float>());
|
||||
VERIFY_MATRIX(glScale(usf), Projective3f(usf).matrix());
|
||||
|
||||
UniformScaling<double> usd(ei_random<double>());
|
||||
UniformScaling<double> usd(internal::random<double>());
|
||||
VERIFY_MATRIX(glScale(usd), Projective3d(usd).matrix());
|
||||
}
|
||||
|
||||
|
||||
@@ -33,15 +33,17 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Eigen {
|
||||
namespace internal {
|
||||
template<int Size>
|
||||
struct ei_increment_if_fixed_size
|
||||
struct increment_if_fixed_size
|
||||
{
|
||||
enum {
|
||||
ret = (Size == Dynamic) ? Dynamic : Size+1
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<int Deg, typename POLYNOMIAL, typename SOLVER>
|
||||
@@ -72,7 +74,7 @@ bool aux_evalSolver( const POLYNOMIAL& pols, SOLVER& psolve )
|
||||
}
|
||||
|
||||
#ifdef HAS_GSL
|
||||
if (ei_is_same_type< Scalar, double>::ret)
|
||||
if (internal::is_same_type< Scalar, double>::ret)
|
||||
{
|
||||
typedef GslTraits<Scalar> Gsl;
|
||||
RootsType gslRoots(deg);
|
||||
@@ -104,7 +106,7 @@ bool aux_evalSolver( const POLYNOMIAL& pols, SOLVER& psolve )
|
||||
bool distinctModuli=true;
|
||||
for( size_t i=1; i<rootModuli.size() && distinctModuli; ++i )
|
||||
{
|
||||
if( ei_isApprox( rootModuli[i], rootModuli[i-1] ) ){
|
||||
if( internal::isApprox( rootModuli[i], rootModuli[i-1] ) ){
|
||||
distinctModuli = false; }
|
||||
}
|
||||
VERIFY( evalToZero || !distinctModuli );
|
||||
@@ -158,51 +160,51 @@ void evalSolverSugarFunction( const POLYNOMIAL& pols, const ROOTS& roots, const
|
||||
psolve.realRoots( calc_realRoots );
|
||||
VERIFY( calc_realRoots.size() == (size_t)real_roots.size() );
|
||||
|
||||
const Scalar psPrec = ei_sqrt( test_precision<Scalar>() );
|
||||
const Scalar psPrec = internal::sqrt( test_precision<Scalar>() );
|
||||
|
||||
for( size_t i=0; i<calc_realRoots.size(); ++i )
|
||||
{
|
||||
bool found = false;
|
||||
for( size_t j=0; j<calc_realRoots.size()&& !found; ++j )
|
||||
{
|
||||
if( ei_isApprox( calc_realRoots[i], real_roots[j] ), psPrec ){
|
||||
if( internal::isApprox( calc_realRoots[i], real_roots[j] ), psPrec ){
|
||||
found = true; }
|
||||
}
|
||||
VERIFY( found );
|
||||
}
|
||||
|
||||
//Test greatestRoot
|
||||
VERIFY( ei_isApprox( roots.array().abs().maxCoeff(),
|
||||
ei_abs( psolve.greatestRoot() ), psPrec ) );
|
||||
VERIFY( internal::isApprox( roots.array().abs().maxCoeff(),
|
||||
internal::abs( psolve.greatestRoot() ), psPrec ) );
|
||||
|
||||
//Test smallestRoot
|
||||
VERIFY( ei_isApprox( roots.array().abs().minCoeff(),
|
||||
ei_abs( psolve.smallestRoot() ), psPrec ) );
|
||||
VERIFY( internal::isApprox( roots.array().abs().minCoeff(),
|
||||
internal::abs( psolve.smallestRoot() ), psPrec ) );
|
||||
|
||||
bool hasRealRoot;
|
||||
//Test absGreatestRealRoot
|
||||
Real r = psolve.absGreatestRealRoot( hasRealRoot );
|
||||
VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
|
||||
if( hasRealRoot ){
|
||||
VERIFY( ei_isApprox( real_roots.array().abs().maxCoeff(), ei_abs(r), psPrec ) ); }
|
||||
VERIFY( internal::isApprox( real_roots.array().abs().maxCoeff(), internal::abs(r), psPrec ) ); }
|
||||
|
||||
//Test absSmallestRealRoot
|
||||
r = psolve.absSmallestRealRoot( hasRealRoot );
|
||||
VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
|
||||
if( hasRealRoot ){
|
||||
VERIFY( ei_isApprox( real_roots.array().abs().minCoeff(), ei_abs( r ), psPrec ) ); }
|
||||
VERIFY( internal::isApprox( real_roots.array().abs().minCoeff(), internal::abs( r ), psPrec ) ); }
|
||||
|
||||
//Test greatestRealRoot
|
||||
r = psolve.greatestRealRoot( hasRealRoot );
|
||||
VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
|
||||
if( hasRealRoot ){
|
||||
VERIFY( ei_isApprox( real_roots.array().maxCoeff(), r, psPrec ) ); }
|
||||
VERIFY( internal::isApprox( real_roots.array().maxCoeff(), r, psPrec ) ); }
|
||||
|
||||
//Test smallestRealRoot
|
||||
r = psolve.smallestRealRoot( hasRealRoot );
|
||||
VERIFY( hasRealRoot == (real_roots.size() > 0 ) );
|
||||
if( hasRealRoot ){
|
||||
VERIFY( ei_isApprox( real_roots.array().minCoeff(), r, psPrec ) ); }
|
||||
VERIFY( internal::isApprox( real_roots.array().minCoeff(), r, psPrec ) ); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +212,7 @@ void evalSolverSugarFunction( const POLYNOMIAL& pols, const ROOTS& roots, const
|
||||
template<typename _Scalar, int _Deg>
|
||||
void polynomialsolver(int deg)
|
||||
{
|
||||
typedef ei_increment_if_fixed_size<_Deg> Dim;
|
||||
typedef internal::increment_if_fixed_size<_Deg> Dim;
|
||||
typedef Matrix<_Scalar,Dim::ret,1> PolynomialType;
|
||||
typedef Matrix<_Scalar,_Deg,1> EvalRootsType;
|
||||
|
||||
@@ -219,7 +221,7 @@ void polynomialsolver(int deg)
|
||||
evalSolver<_Deg,PolynomialType>( pols );
|
||||
|
||||
cout << "Hard cases" << endl;
|
||||
_Scalar multipleRoot = ei_random<_Scalar>();
|
||||
_Scalar multipleRoot = internal::random<_Scalar>();
|
||||
EvalRootsType allRoots = EvalRootsType::Constant(deg,multipleRoot);
|
||||
roots_to_monicPolynomial( allRoots, pols );
|
||||
evalSolver<_Deg,PolynomialType>( pols );
|
||||
@@ -250,7 +252,7 @@ template<typename _Scalar> void polynomialsolver_scalar()
|
||||
CALL_SUBTEST_8( (polynomialsolver<_Scalar,8>(8)) );
|
||||
|
||||
CALL_SUBTEST_9( (polynomialsolver<_Scalar,Dynamic>(
|
||||
ei_random<int>(9,45)
|
||||
internal::random<int>(9,45)
|
||||
)) );
|
||||
}
|
||||
|
||||
|
||||
@@ -28,18 +28,22 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Eigen {
|
||||
namespace internal {
|
||||
template<int Size>
|
||||
struct ei_increment_if_fixed_size
|
||||
struct increment_if_fixed_size
|
||||
{
|
||||
enum {
|
||||
ret = (Size == Dynamic) ? Dynamic : Size+1
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
template<typename _Scalar, int _Deg>
|
||||
void realRoots_to_monicPolynomial_test(int deg)
|
||||
{
|
||||
typedef ei_increment_if_fixed_size<_Deg> Dim;
|
||||
typedef internal::increment_if_fixed_size<_Deg> Dim;
|
||||
typedef Matrix<_Scalar,Dim::ret,1> PolynomialType;
|
||||
typedef Matrix<_Scalar,_Deg,1> EvalRootsType;
|
||||
|
||||
@@ -68,7 +72,7 @@ template<typename _Scalar> void realRoots_to_monicPolynomial_scalar()
|
||||
CALL_SUBTEST_8( (realRoots_to_monicPolynomial_test<_Scalar,17>(17)) );
|
||||
|
||||
CALL_SUBTEST_9( (realRoots_to_monicPolynomial_test<_Scalar,Dynamic>(
|
||||
ei_random<int>(18,26) )) );
|
||||
internal::random<int>(18,26) )) );
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +81,7 @@ template<typename _Scalar> void realRoots_to_monicPolynomial_scalar()
|
||||
template<typename _Scalar, int _Deg>
|
||||
void CauchyBounds(int deg)
|
||||
{
|
||||
typedef ei_increment_if_fixed_size<_Deg> Dim;
|
||||
typedef internal::increment_if_fixed_size<_Deg> Dim;
|
||||
typedef Matrix<_Scalar,Dim::ret,1> PolynomialType;
|
||||
typedef Matrix<_Scalar,_Deg,1> EvalRootsType;
|
||||
|
||||
@@ -109,7 +113,7 @@ template<typename _Scalar> void CauchyBounds_scalar()
|
||||
CALL_SUBTEST_8( (CauchyBounds<_Scalar,17>(17)) );
|
||||
|
||||
CALL_SUBTEST_9( (CauchyBounds<_Scalar,Dynamic>(
|
||||
ei_random<int>(18,26) )) );
|
||||
internal::random<int>(18,26) )) );
|
||||
}
|
||||
|
||||
void test_polynomialutils()
|
||||
|
||||
@@ -35,7 +35,7 @@ bool test_random_setter(SparseMatrix<Scalar,Options>& sm, const DenseType& ref,
|
||||
std::vector<Vector2i> remaining = nonzeroCoords;
|
||||
while(!remaining.empty())
|
||||
{
|
||||
int i = ei_random<int>(0,static_cast<int>(remaining.size())-1);
|
||||
int i = internal::random<int>(0,static_cast<int>(remaining.size())-1);
|
||||
w(remaining[i].x(),remaining[i].y()) = ref.coeff(remaining[i].x(),remaining[i].y());
|
||||
remaining[i] = remaining.back();
|
||||
remaining.pop_back();
|
||||
@@ -51,7 +51,7 @@ bool test_random_setter(DynamicSparseMatrix<T>& sm, const DenseType& ref, const
|
||||
std::vector<Vector2i> remaining = nonzeroCoords;
|
||||
while(!remaining.empty())
|
||||
{
|
||||
int i = ei_random<int>(0,static_cast<int>(remaining.size())-1);
|
||||
int i = internal::random<int>(0,static_cast<int>(remaining.size())-1);
|
||||
sm.coeffRef(remaining[i].x(),remaining[i].y()) = ref.coeff(remaining[i].x(),remaining[i].y());
|
||||
remaining[i] = remaining.back();
|
||||
remaining.pop_back();
|
||||
@@ -87,7 +87,7 @@ template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& re
|
||||
for (int i=0; i<(int)zeroCoords.size(); ++i)
|
||||
{
|
||||
VERIFY_IS_MUCH_SMALLER_THAN( m.coeff(zeroCoords[i].x(),zeroCoords[i].y()), eps );
|
||||
if(ei_is_same_type<SparseMatrixType,SparseMatrix<Scalar,Flags> >::ret)
|
||||
if(internal::is_same_type<SparseMatrixType,SparseMatrix<Scalar,Flags> >::ret)
|
||||
VERIFY_RAISES_ASSERT( m.coeffRef(zeroCoords[0].x(),zeroCoords[0].y()) = 5 );
|
||||
}
|
||||
VERIFY_IS_APPROX(m, refMat);
|
||||
@@ -105,7 +105,7 @@ template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& re
|
||||
// std::vector<Vector2i> remaining = nonzeroCoords;
|
||||
// while(!remaining.empty())
|
||||
// {
|
||||
// int i = ei_random<int>(0,remaining.size()-1);
|
||||
// int i = internal::random<int>(0,remaining.size()-1);
|
||||
// w->coeffRef(remaining[i].x(),remaining[i].y()) = refMat.coeff(remaining[i].x(),remaining[i].y());
|
||||
// remaining[i] = remaining.back();
|
||||
// remaining.pop_back();
|
||||
|
||||
@@ -43,7 +43,7 @@ template<typename Scalar> void sparse_ldlt(int rows, int cols)
|
||||
|
||||
initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeUpperTriangular, 0, 0);
|
||||
for(int i=0; i<rows; ++i)
|
||||
m2.coeffRef(i,i) = refMat2(i,i) = ei_abs(ei_real(refMat2(i,i)));
|
||||
m2.coeffRef(i,i) = refMat2(i,i) = internal::abs(internal::real(refMat2(i,i)));
|
||||
|
||||
refX = refMat2.template selfadjointView<Upper>().ldlt().solve(b);
|
||||
typedef SparseMatrix<Scalar,Upper|SelfAdjoint> SparseSelfAdjointMatrix;
|
||||
@@ -85,7 +85,7 @@ void test_sparse_ldlt()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
CALL_SUBTEST_1(sparse_ldlt<double>(8, 8) );
|
||||
int s = ei_random<int>(1,300);
|
||||
int s = internal::random<int>(1,300);
|
||||
CALL_SUBTEST_2(sparse_ldlt<std::complex<double> >(s,s) );
|
||||
CALL_SUBTEST_1(sparse_ldlt<double>(s,s) );
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ template<typename Scalar> void sparse_llt(int rows, int cols)
|
||||
initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeLowerTriangular, 0, 0);
|
||||
|
||||
for(int i=0; i<rows; ++i)
|
||||
m2.coeffRef(i,i) = refMat2(i,i) = ei_abs(ei_real(refMat2(i,i)));
|
||||
m2.coeffRef(i,i) = refMat2(i,i) = internal::abs(internal::real(refMat2(i,i)));
|
||||
|
||||
refX = refMat2.template selfadjointView<Lower>().llt().solve(b);
|
||||
if (!NumTraits<Scalar>::IsComplex)
|
||||
@@ -78,7 +78,7 @@ void test_sparse_llt()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
CALL_SUBTEST_1(sparse_llt<double>(8, 8) );
|
||||
int s = ei_random<int>(1,300);
|
||||
int s = internal::random<int>(1,300);
|
||||
CALL_SUBTEST_2(sparse_llt<std::complex<double> >(s,s) );
|
||||
CALL_SUBTEST_1(sparse_llt<double>(s,s) );
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void test_sparse_lu()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
CALL_SUBTEST_1(sparse_lu<double>(8, 8) );
|
||||
int s = ei_random<int>(1,300);
|
||||
int s = internal::random<int>(1,300);
|
||||
CALL_SUBTEST_2(sparse_lu<std::complex<double> >(s,s) );
|
||||
CALL_SUBTEST_1(sparse_lu<double>(s,s) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user