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:
@@ -41,7 +41,7 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
|
||||
SparseMatrixType m(rows, cols);
|
||||
DenseMatrix refMat = DenseMatrix::Zero(rows, cols);
|
||||
DenseVector vec1 = DenseVector::Random(rows);
|
||||
Scalar s1 = ei_random<Scalar>();
|
||||
Scalar s1 = internal::random<Scalar>();
|
||||
|
||||
std::vector<Vector2i> zeroCoords;
|
||||
std::vector<Vector2i> nonzeroCoords;
|
||||
@@ -54,7 +54,7 @@ template<typename SparseMatrixType> void sparse_basic(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);
|
||||
@@ -67,10 +67,10 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
|
||||
// test InnerIterators and Block expressions
|
||||
for (int t=0; t<10; ++t)
|
||||
{
|
||||
int j = ei_random<int>(0,cols-1);
|
||||
int i = ei_random<int>(0,rows-1);
|
||||
int w = ei_random<int>(1,cols-j-1);
|
||||
int h = ei_random<int>(1,rows-i-1);
|
||||
int j = internal::random<int>(0,cols-1);
|
||||
int i = internal::random<int>(0,rows-1);
|
||||
int w = internal::random<int>(1,cols-j-1);
|
||||
int h = internal::random<int>(1,rows-i-1);
|
||||
|
||||
// VERIFY_IS_APPROX(m.block(i,j,h,w), refMat.block(i,j,h,w));
|
||||
for(int c=0; c<w; c++)
|
||||
@@ -114,9 +114,9 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
|
||||
{
|
||||
for (int k=0; k<rows/2; ++k)
|
||||
{
|
||||
int i = ei_random<int>(0,rows-1);
|
||||
int i = internal::random<int>(0,rows-1);
|
||||
if (m1.coeff(i,j)==Scalar(0))
|
||||
m2.insert(i,j) = m1(i,j) = ei_random<Scalar>();
|
||||
m2.insert(i,j) = m1(i,j) = internal::random<Scalar>();
|
||||
}
|
||||
}
|
||||
m2.finalize();
|
||||
@@ -131,10 +131,10 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
|
||||
m2.reserve(10);
|
||||
for (int k=0; k<rows*cols; ++k)
|
||||
{
|
||||
int i = ei_random<int>(0,rows-1);
|
||||
int j = ei_random<int>(0,cols-1);
|
||||
int i = internal::random<int>(0,rows-1);
|
||||
int j = internal::random<int>(0,cols-1);
|
||||
if (m1.coeff(i,j)==Scalar(0))
|
||||
m2.insert(i,j) = m1(i,j) = ei_random<Scalar>();
|
||||
m2.insert(i,j) = m1(i,j) = internal::random<Scalar>();
|
||||
}
|
||||
m2.finalize();
|
||||
VERIFY_IS_APPROX(m2,m1);
|
||||
@@ -190,8 +190,8 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
|
||||
DenseMatrix refMat2 = DenseMatrix::Zero(rows, rows);
|
||||
SparseMatrixType m2(rows, rows);
|
||||
initSparse<Scalar>(density, refMat2, m2);
|
||||
int j0 = ei_random(0,rows-1);
|
||||
int j1 = ei_random(0,rows-1);
|
||||
int j0 = internal::random(0,rows-1);
|
||||
int j1 = internal::random(0,rows-1);
|
||||
VERIFY_IS_APPROX(m2.innerVector(j0), refMat2.col(j0));
|
||||
VERIFY_IS_APPROX(m2.innerVector(j0)+m2.innerVector(j1), refMat2.col(j0)+refMat2.col(j1));
|
||||
//m2.innerVector(j0) = 2*m2.innerVector(j1);
|
||||
@@ -204,9 +204,9 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
|
||||
DenseMatrix refMat2 = DenseMatrix::Zero(rows, rows);
|
||||
SparseMatrixType m2(rows, rows);
|
||||
initSparse<Scalar>(density, refMat2, m2);
|
||||
int j0 = ei_random(0,rows-2);
|
||||
int j1 = ei_random(0,rows-2);
|
||||
int n0 = ei_random<int>(1,rows-std::max(j0,j1));
|
||||
int j0 = internal::random(0,rows-2);
|
||||
int j1 = internal::random(0,rows-2);
|
||||
int n0 = internal::random<int>(1,rows-std::max(j0,j1));
|
||||
VERIFY_IS_APPROX(m2.innerVectors(j0,n0), refMat2.block(0,j0,rows,n0));
|
||||
VERIFY_IS_APPROX(m2.innerVectors(j0,n0)+m2.innerVectors(j1,n0),
|
||||
refMat2.block(0,j0,rows,n0)+refMat2.block(0,j1,rows,n0));
|
||||
@@ -226,7 +226,7 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
|
||||
m2.startVec(j);
|
||||
for (int i=0; i<m2.innerSize(); ++i)
|
||||
{
|
||||
float x = ei_random<float>(0,1);
|
||||
float x = internal::random<float>(0,1);
|
||||
if (x<0.1)
|
||||
{
|
||||
// do nothing
|
||||
|
||||
Reference in New Issue
Block a user