Remove unused variables in eigen2support.

This commit is contained in:
Gael Guennebaud 2014-12-11 14:26:19 +01:00
parent 15bff016d1
commit 58725ff08c
12 changed files with 10 additions and 48 deletions

View File

@ -147,7 +147,6 @@ void fitHyperplane(int numPoints,
// compute the covariance matrix
CovMatrixType covMat = CovMatrixType::Zero(size, size);
VectorType remean = VectorType::Zero(size);
for(int i = 0; i < numPoints; ++i)
{
VectorType diff = (*(points[i]) - mean).conjugate();

View File

@ -29,8 +29,6 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols),
identity = SquareMatrixType::Identity(rows, rows),
square = SquareMatrixType::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),

View File

@ -23,11 +23,8 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Identity(rows, rows),
square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
vzero = VectorType::Zero(rows);
Scalar x = ei_random<Scalar>();

View File

@ -35,11 +35,8 @@ template<typename MatrixType> void cwiseops(const MatrixType& m)
mzero = MatrixType::Zero(rows, cols),
mones = MatrixType::Ones(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Identity(rows, rows),
square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
vzero = VectorType::Zero(rows),
::Identity(rows, rows);
VectorType vzero = VectorType::Zero(rows),
vones = VectorType::Ones(rows),
v3(rows);

View File

@ -392,6 +392,7 @@ template<typename Scalar> void geometry(void)
#define VERIFY_EULER(I,J,K, X,Y,Z) { \
Vector3 ea = m.eulerAngles(I,J,K); \
Matrix3 m1 = Matrix3(AngleAxisx(ea[0], Vector3::Unit##X()) * AngleAxisx(ea[1], Vector3::Unit##Y()) * AngleAxisx(ea[2], Vector3::Unit##Z())); \
VERIFY_IS_APPROX(m, m1); \
VERIFY_IS_APPROX(m, Matrix3(AngleAxisx(ea[0], Vector3::Unit##X()) * AngleAxisx(ea[1], Vector3::Unit##Y()) * AngleAxisx(ea[2], Vector3::Unit##Z()))); \
}
VERIFY_EULER(0,1,2, X,Y,Z);

View File

@ -394,6 +394,7 @@ template<typename Scalar> void geometry(void)
#define VERIFY_EULER(I,J,K, X,Y,Z) { \
Vector3 ea = m.eulerAngles(I,J,K); \
Matrix3 m1 = Matrix3(AngleAxisx(ea[0], Vector3::Unit##X()) * AngleAxisx(ea[1], Vector3::Unit##Y()) * AngleAxisx(ea[2], Vector3::Unit##Z())); \
VERIFY_IS_APPROX(m, m1); \
VERIFY_IS_APPROX(m, Matrix3(AngleAxisx(ea[0], Vector3::Unit##X()) * AngleAxisx(ea[1], Vector3::Unit##Y()) * AngleAxisx(ea[2], Vector3::Unit##Z()))); \
}
VERIFY_EULER(0,1,2, X,Y,Z);

View File

@ -25,7 +25,6 @@ template<typename MatrixType> void inverse(const MatrixType& m)
MatrixType m1 = MatrixType::Random(rows, cols),
m2(rows, cols),
mzero = MatrixType::Zero(rows, cols),
identity = MatrixType::Identity(rows, rows);
while(ei_abs(m1.determinant()) < RealScalar(0.1) && rows <= 8)

View File

@ -25,8 +25,7 @@ template<typename MatrixType> void linearStructure(const MatrixType& m)
// to test it, hence I consider that we will have tested Random.h
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols);
m3(rows, cols);
Scalar s1 = ei_random<Scalar>();
while (ei_abs(s1)<1e-3) s1 = ei_random<Scalar>();

View File

@ -25,22 +25,12 @@ template<typename MatrixType> void nomalloc(const MatrixType& m)
*/
typedef typename MatrixType::Scalar Scalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
int rows = m.rows();
int cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Identity(rows, rows),
square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
vzero = VectorType::Zero(rows);
m2 = MatrixType::Random(rows, cols);
Scalar s1 = ei_random<Scalar>();

View File

@ -51,16 +51,10 @@ template<typename MatrixType> void submatrices(const MatrixType& m)
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols),
ones = MatrixType::Ones(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Identity(rows, rows),
square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
v3 = VectorType::Random(rows),
vzero = VectorType::Zero(rows);
VectorType v1 = VectorType::Random(rows);
Scalar s1 = ei_random<Scalar>();

View File

@ -13,7 +13,6 @@ template<typename MatrixType> void triangular(const MatrixType& m)
{
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
RealScalar largerEps = 10*test_precision<RealScalar>();
@ -25,16 +24,7 @@ template<typename MatrixType> void triangular(const MatrixType& m)
m3(rows, cols),
m4(rows, cols),
r1(rows, cols),
r2(rows, cols),
mzero = MatrixType::Zero(rows, cols),
mones = MatrixType::Ones(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Identity(rows, rows),
square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
vzero = VectorType::Zero(rows);
r2(rows, cols);
MatrixType m1up = m1.template part<Eigen::UpperTriangular>();
MatrixType m2up = m2.template part<Eigen::UpperTriangular>();

View File

@ -40,8 +40,7 @@ template<typename MatrixType> void product(const MatrixType& m)
// to test it, hence I consider that we will have tested Random.h
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols);
m3(rows, cols);
RowSquareMatrixType
identity = RowSquareMatrixType::Identity(rows, rows),
square = RowSquareMatrixType::Random(rows, rows),
@ -49,9 +48,7 @@ template<typename MatrixType> void product(const MatrixType& m)
ColSquareMatrixType
square2 = ColSquareMatrixType::Random(cols, cols),
res2 = ColSquareMatrixType::Random(cols, cols);
RowVectorType v1 = RowVectorType::Random(rows),
v2 = RowVectorType::Random(rows),
vzero = RowVectorType::Zero(rows);
RowVectorType v1 = RowVectorType::Random(rows);
ColVectorType vc2 = ColVectorType::Random(cols), vcres(cols);
OtherMajorMatrixType tm1 = m1;