aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-07-21 00:34:46 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-07-21 00:34:46 +0000
commitc10f069b6b9f0dd4bb313341d1969bd7e1cf9338 (patch)
tree95934f5bc632a391dfa149783226b1543b24ff41
parentce425d92f1c1d199c8428c46b4c4ea3be81b137b (diff)
* Merge Extract and Part to the Part expression.
Renamed "MatrixBase::extract() const" to "MatrixBase::part() const" * Renamed static functions identity, zero, ones, random with an upper case first letter: Identity, Zero, Ones and Random.
-rw-r--r--Eigen/Core1
-rw-r--r--Eigen/src/Array/Random.h8
-rw-r--r--Eigen/src/Cholesky/Cholesky.h6
-rw-r--r--Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h4
-rw-r--r--Eigen/src/Core/CwiseNullaryOp.h92
-rwxr-xr-xEigen/src/Core/Extract.h155
-rw-r--r--Eigen/src/Core/MatrixBase.h30
-rw-r--r--Eigen/src/Core/Part.h243
-rw-r--r--Eigen/src/Core/util/StaticAssert.h5
-rw-r--r--Eigen/src/Geometry/Quaternion.h8
-rw-r--r--Eigen/src/Geometry/Transform.h8
-rw-r--r--Eigen/src/LU/Inverse.h2
-rwxr-xr-xEigen/src/QR/HessenbergDecomposition.h2
-rw-r--r--Eigen/src/QR/QR.h6
-rw-r--r--Eigen/src/QR/SelfAdjointEigenSolver.h2
-rwxr-xr-xEigen/src/QR/Tridiagonalization.h4
-rw-r--r--doc/examples/class_Block.cpp2
-rw-r--r--doc/examples/class_CwiseBinaryOp.cpp2
-rw-r--r--doc/examples/class_CwiseUnaryOp.cpp2
-rw-r--r--doc/examples/class_FixedBlock.cpp2
-rw-r--r--doc/snippets/Cholesky_solve.cpp4
-rw-r--r--doc/snippets/MatrixBase_adjoint.cpp2
-rw-r--r--doc/snippets/MatrixBase_block_int_int.cpp2
-rw-r--r--doc/snippets/MatrixBase_block_int_int_int_int.cpp2
-rw-r--r--doc/snippets/MatrixBase_cast.cpp4
-rw-r--r--doc/snippets/MatrixBase_col.cpp2
-rw-r--r--doc/snippets/MatrixBase_computeInverse.cpp2
-rw-r--r--doc/snippets/MatrixBase_corner_enum_int_int.cpp2
-rw-r--r--doc/snippets/MatrixBase_diagonal.cpp2
-rw-r--r--doc/snippets/MatrixBase_end_int.cpp2
-rw-r--r--doc/snippets/MatrixBase_eval.cpp2
-rw-r--r--doc/snippets/MatrixBase_extract.cpp8
-rw-r--r--doc/snippets/MatrixBase_identity.cpp2
-rw-r--r--doc/snippets/MatrixBase_identity_int_int.cpp2
-rw-r--r--doc/snippets/MatrixBase_inverse.cpp2
-rw-r--r--doc/snippets/MatrixBase_isDiagonal.cpp2
-rw-r--r--doc/snippets/MatrixBase_isIdentity.cpp2
-rw-r--r--doc/snippets/MatrixBase_isOnes.cpp2
-rw-r--r--doc/snippets/MatrixBase_isUnitary.cpp2
-rw-r--r--doc/snippets/MatrixBase_isZero.cpp2
-rw-r--r--doc/snippets/MatrixBase_marked.cpp4
-rw-r--r--doc/snippets/MatrixBase_minor.cpp2
-rw-r--r--doc/snippets/MatrixBase_ones.cpp4
-rw-r--r--doc/snippets/MatrixBase_ones_int.cpp4
-rw-r--r--doc/snippets/MatrixBase_ones_int_int.cpp2
-rw-r--r--doc/snippets/MatrixBase_part.cpp2
-rw-r--r--doc/snippets/MatrixBase_random.cpp2
-rw-r--r--doc/snippets/MatrixBase_random_int.cpp2
-rw-r--r--doc/snippets/MatrixBase_random_int_int.cpp2
-rw-r--r--doc/snippets/MatrixBase_row.cpp2
-rw-r--r--doc/snippets/MatrixBase_set.cpp2
-rw-r--r--doc/snippets/MatrixBase_setIdentity.cpp2
-rw-r--r--doc/snippets/MatrixBase_setOnes.cpp2
-rw-r--r--doc/snippets/MatrixBase_setRandom.cpp2
-rw-r--r--doc/snippets/MatrixBase_setZero.cpp2
-rw-r--r--doc/snippets/MatrixBase_start_int.cpp2
-rw-r--r--doc/snippets/MatrixBase_template_int_end.cpp2
-rw-r--r--doc/snippets/MatrixBase_template_int_int_corner_enum.cpp2
-rw-r--r--doc/snippets/MatrixBase_template_int_start.cpp2
-rw-r--r--doc/snippets/MatrixBase_transpose.cpp2
-rw-r--r--doc/snippets/MatrixBase_zero.cpp4
-rw-r--r--doc/snippets/MatrixBase_zero_int.cpp4
-rw-r--r--doc/snippets/MatrixBase_zero_int_int.cpp2
-rw-r--r--test/adjoint.cpp18
-rw-r--r--test/array.cpp12
-rw-r--r--test/basicstuff.cpp18
-rw-r--r--test/cholesky.cpp4
-rw-r--r--test/commainitializer.cpp6
-rw-r--r--test/cwiseop.cpp18
-rw-r--r--test/eigensolver.cpp4
-rw-r--r--test/geometry.cpp12
-rw-r--r--test/inverse.cpp8
-rw-r--r--test/linearstructure.cpp16
-rw-r--r--test/map.cpp2
-rw-r--r--test/miscmatrices.cpp12
-rw-r--r--test/nomalloc.cpp18
-rw-r--r--test/product.cpp26
-rw-r--r--test/qr.cpp6
-rw-r--r--test/submatrices.cpp18
-rw-r--r--test/triangular.cpp34
80 files changed, 428 insertions, 494 deletions
diff --git a/Eigen/Core b/Eigen/Core
index 6c6de3ab5..a233222e0 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -57,7 +57,6 @@ namespace Eigen {
#include "src/Core/IO.h"
#include "src/Core/Swap.h"
#include "src/Core/CommaInitializer.h"
-#include "src/Core/Extract.h"
#include "src/Core/Part.h"
#include "src/Core/CacheFriendlyProduct.h"
diff --git a/Eigen/src/Array/Random.h b/Eigen/src/Array/Random.h
index 97a34433a..9f3a916cf 100644
--- a/Eigen/src/Array/Random.h
+++ b/Eigen/src/Array/Random.h
@@ -53,7 +53,7 @@ struct ei_functor_traits<ei_scalar_random_op<Scalar> >
*/
template<typename Derived>
inline const CwiseNullaryOp<ei_scalar_random_op<typename ei_traits<Derived>::Scalar>, Derived>
-MatrixBase<Derived>::random(int rows, int cols)
+MatrixBase<Derived>::Random(int rows, int cols)
{
return NullaryExpr(rows, cols, ei_scalar_random_op<Scalar>());
}
@@ -78,7 +78,7 @@ MatrixBase<Derived>::random(int rows, int cols)
*/
template<typename Derived>
inline const CwiseNullaryOp<ei_scalar_random_op<typename ei_traits<Derived>::Scalar>, Derived>
-MatrixBase<Derived>::random(int size)
+MatrixBase<Derived>::Random(int size)
{
return NullaryExpr(size, ei_scalar_random_op<Scalar>());
}
@@ -98,7 +98,7 @@ MatrixBase<Derived>::random(int size)
*/
template<typename Derived>
inline const CwiseNullaryOp<ei_scalar_random_op<typename ei_traits<Derived>::Scalar>, Derived>
-MatrixBase<Derived>::random()
+MatrixBase<Derived>::Random()
{
return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, ei_scalar_random_op<Scalar>());
}
@@ -115,7 +115,7 @@ MatrixBase<Derived>::random()
template<typename Derived>
inline Derived& MatrixBase<Derived>::setRandom()
{
- return *this = random(rows(), cols());
+ return *this = Random(rows(), cols());
}
#endif // EIGEN_RANDOM_H
diff --git a/Eigen/src/Cholesky/Cholesky.h b/Eigen/src/Cholesky/Cholesky.h
index dd4fc6e38..5c5e6cfc7 100644
--- a/Eigen/src/Cholesky/Cholesky.h
+++ b/Eigen/src/Cholesky/Cholesky.h
@@ -58,7 +58,7 @@ template<typename MatrixType> class Cholesky
compute(matrix);
}
- Extract<MatrixType, Lower> matrixL(void) const
+ Part<MatrixType, Lower> matrixL(void) const
{
return m_matrix;
}
@@ -79,7 +79,7 @@ template<typename MatrixType> class Cholesky
bool m_isPositiveDefinite;
};
-/** Compute / recompute the Cholesky decomposition A = LL^* = U^*U of \a matrix
+/** Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of \a matrix
*/
template<typename MatrixType>
void Cholesky<MatrixType>::compute(const MatrixType& a)
@@ -124,7 +124,7 @@ typename Derived::Eval Cholesky<MatrixType>::solve(const MatrixBase<Derived> &b)
const int size = m_matrix.rows();
ei_assert(size==b.rows());
- return m_matrix.adjoint().template extract<Upper>().inverseProduct(matrixL().inverseProduct(b));
+ return m_matrix.adjoint().template part<Upper>().inverseProduct(matrixL().inverseProduct(b));
}
/** \cholesky_module
diff --git a/Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h b/Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h
index 2572b88a2..0dcedf0dc 100644
--- a/Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h
+++ b/Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h
@@ -58,7 +58,7 @@ template<typename MatrixType> class CholeskyWithoutSquareRoot
}
/** \returns the lower triangular matrix L */
- Extract<MatrixType, UnitLower> matrixL(void) const
+ Part<MatrixType, UnitLower> matrixL(void) const
{
return m_matrix;
}
@@ -136,7 +136,7 @@ typename Derived::Eval CholeskyWithoutSquareRoot<MatrixType>::solve(const Matrix
const int size = m_matrix.rows();
ei_assert(size==b.rows());
- return m_matrix.adjoint().template extract<UnitUpper>()
+ return m_matrix.adjoint().template part<UnitUpper>()
.inverseProduct(
(matrixL()
.inverseProduct(b))
diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h
index 6df351201..343be79a1 100644
--- a/Eigen/src/Core/CwiseNullaryOp.h
+++ b/Eigen/src/Core/CwiseNullaryOp.h
@@ -32,7 +32,7 @@
* \param NullaryOp template functor implementing the operator
*
* This class represents an expression of a generic nullary operator.
- * It is the return type of the ones(), zero(), constant(), identity() and random() functions,
+ * It is the return type of the Ones(), Zero(), Constant(), Identity() and Random() functions,
* and most of the time this is the only way it is used.
*
* However, if you want to write a function returning such an expression, you
@@ -113,7 +113,7 @@ class CwiseNullaryOp : ei_no_assignment_operator,
* the returned matrix. Must be compatible with this MatrixBase type.
*
* This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
- * it is redundant to pass \a rows and \a cols as arguments, so zero() should be used
+ * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used
* instead.
*
* The template parameter \a CustomNullaryOp is the type of the functor.
@@ -136,7 +136,7 @@ MatrixBase<Derived>::NullaryExpr(int rows, int cols, const CustomNullaryOp& func
* \only_for_vectors
*
* This variant is meant to be used for dynamic-size vector types. For fixed-size types,
- * it is redundant to pass \a size as argument, so zero() should be used
+ * it is redundant to pass \a size as argument, so Zero() should be used
* instead.
*
* The template parameter \a CustomNullaryOp is the type of the functor.
@@ -176,7 +176,7 @@ MatrixBase<Derived>::NullaryExpr(const CustomNullaryOp& func)
* the returned matrix. Must be compatible with this MatrixBase type.
*
* This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
- * it is redundant to pass \a rows and \a cols as arguments, so zero() should be used
+ * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used
* instead.
*
* The template parameter \a CustomNullaryOp is the type of the functor.
@@ -185,7 +185,7 @@ MatrixBase<Derived>::NullaryExpr(const CustomNullaryOp& func)
*/
template<typename Derived>
const typename MatrixBase<Derived>::ConstantReturnType
-MatrixBase<Derived>::constant(int rows, int cols, const Scalar& value)
+MatrixBase<Derived>::Constant(int rows, int cols, const Scalar& value)
{
return NullaryExpr(rows, cols, ei_scalar_constant_op<Scalar>(value));
}
@@ -198,7 +198,7 @@ MatrixBase<Derived>::constant(int rows, int cols, const Scalar& value)
* \only_for_vectors
*
* This variant is meant to be used for dynamic-size vector types. For fixed-size types,
- * it is redundant to pass \a size as argument, so zero() should be used
+ * it is redundant to pass \a size as argument, so Zero() should be used
* instead.
*
* The template parameter \a CustomNullaryOp is the type of the functor.
@@ -207,7 +207,7 @@ MatrixBase<Derived>::constant(int rows, int cols, const Scalar& value)
*/
template<typename Derived>
const typename MatrixBase<Derived>::ConstantReturnType
-MatrixBase<Derived>::constant(int size, const Scalar& value)
+MatrixBase<Derived>::Constant(int size, const Scalar& value)
{
return NullaryExpr(size, ei_scalar_constant_op<Scalar>(value));
}
@@ -223,7 +223,7 @@ MatrixBase<Derived>::constant(int size, const Scalar& value)
*/
template<typename Derived>
const typename MatrixBase<Derived>::ConstantReturnType
-MatrixBase<Derived>::constant(const Scalar& value)
+MatrixBase<Derived>::Constant(const Scalar& value)
{
EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, ei_scalar_constant_op<Scalar>(value));
@@ -242,12 +242,12 @@ bool MatrixBase<Derived>::isApproxToConstant
/** Sets all coefficients in this expression to \a value.
*
- * \sa class CwiseNullaryOp, zero(), ones()
+ * \sa class CwiseNullaryOp, Zero(), Ones()
*/
template<typename Derived>
Derived& MatrixBase<Derived>::setConstant(const Scalar& value)
{
- return *this = constant(rows(), cols(), value);
+ return derived() = Constant(rows(), cols(), value);
}
// zero:
@@ -258,7 +258,7 @@ Derived& MatrixBase<Derived>::setConstant(const Scalar& value)
* the returned matrix. Must be compatible with this MatrixBase type.
*
* This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
- * it is redundant to pass \a rows and \a cols as arguments, so zero() should be used
+ * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used
* instead.
*
* \addexample Zero \label How to take get a zero matrix
@@ -266,13 +266,13 @@ Derived& MatrixBase<Derived>::setConstant(const Scalar& value)
* Example: \include MatrixBase_zero_int_int.cpp
* Output: \verbinclude MatrixBase_zero_int_int.out
*
- * \sa zero(), zero(int)
+ * \sa Zero(), Zero(int)
*/
template<typename Derived>
const typename MatrixBase<Derived>::ConstantReturnType
-MatrixBase<Derived>::zero(int rows, int cols)
+MatrixBase<Derived>::Zero(int rows, int cols)
{
- return constant(rows, cols, Scalar(0));
+ return Constant(rows, cols, Scalar(0));
}
/** \returns an expression of a zero vector.
@@ -283,19 +283,19 @@ MatrixBase<Derived>::zero(int rows, int cols)
* \only_for_vectors
*
* This variant is meant to be used for dynamic-size vector types. For fixed-size types,
- * it is redundant to pass \a size as argument, so zero() should be used
+ * it is redundant to pass \a size as argument, so Zero() should be used
* instead.
*
* Example: \include MatrixBase_zero_int.cpp
* Output: \verbinclude MatrixBase_zero_int.out
*
- * \sa zero(), zero(int,int)
+ * \sa Zero(), Zero(int,int)
*/
template<typename Derived>
const typename MatrixBase<Derived>::ConstantReturnType
-MatrixBase<Derived>::zero(int size)
+MatrixBase<Derived>::Zero(int size)
{
- return constant(size, Scalar(0));
+ return Constant(size, Scalar(0));
}
/** \returns an expression of a fixed-size zero matrix or vector.
@@ -306,13 +306,13 @@ MatrixBase<Derived>::zero(int size)
* Example: \include MatrixBase_zero.cpp
* Output: \verbinclude MatrixBase_zero.out
*
- * \sa zero(int), zero(int,int)
+ * \sa Zero(int), Zero(int,int)
*/
template<typename Derived>
const typename MatrixBase<Derived>::ConstantReturnType
-MatrixBase<Derived>::zero()
+MatrixBase<Derived>::Zero()
{
- return constant(Scalar(0));
+ return Constant(Scalar(0));
}
/** \returns true if *this is approximately equal to the zero matrix,
@@ -321,7 +321,7 @@ MatrixBase<Derived>::zero()
* Example: \include MatrixBase_isZero.cpp
* Output: \verbinclude MatrixBase_isZero.out
*
- * \sa class CwiseNullaryOp, zero()
+ * \sa class CwiseNullaryOp, Zero()
*/
template<typename Derived>
bool MatrixBase<Derived>::isZero
@@ -339,7 +339,7 @@ bool MatrixBase<Derived>::isZero
* Example: \include MatrixBase_setZero.cpp
* Output: \verbinclude MatrixBase_setZero.out
*
- * \sa class CwiseNullaryOp, zero()
+ * \sa class CwiseNullaryOp, Zero()
*/
template<typename Derived>
Derived& MatrixBase<Derived>::setZero()
@@ -355,7 +355,7 @@ Derived& MatrixBase<Derived>::setZero()
* the returned matrix. Must be compatible with this MatrixBase type.
*
* This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
- * it is redundant to pass \a rows and \a cols as arguments, so ones() should be used
+ * it is redundant to pass \a rows and \a cols as arguments, so Ones() should be used
* instead.
*
* \addexample One \label How to get a matrix with all coefficients equal one
@@ -363,13 +363,13 @@ Derived& MatrixBase<Derived>::setZero()
* Example: \include MatrixBase_ones_int_int.cpp
* Output: \verbinclude MatrixBase_ones_int_int.out
*
- * \sa ones(), ones(int), isOnes(), class Ones
+ * \sa Ones(), Ones(int), isOnes(), class Ones
*/
template<typename Derived>
const typename MatrixBase<Derived>::ConstantReturnType
-MatrixBase<Derived>::ones(int rows, int cols)
+MatrixBase<Derived>::Ones(int rows, int cols)
{
- return constant(rows, cols, Scalar(1));
+ return Constant(rows, cols, Scalar(1));
}
/** \returns an expression of a vector where all coefficients equal one.
@@ -380,19 +380,19 @@ MatrixBase<Derived>::ones(int rows, int cols)
* \only_for_vectors
*
* This variant is meant to be used for dynamic-size vector types. For fixed-size types,
- * it is redundant to pass \a size as argument, so ones() should be used
+ * it is redundant to pass \a size as argument, so Ones() should be used
* instead.
*
* Example: \include MatrixBase_ones_int.cpp
* Output: \verbinclude MatrixBase_ones_int.out
*
- * \sa ones(), ones(int,int), isOnes(), class Ones
+ * \sa Ones(), Ones(int,int), isOnes(), class Ones
*/
template<typename Derived>
const typename MatrixBase<Derived>::ConstantReturnType
-MatrixBase<Derived>::ones(int size)
+MatrixBase<Derived>::Ones(int size)
{
- return constant(size, Scalar(1));
+ return Constant(size, Scalar(1));
}
/** \returns an expression of a fixed-size matrix or vector where all coefficients equal one.
@@ -403,13 +403,13 @@ MatrixBase<Derived>::ones(int size)
* Example: \include MatrixBase_ones.cpp
* Output: \verbinclude MatrixBase_ones.out
*
- * \sa ones(int), ones(int,int), isOnes(), class Ones
+ * \sa Ones(int), Ones(int,int), isOnes(), class Ones
*/
template<typename Derived>
const typename MatrixBase<Derived>::ConstantReturnType
-MatrixBase<Derived>::ones()
+MatrixBase<Derived>::Ones()
{
- return constant(Scalar(1));
+ return Constant(Scalar(1));
}
/** \returns true if *this is approximately equal to the matrix where all coefficients
@@ -418,7 +418,7 @@ MatrixBase<Derived>::ones()
* Example: \include MatrixBase_isOnes.cpp
* Output: \verbinclude MatrixBase_isOnes.out
*
- * \sa class CwiseNullaryOp, ones()
+ * \sa class CwiseNullaryOp, Ones()
*/
template<typename Derived>
bool MatrixBase<Derived>::isOnes
@@ -432,7 +432,7 @@ bool MatrixBase<Derived>::isOnes
* Example: \include MatrixBase_setOnes.cpp
* Output: \verbinclude MatrixBase_setOnes.out
*
- * \sa class CwiseNullaryOp, ones()
+ * \sa class CwiseNullaryOp, Ones()
*/
template<typename Derived>
Derived& MatrixBase<Derived>::setOnes()
@@ -448,7 +448,7 @@ Derived& MatrixBase<Derived>::setOnes()
* the returned matrix. Must be compatible with this MatrixBase type.
*
* This variant is meant to be used for dynamic-size matrix types. For fixed-size types,
- * it is redundant to pass \a rows and \a cols as arguments, so identity() should be used
+ * it is redundant to pass \a rows and \a cols as arguments, so Identity() should be used
* instead.
*
* \addexample Identity \label How to get an identity matrix
@@ -456,11 +456,11 @@ Derived& MatrixBase<Derived>::setOnes()
* Example: \include MatrixBase_identity_int_int.cpp
* Output: \verbinclude MatrixBase_identity_int_int.out
*
- * \sa identity(), setIdentity(), isIdentity()
+ * \sa Identity(), setIdentity(), isIdentity()
*/
template<typename Derived>
inline const typename MatrixBase<Derived>::IdentityReturnType
-MatrixBase<Derived>::identity(int rows, int cols)
+MatrixBase<Derived>::Identity(int rows, int cols)
{
return NullaryExpr(rows, cols, ei_scalar_identity_op<Scalar>());
}
@@ -473,11 +473,11 @@ MatrixBase<Derived>::identity(int rows, int cols)
* Example: \include MatrixBase_identity.cpp
* Output: \verbinclude MatrixBase_identity.out
*
- * \sa identity(int,int), setIdentity(), isIdentity()
+ * \sa Identity(int,int), setIdentity(), isIdentity()
*/
template<typename Derived>
inline const typename MatrixBase<Derived>::IdentityReturnType
-MatrixBase<Derived>::identity()
+MatrixBase<Derived>::Identity()
{
EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived)
return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, ei_scalar_identity_op<Scalar>());
@@ -490,7 +490,7 @@ MatrixBase<Derived>::identity()
* Example: \include MatrixBase_isIdentity.cpp
* Output: \verbinclude MatrixBase_isIdentity.out
*
- * \sa class CwiseNullaryOp, identity(), identity(int,int), setIdentity()
+ * \sa class CwiseNullaryOp, Identity(), Identity(int,int), setIdentity()
*/
template<typename Derived>
bool MatrixBase<Derived>::isIdentity
@@ -520,12 +520,12 @@ bool MatrixBase<Derived>::isIdentity
* Example: \include MatrixBase_setIdentity.cpp
* Output: \verbinclude MatrixBase_setIdentity.out
*
- * \sa class CwiseNullaryOp, identity(), identity(int,int), isIdentity()
+ * \sa class CwiseNullaryOp, Identity(), Identity(int,int), isIdentity()
*/
template<typename Derived>
inline Derived& MatrixBase<Derived>::setIdentity()
{
- return *this = identity(rows(), cols());
+ return derived() = Identity(rows(), cols());
}
/** \returns an expression of the i-th unit (basis) vector.
@@ -538,7 +538,7 @@ template<typename Derived>
const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::Unit(int size, int i)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
- return BasisReturnType(SquareMatrixType::identity(size,size), i);
+ return BasisReturnType(SquareMatrixType::Identity(size,size), i);
}
/** \returns an expression of the i-th unit (basis) vector.
@@ -553,7 +553,7 @@ template<typename Derived>
const typename MatrixBase<Derived>::BasisReturnType MatrixBase<Derived>::Unit(int i)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
- return BasisReturnType(SquareMatrixType::identity(),i);
+ return BasisReturnType(SquareMatrixType::Identity(),i);
}
/** \returns an expression of the X axis unit vector (1{,0}^*)
diff --git a/Eigen/src/Core/Extract.h b/Eigen/src/Core/Extract.h
deleted file mode 100755
index ff84d0ece..000000000
--- a/Eigen/src/Core/Extract.h
+++ /dev/null
@@ -1,155 +0,0 @@
-// This file is part of Eigen, a lightweight C++ template library
-// for linear algebra. Eigen itself is part of the KDE project.
-//
-// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
-// Copyright (C) 2008 Benoit Jacob <jacob@math.jussieu.fr>
-//
-// Eigen is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 3 of the License, or (at your option) any later version.
-//
-// Alternatively, you can redistribute it and/or
-// modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of
-// the License, or (at your option) any later version.
-//
-// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
-// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License and a copy of the GNU General Public License along with
-// Eigen. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef EIGEN_EXTRACT_H
-#define EIGEN_EXTRACT_H
-
-/** \class Extract
- *
- * \brief Expression of a triangular matrix extracted from a given matrix
- *
- * \param MatrixType the type of the object in which we are taking the triangular part
- * \param Mode the kind of triangular matrix expression to construct. Can be Upper, StrictlyUpper,
- * UnitUpper, Lower, StrictlyLower, UnitLower. This is in fact a bit field; it must have either
- * UpperTriangularBit or LowerTriangularBit, and additionnaly it may have either ZeroDiagBit or
- * UnitDiagBit.
- *
- * This class represents an expression of the upper or lower triangular part of
- * a square matrix, possibly with a further assumption on the diagonal. It is the return type
- * of MatrixBase::extract() and most of the time this is the only way it is used.
- *
- * \sa MatrixBase::extract()
- */
-template<typename MatrixType, unsigned int Mode>
-struct ei_traits<Extract<MatrixType, Mode> >
-{
- typedef typename MatrixType::Scalar Scalar;
- typedef typename ei_nested<MatrixType>::type MatrixTypeNested;
- typedef typename ei_unref<MatrixTypeNested>::type _MatrixTypeNested;
- enum {
- RowsAtCompileTime = MatrixType::RowsAtCompileTime,
- ColsAtCompileTime = MatrixType::ColsAtCompileTime,
- MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
- MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
- Flags = (_MatrixTypeNested::Flags & ~(PacketAccessBit | LinearAccessBit | DirectAccessBit)) | Mode,
- CoeffReadCost = _MatrixTypeNested::CoeffReadCost
- };
-};
-
-template<typename MatrixType, unsigned int Mode> class Extract
- : public MatrixBase<Extract<MatrixType, Mode> >
-{
- public:
-
- EIGEN_GENERIC_PUBLIC_INTERFACE(Extract)
-
- inline Extract(const MatrixType& matrix) : m_matrix(matrix) {}
-
- EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Extract)
-
- inline int rows() const { return m_matrix.rows(); }
- inline int cols() const { return m_matrix.cols(); }
-
- inline Scalar coeff(int row, int col) const
- {
- if(Flags & LowerTriangularBit ? col>row : row>col)
- return (Flags & SelfAdjointBit) ? ei_conj(m_matrix.coeff(col, row)) : (Scalar)0;
- if(Flags & UnitDiagBit)
- return col==row ? (Scalar)1 : m_matrix.coeff(row, col);
- else if(Flags & ZeroDiagBit)
- return col==row ? (Scalar)0 : m_matrix.coeff(row, col);
- else
- return m_matrix.coeff(row, col);
- }
-
- protected:
-
- const typename MatrixType::Nested m_matrix;
-};
-
-/** \returns an expression of a triangular matrix extracted from the current matrix
- *
- * The parameter \a Mode can have the following values: \c Upper, \c StrictlyUpper, \c UnitUpper,
- * \c Lower, \c StrictlyLower, \c UnitLower.
- *
- * \addexample ExtractExample \label How to extract a triangular part of an arbitrary matrix
- *
- * Example: \include MatrixBase_extract.cpp
- * Output: \verbinclude MatrixBase_extract.out
- *
- * \sa class Extract, part(), marked()
- */
-template<typename Derived>
-template<unsigned int Mode>
-const Extract<Derived, Mode> MatrixBase<Derived>::extract() const
-{
- return derived();
-}
-
-/** \returns true if *this is approximately equal to an upper triangular matrix,
- * within the precision given by \a prec.
- *
- * \sa isLower(), extract(), part(), marked()
- */
-template<typename Derived>
-bool MatrixBase<Derived>::isUpper(RealScalar prec) const
-{
- if(cols() != rows()) return false;
- RealScalar maxAbsOnUpperPart = static_cast<RealScalar>(-1);
- for(int j = 0; j < cols(); j++)
- for(int i = 0; i <= j; i++)
- {
- RealScalar absValue = ei_abs(coeff(i,j));
- if(absValue > maxAbsOnUpperPart) maxAbsOnUpperPart = absValue;
- }
- for(int j = 0; j < cols()-1; j++)
- for(int i = j+1; i < rows(); i++)
- if(!ei_isMuchSmallerThan(coeff(i, j), maxAbsOnUpperPart, prec)) return false;
- return true;
-}
-
-/** \returns true if *this is approximately equal to a lower triangular matrix,
- * within the precision given by \a prec.
- *
- * \sa isUpper(), extract(), part(), marked()
- */
-template<typename Derived>
-bool MatrixBase<Derived>::isLower(RealScalar prec) const
-{
- if(cols() != rows()) return false;
- RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
- for(int j = 0; j < cols(); j++)
- for(int i = j; i < rows(); i++)
- {
- RealScalar absValue = ei_abs(coeff(i,j));
- if(absValue > maxAbsOnLowerPart) maxAbsOnLowerPart = absValue;
- }
- for(int j = 1; j < cols(); j++)
- for(int i = 0; i < j; i++)
- if(!ei_isMuchSmallerThan(coeff(i, j), maxAbsOnLowerPart, prec)) return false;
- return true;
-}
-
-#endif // EIGEN_EXTRACT_H
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index bd4b64b05..78bab6163 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -376,15 +376,15 @@ template<typename Derived> class MatrixBase
const DiagonalCoeffs<Derived> diagonal() const;
template<unsigned int Mode> Part<Derived, Mode> part();
- template<unsigned int Mode> const Extract<Derived, Mode> extract() const;
+ template<unsigned int Mode> const Part<Derived, Mode> part() const;
static const ConstantReturnType
- constant(int rows, int cols, const Scalar& value);
+ Constant(int rows, int cols, const Scalar& value);
static const ConstantReturnType
- constant(int size, const Scalar& value);
+ Constant(int size, const Scalar& value);
static const ConstantReturnType
- constant(const Scalar& value);
+ Constant(const Scalar& value);
template<typename CustomNullaryOp>
static const CwiseNullaryOp<CustomNullaryOp, Derived>
@@ -396,14 +396,14 @@ template<typename Derived> class MatrixBase
static const CwiseNullaryOp<CustomNullaryOp, Derived>
NullaryExpr(const CustomNullaryOp& func);
- static const ConstantReturnType zero(int rows, int cols);
- static const ConstantReturnType zero(int size);
- static const ConstantReturnType zero();
- static const ConstantReturnType ones(int rows, int cols);
- static const ConstantReturnType ones(int size);
- static const ConstantReturnType ones();
- static const IdentityReturnType identity();
- static const IdentityReturnType identity(int rows, int cols);
+ static const ConstantReturnType Zero(int rows, int cols);
+ static const ConstantReturnType Zero(int size);
+ static const ConstantReturnType Zero();
+ static const ConstantReturnType Ones(int rows, int cols);
+ static const ConstantReturnType Ones(int size);
+ static const ConstantReturnType Ones();
+ static const IdentityReturnType Identity();
+ static const IdentityReturnType Identity(int rows, int cols);
static const BasisReturnType Unit(int size, int i);
static const BasisReturnType Unit(int i);
static const BasisReturnType UnitX();
@@ -521,9 +521,9 @@ template<typename Derived> class MatrixBase
const PartialRedux<Derived,Horizontal> rowwise() const;
const PartialRedux<Derived,Vertical> colwise() const;
- static const CwiseNullaryOp<ei_scalar_random_op<Scalar>,Derived> random(int rows, int cols);
- static const CwiseNullaryOp<ei_scalar_random_op<Scalar>,Derived> random(int size);
- static const CwiseNullaryOp<ei_scalar_random_op<Scalar>,Derived> random();
+ static const CwiseNullaryOp<ei_scalar_random_op<Scalar>,Derived> Random(int rows, int cols);
+ static const CwiseNullaryOp<ei_scalar_random_op<Scalar>,Derived> Random(int size);
+ static const CwiseNullaryOp<ei_scalar_random_op<Scalar>,Derived> Random();
/////////// LU module ///////////
diff --git a/Eigen/src/Core/Part.h b/Eigen/src/Core/Part.h
index a0553923a..cd349855d 100644
--- a/Eigen/src/Core/Part.h
+++ b/Eigen/src/Core/Part.h
@@ -28,58 +28,120 @@
/** \class Part
*
- * \brief Pseudo-expression allowing to write to a special part of a matrix
+ * \brief Expression of a triangular matrix extracted from a given matrix
*
- * This lvalue-only pseudo-expression allows to perform special operations
- * on a matrix, such as writing only to the upper (above diagonal) part.
+ * \param MatrixType the type of the object in which we are taking the triangular part
+ * \param Mode the kind of triangular matrix expression to construct. Can be Upper, StrictlyUpper,
+ * UnitUpper, Lower, StrictlyLower, UnitLower. This is in fact a bit field; it must have either
+ * UpperTriangularBit or LowerTriangularBit, and additionnaly it may have either ZeroDiagBit or
+ * UnitDiagBit.
*
- * It is the return type of MatrixBase::part() and most of the time this is
- * the only way that it is used.
+ * This class represents an expression of the upper or lower triangular part of
+ * a square matrix, possibly with a further assumption on the diagonal. It is the return type
+ * of MatrixBase::part() and most of the time this is the only way it is used.
*
- * \sa class Extract, MatrixBase::part()
+ * \sa MatrixBase::part()
*/
template<typename MatrixType, unsigned int Mode>
-class Part
+struct ei_traits<Part<MatrixType, Mode> >
+{
+ typedef typename MatrixType::Scalar Scalar;
+ typedef typename ei_nested<MatrixType>::type MatrixTypeNested;
+ typedef typename ei_unref<MatrixTypeNested>::type _MatrixTypeNested;
+ enum {
+ RowsAtCompileTime = MatrixType::RowsAtCompileTime,
+ ColsAtCompileTime = MatrixType::ColsAtCompileTime,
+ MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
+ MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
+ Flags = (_MatrixTypeNested::Flags & ~(PacketAccessBit | LinearAccessBit | DirectAccessBit)) | Mode,
+ CoeffReadCost = _MatrixTypeNested::CoeffReadCost
+ };
+};
+
+template<typename MatrixType, unsigned int Mode> class Part
+ : public MatrixBase<Part<MatrixType, Mode> >
{
public:
- Part(MatrixType& matrix);
- /** \sa operator=(), MatrixBase::lazyAssign() */
- template<typename Other> void lazyAssign(const Other& other);
- /** \sa MatrixBase::operator=() */
- template<typename Other> void operator=(const Other& other);
+
+ EIGEN_GENERIC_PUBLIC_INTERFACE(Part)
+
+ inline Part(const MatrixType& matrix) : m_matrix(matrix)
+ { ei_assert(ei_are_flags_consistent<Mode>::ret); }
+
/** \sa MatrixBase::operator+=() */
- template<typename Other> void operator+=(const Other& other);
+ template<typename Other> Part& operator+=(const Other& other);
/** \sa MatrixBase::operator-=() */
- template<typename Other> void operator-=(const Other& other);
+ template<typename Other> Part& operator-=(const Other& other);
/** \sa MatrixBase::operator*=() */
- void operator*=(const typename ei_traits<MatrixType>::Scalar& other);
+ Part& operator*=(const typename ei_traits<MatrixType>::Scalar& other);
/** \sa MatrixBase::operator/=() */
- void operator/=(const typename ei_traits<MatrixType>::Scalar& other);
- /** \sa MatrixBase::setConstant() */
- void setConstant(const typename ei_traits<MatrixType>::Scalar& value);
- /** \sa MatrixBase::setZero() */
- void setZero();
- /** \sa MatrixBase::setOnes() */
- void setOnes();
- /** \sa MatrixBase::setRandom() */
- void setRandom();
- /** \sa MatrixBase::setIdentity() */
- void setIdentity();
-
- private:
- MatrixType& m_matrix;
+ Part& operator/=(const typename ei_traits<MatrixType>::Scalar& other);
+
+ /** \sa operator=(), MatrixBase::lazyAssign() */
+ template<typename Other> void lazyAssign(const Other& other);
+ /** \sa MatrixBase::operator=() */
+ template<typename Other> Part& operator=(const Other& other);
+
+ inline int rows() const { return m_matrix.rows(); }
+ inline int cols() const { return m_matrix.cols(); }
+
+ inline Scalar coeff(int row, int col) const
+ {
+ if(Flags & LowerTriangularBit ? col>row : row>col)
+ return (Flags & SelfAdjointBit) ? ei_conj(m_matrix.coeff(col, row)) : (Scalar)0;
+ if(Flags & UnitDiagBit)
+ return col==row ? (Scalar)1 : m_matrix.coeff(row, col);
+ else if(Flags & ZeroDiagBit)
+ return col==row ? (Scalar)0 : m_matrix.coeff(row, col);
+ else
+ return m_matrix.coeff(row, col);
+ }
+
+ inline Scalar coeffRef(int row, int col) const
+ {
+ EIGEN_STATIC_ASSERT(!(Flags & UnitDiagBit), writting_to_triangular_part_with_unit_diag_is_not_supported);
+ EIGEN_STATIC_ASSERT(!(Flags & SelfAdjointBit), default_writting_to_selfadjoint_not_supported);
+ ei_assert( (Mode==Upper && col>=row)
+ || (Mode==Lower && col<=row)
+ || (Mode==StrictlyUpper && col>row)
+ || (Mode==StrictlyLower && col<row));
+ return m_matrix.coeffRef(row, col);
+ }
+
+ /** discard any writes to a row */
+ const Block<Part, 1, ColsAtCompileTime> row(int i) { return Base::row(i); }
+ const Block<Part, 1, ColsAtCompileTime> row(int i) const { return Base::row(i); }
+ /** discard any writes to a column */
+ const Block<Part, RowsAtCompileTime, 1> col(int i) { return Base::col(i); }
+ const Block<Part, RowsAtCompileTime, 1> col(int i) const { return Base::col(i); }
+
+ protected:
+
+ const typename MatrixType::Nested m_matrix;
};
-template<typename MatrixType, unsigned int Mode>
-inline Part<MatrixType, Mode>::Part(MatrixType& matrix)
- : m_matrix(matrix)
+/** \returns an expression of a triangular matrix extracted from the current matrix
+ *
+ * The parameter \a Mode can have the following values: \c Upper, \c StrictlyUpper, \c UnitUpper,
+ * \c Lower, \c StrictlyLower, \c UnitLower.
+ *
+ * \addexample PartExample \label How to extract a triangular part of an arbitrary matrix
+ *
+ * Example: \include MatrixBase_extract.cpp
+ * Output: \verbinclude MatrixBase_extract.out
+ *
+ * \sa class Part, part(), marked()
+ */
+template<typename Derived>
+template<unsigned int Mode>
+const Part<Derived, Mode> MatrixBase<Derived>::part() const
{
- ei_assert(ei_are_flags_consistent<Mode>::ret);
+ return derived();
}
template<typename MatrixType, unsigned int Mode>
template<typename Other>
-inline void Part<MatrixType, Mode>::operator=(const Other& other)
+inline Part<MatrixType, Mode>& Part<MatrixType, Mode>::operator=(const Other& other)
{
if(Other::Flags & EvalBeforeAssigningBit)
{
@@ -89,6 +151,7 @@ inline void Part<MatrixType, Mode>::operator=(const Other& other)
}
else
lazyAssign(other.derived());
+ return *this;
}
template<typename Derived1, typename Derived2, unsigned int Mode, int UnrollCount>
@@ -204,76 +267,98 @@ void Part<MatrixType, Mode>::lazyAssign(const Other& other)
ei_part_assignment_impl
<MatrixType, Other, Mode,
unroll ? int(MatrixType::SizeAtCompileTime) : Dynamic
- >::run(m_matrix, other.derived());
+ >::run(m_matrix.const_cast_derived(), other.derived());
}
-template<typename MatrixType, unsigned int Mode>
-template<typename Other> inline void Part<MatrixType, Mode>::operator+=(const Other& other)
-{
- *this = m_matrix + other;
-}
-
-template<typename MatrixType, unsigned int Mode>
-template<typename Other> inline void Part<MatrixType, Mode>::operator-=(const Other& other)
+/** \returns a lvalue pseudo-expression allowing to perform special operations on \c *this.
+ *
+ * The \a Mode parameter can have the following values: \c Upper, \c StrictlyUpper, \c Lower,
+ * \c StrictlyLower, \c SelfAdjoint.
+ *
+ * \addexample PartExample \label How to write to a triangular part of a matrix
+ *
+ * Example: \include MatrixBase_part.cpp
+ * Output: \verbinclude MatrixBase_part.out
+ *
+ * \sa class Part, MatrixBase::extract(), MatrixBase::marked()
+ */
+template<typename Derived>
+template<unsigned int Mode>
+inline Part<Derived, Mode> MatrixBase<Derived>::part()
{
- *this = m_matrix - other;
+ return Part<Derived, Mode>(derived());
}
-template<typename MatrixType, unsigned int Mode>
-inline void Part<MatrixType, Mode>::operator*=
-(const typename ei_traits<MatrixType>::Scalar& other)
+/** \returns true if *this is approximately equal to an upper triangular matrix,
+ * within the precision given by \a prec.
+ *
+ * \sa isLower(), extract(), part(), marked()
+ */
+template<typename Derived>
+bool MatrixBase<Derived>::isUpper(RealScalar prec) const
{
- *this = m_matrix * other;
+ if(cols() != rows()) return false;
+ RealScalar maxAbsOnUpperPart = static_cast<RealScalar>(-1);
+ for(int j = 0; j < cols(); j++)
+ for(int i = 0; i <= j; i++)
+ {
+ RealScalar absValue = ei_abs(coeff(i,j));
+ if(absValue > maxAbsOnUpperPart) maxAbsOnUpperPart = absValue;
+ }
+ for(int j = 0; j < cols()-1; j++)
+ for(int i = j+1; i < rows(); i++)
+ if(!ei_isMuchSmallerThan(coeff(i, j), maxAbsOnUpperPart, prec)) return false;
+ return true;
}
-template<typename MatrixType, unsigned int Mode>
-inline void Part<MatrixType, Mode>::operator/=
-(const typename ei_traits<MatrixType>::Scalar& other)
+/** \returns true if *this is approximately equal to a lower triangular matrix,
+ * within the precision given by \a prec.
+ *
+ * \sa isUpper(), extract(), part(), marked()
+ */
+template<typename Derived>
+bool MatrixBase<Derived>::isLower(RealScalar prec) const
{
- *this = m_matrix / other;
+ if(cols() != rows()) return false;
+ RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
+ for(int j = 0; j < cols(); j++)
+ for(int i = j; i < rows(); i++)
+ {
+ RealScalar absValue = ei_abs(coeff(i,j));
+ if(absValue > maxAbsOnLowerPart) maxAbsOnLowerPart = absValue;
+ }
+ for(int j = 1; j < cols(); j++)
+ for(int i = 0; i < j; i++)
+ if(!ei_isMuchSmallerThan(coeff(i, j), maxAbsOnLowerPart, prec)) return false;
+ return true;
}
template<typename MatrixType, unsigned int Mode>
-inline void Part<MatrixType, Mode>::setConstant(const typename ei_traits<MatrixType>::Scalar& value)
+template<typename Other>
+inline Part<MatrixType, Mode>& Part<MatrixType, Mode>::operator+=(const Other& other)
{
- *this = MatrixType::constant(m_matrix.rows(), m_matrix.cols(), value);
+ return *this = m_matrix + other;
}
template<typename MatrixType, unsigned int Mode>
-inline void Part<MatrixType, Mode>::setZero()
+template<typename Other>
+inline Part<MatrixType, Mode>& Part<MatrixType, Mode>::operator-=(const Other& other)
{
- setConstant((typename ei_traits<MatrixType>::Scalar)(0));
+ return *this = m_matrix - other;
}
template<typename MatrixType, unsigned int Mode>
-inline void Part<MatrixType, Mode>::setOnes()
+inline Part<MatrixType, Mode>& Part<MatrixType, Mode>::operator*=
+(const typename ei_traits<MatrixType>::Scalar& other)
{
- setConstant((typename ei_traits<MatrixType>::Scalar)(1));
+ return *this = m_matrix * other;
}
template<typename MatrixType, unsigned int Mode>
-inline void Part<MatrixType, Mode>::setRandom()
-{
- *this = MatrixType::random(m_matrix.rows(), m_matrix.cols());
-}
-
-/** \returns a lvalue pseudo-expression allowing to perform special operations on \c *this.
- *
- * The \a Mode parameter can have the following values: \c Upper, \c StrictlyUpper, \c Lower,
- * \c StrictlyLower, \c SelfAdjoint.
- *
- * \addexample PartExample \label How to write to a triangular part of a matrix
- *
- * Example: \include MatrixBase_part.cpp
- * Output: \verbinclude MatrixBase_part.out
- *
- * \sa class Part, MatrixBase::extract(), MatrixBase::marked()
- */
-template<typename Derived>
-template<unsigned int Mode>
-inline Part<Derived, Mode> MatrixBase<Derived>::part()
+inline Part<MatrixType, Mode>& Part<MatrixType, Mode>::operator/=
+(const typename ei_traits<MatrixType>::Scalar& other)
{
- return Part<Derived, Mode>(derived());
+ return *this = m_matrix / other;
}
#endif // EIGEN_PART_H
diff --git a/Eigen/src/Core/util/StaticAssert.h b/Eigen/src/Core/util/StaticAssert.h
index 6979e4ac1..751f8f878 100644
--- a/Eigen/src/Core/util/StaticAssert.h
+++ b/Eigen/src/Core/util/StaticAssert.h
@@ -61,7 +61,10 @@
this_method_is_only_for_vectors_of_a_specific_size,
you_did_a_programming_error,
you_called_a_fixed_size_method_on_a_dynamic_size_matrix_or_vector,
- unaligned_load_and_store_operations_unimplemented_on_AltiVec
+ unaligned_load_and_store_operations_unimplemented_on_AltiVec,
+ scalar_type_must_be_floating_point,
+ default_writting_to_selfadjoint_not_supported,
+ writting_to_triangular_part_with_unit_diag_is_not_supported
};
};
diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h
index ab6994b4b..55d85ef57 100644
--- a/Eigen/src/Geometry/Quaternion.h
+++ b/Eigen/src/Geometry/Quaternion.h
@@ -132,11 +132,11 @@ public:
operator Matrix3 () const { return toRotationMatrix(); }
/** \returns a quaternion representing an identity rotation
- * \sa MatrixBase::identity()
+ * \sa MatrixBase::Identity()
*/
- inline static Quaternion identity() { return Quaternion(1, 0, 0, 0); }
+ inline static Quaternion Identity() { return Quaternion(1, 0, 0, 0); }
- /** \sa Quaternion::identity(), MatrixBase::setIdentity()
+ /** \sa Quaternion::Identity(), MatrixBase::setIdentity()
*/
inline Quaternion& setIdentity() { m_coeffs << 1, 0, 0, 0; return *this; }
@@ -328,7 +328,7 @@ inline Quaternion<Scalar> Quaternion<Scalar>::inverse() const
else
{
// return an invalid result to flag the error
- return Quaternion(Coefficients::zero());
+ return Quaternion(Coefficients::Zero());
}
}
diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h
index 73e268e13..3da958aa7 100644
--- a/Eigen/src/Geometry/Transform.h
+++ b/Eigen/src/Geometry/Transform.h
@@ -240,7 +240,7 @@ template<typename OtherDerived>
Transform<Scalar,Dim>&
Transform<Scalar,Dim>::scale(const MatrixBase<OtherDerived> &other)
{
- EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,Dim);
+ EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim));
affine() = (affine() * other.asDiagonal()).lazy();
return *this;
}
@@ -254,7 +254,7 @@ template<typename OtherDerived>
Transform<Scalar,Dim>&
Transform<Scalar,Dim>::prescale(const MatrixBase<OtherDerived> &other)
{
- EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,Dim);
+ EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim));
m_matrix.template block<Dim,HDim>(0,0) = (other.asDiagonal() * m_matrix.template block<Dim,HDim>(0,0)).lazy();
return *this;
}
@@ -268,7 +268,7 @@ template<typename OtherDerived>
Transform<Scalar,Dim>&
Transform<Scalar,Dim>::translate(const MatrixBase<OtherDerived> &other)
{
- EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,Dim);
+ EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim));
translation() += affine() * other;
return *this;
}
@@ -282,7 +282,7 @@ template<typename OtherDerived>
Transform<Scalar,Dim>&
Transform<Scalar,Dim>::pretranslate(const MatrixBase<OtherDerived> &other)
{
- EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,Dim);
+ EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim));
translation() += other;
return *this;
}
diff --git a/Eigen/src/LU/Inverse.h b/Eigen/src/LU/Inverse.h
index d6b2d5eb6..cfe90161a 100644
--- a/Eigen/src/LU/Inverse.h
+++ b/Eigen/src/LU/Inverse.h
@@ -305,7 +305,7 @@ inline void MatrixBase<Derived>::computeInverse(typename ei_eval<Derived>::type
{
typedef typename ei_eval<Derived>::type MatrixType;
ei_assert(rows() == cols());
- ei_assert(NumTraits<Scalar>::HasFloatingPoint);
+ EIGEN_STATIC_ASSERT(NumTraits<Scalar>::HasFloatingPoint,scalar_type_must_be_floating_point);
ei_compute_inverse<MatrixType>::run(eval(), result);
}
diff --git a/Eigen/src/QR/HessenbergDecomposition.h b/Eigen/src/QR/HessenbergDecomposition.h
index 880997563..a3591d118 100755
--- a/Eigen/src/QR/HessenbergDecomposition.h
+++ b/Eigen/src/QR/HessenbergDecomposition.h
@@ -209,7 +209,7 @@ typename HessenbergDecomposition<MatrixType>::MatrixType
HessenbergDecomposition<MatrixType>::matrixQ(void) const
{
int n = m_matrix.rows();
- MatrixType matQ = MatrixType::identity(n,n);
+ MatrixType matQ = MatrixType::Identity(n,n);
for (int i = n-2; i>=0; i--)
{
Scalar tmp = m_matrix.coeff(i+1,i);
diff --git a/Eigen/src/QR/QR.h b/Eigen/src/QR/QR.h
index 704594320..d1fd2ae7a 100644
--- a/Eigen/src/QR/QR.h
+++ b/Eigen/src/QR/QR.h
@@ -57,11 +57,11 @@ template<typename MatrixType> class QR
bool isFullRank() const { return ei_isMuchSmallerThan(m_hCoeffs.cwise().abs().minCoeff(), Scalar(1)); }
/** \returns a read-only expression of the matrix R of the actual the QR decomposition */
- const Extract<NestByValue<MatrixRBlockType>, Upper>
+ const Part<NestByValue<MatrixRBlockType>, Upper>
matrixR(void) const
{
int cols = m_qr.cols();
- return MatrixRBlockType(m_qr, 0, 0, cols, cols).nestByValue().template extract<Upper>();
+ return MatrixRBlockType(m_qr, 0, 0, cols, cols).nestByValue().template part<Upper>();
}
MatrixType matrixQ(void) const;
@@ -144,7 +144,7 @@ MatrixType QR<MatrixType>::matrixQ(void) const
// and v_k is the k-th Householder vector [1,m_qr(k+1,k), m_qr(k+2,k), ...]
int rows = m_qr.rows();
int cols = m_qr.cols();
- MatrixType res = MatrixType::identity(rows, cols);
+ MatrixType res = MatrixType::Identity(rows, cols);
for (int k = cols-1; k >= 0; k--)
{
// to make easier the computation of the transformation, let's temporarily
diff --git a/Eigen/src/QR/SelfAdjointEigenSolver.h b/Eigen/src/QR/SelfAdjointEigenSolver.h
index c8386cdda..a54986ba5 100644
--- a/Eigen/src/QR/SelfAdjointEigenSolver.h
+++ b/Eigen/src/QR/SelfAdjointEigenSolver.h
@@ -79,6 +79,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
void compute(const MatrixType& matA, const MatrixType& matB, bool computeEigenvectors = true);
+ /** \returns the computed eigen vectors as a matrix of column vectors */
MatrixType eigenvectors(void) const
{
#ifndef NDEBUG
@@ -87,6 +88,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
return m_eivec;
}
+ /** \returns the computed eigen values */
RealVectorType eigenvalues(void) const { return m_eivalues; }
protected:
diff --git a/Eigen/src/QR/Tridiagonalization.h b/Eigen/src/QR/Tridiagonalization.h
index bcb4a2b59..78c6c2b1c 100755
--- a/Eigen/src/QR/Tridiagonalization.h
+++ b/Eigen/src/QR/Tridiagonalization.h
@@ -215,7 +215,7 @@ void Tridiagonalization<MatrixType>::_compute(MatrixType& matA, CoeffVectorType&
matA.col(i).coeffRef(i+1) = 1;
// let's use the end of hCoeffs to store temporary values
- hCoeffs.end(n-i-1) = h * (matA.corner(BottomRight,n-i-1,n-i-1).template extract<Lower|SelfAdjoint>()
+ hCoeffs.end(n-i-1) = h * (matA.corner(BottomRight,n-i-1,n-i-1).template part<Lower|SelfAdjoint>()
* matA.col(i).end(n-i-1));
@@ -261,7 +261,7 @@ typename Tridiagonalization<MatrixType>::MatrixType
Tridiagonalization<MatrixType>::matrixQ(void) const
{
int n = m_matrix.rows();
- MatrixType matQ = MatrixType::identity(n,n);
+ MatrixType matQ = MatrixType::Identity(n,n);
for (int i = n-2; i>=0; i--)
{
Scalar tmp = m_matrix.coeff(i+1,i);
diff --git a/doc/examples/class_Block.cpp b/doc/examples/class_Block.cpp
index 79cc314bf..03e5c28aa 100644
--- a/doc/examples/class_Block.cpp
+++ b/doc/examples/class_Block.cpp
@@ -18,7 +18,7 @@ topLeftCorner(const MatrixBase<Derived>& m, int rows, int cols)
int main(int, char**)
{
- Matrix4d m = Matrix4d::identity();
+ Matrix4d m = Matrix4d::Identity();
cout << topLeftCorner(4*m, 2, 3) << endl; // calls the const version
topLeftCorner(m, 2, 3) *= 5; // calls the non-const version
cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/examples/class_CwiseBinaryOp.cpp b/doc/examples/class_CwiseBinaryOp.cpp
index 7dc8ef762..fb9b2ff09 100644
--- a/doc/examples/class_CwiseBinaryOp.cpp
+++ b/doc/examples/class_CwiseBinaryOp.cpp
@@ -11,7 +11,7 @@ template<typename Scalar> struct MakeComplexOp EIGEN_EMPTY_STRUCT {
int main(int, char**)
{
- Matrix4d m1 = Matrix4d::random(), m2 = Matrix4d::random();
+ Matrix4d m1 = Matrix4d::Random(), m2 = Matrix4d::Random();
cout << m1.binaryExpr(m2, MakeComplexOp<double>()) << endl;
return 0;
}
diff --git a/doc/examples/class_CwiseUnaryOp.cpp b/doc/examples/class_CwiseUnaryOp.cpp
index c4d8fd4ce..3b94a17b4 100644
--- a/doc/examples/class_CwiseUnaryOp.cpp
+++ b/doc/examples/class_CwiseUnaryOp.cpp
@@ -13,7 +13,7 @@ struct CwiseClampOp {
int main(int, char**)
{
- Matrix4d m1 = Matrix4d::random();
+ Matrix4d m1 = Matrix4d::Random();
cout << m1 << endl << "becomes: " << endl << m1.unaryExpr(CwiseClampOp<double>(-0.5,0.5)) << endl;
return 0;
}
diff --git a/doc/examples/class_FixedBlock.cpp b/doc/examples/class_FixedBlock.cpp
index e3e9532bc..2e0f285ad 100644
--- a/doc/examples/class_FixedBlock.cpp
+++ b/doc/examples/class_FixedBlock.cpp
@@ -18,7 +18,7 @@ topLeft2x2Corner(const MatrixBase<Derived>& m)
int main(int, char**)
{
- Matrix3d m = Matrix3d::identity();
+ Matrix3d m = Matrix3d::Identity();
cout << topLeft2x2Corner(4*m) << endl; // calls the const version
topLeft2x2Corner(m) *= 2; // calls the non-const version
cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/Cholesky_solve.cpp b/doc/snippets/Cholesky_solve.cpp
index 4f9ac9c1e..ac743cb55 100644
--- a/doc/snippets/Cholesky_solve.cpp
+++ b/doc/snippets/Cholesky_solve.cpp
@@ -1,6 +1,6 @@
typedef Matrix<float,Dynamic,2> DataMatrix;
// let's generate some samples on the 3D plane of equation z = 2x+3y (with some noise)
-DataMatrix samples = DataMatrix::random(12,2);
-VectorXf elevations = 2*samples.col(0) + 3*samples.col(1) + VectorXf::random(12)*0.1;
+DataMatrix samples = DataMatrix::Random(12,2);
+VectorXf elevations = 2*samples.col(0) + 3*samples.col(1) + VectorXf::Random(12)*0.1;
// and let's solve samples * x = elevations in least square sense:
cout << (samples.adjoint() * samples).cholesky().solve((samples.adjoint()*elevations).eval()) << endl;
diff --git a/doc/snippets/MatrixBase_adjoint.cpp b/doc/snippets/MatrixBase_adjoint.cpp
index 661803ca1..4680d5938 100644
--- a/doc/snippets/MatrixBase_adjoint.cpp
+++ b/doc/snippets/MatrixBase_adjoint.cpp
@@ -1,3 +1,3 @@
-Matrix2cf m = Matrix2cf::random();
+Matrix2cf m = Matrix2cf::Random();
cout << "Here is the 2x2 complex matrix m:" << endl << m << endl;
cout << "Here is the adjoint of m:" << endl << m.adjoint() << endl;
diff --git a/doc/snippets/MatrixBase_block_int_int.cpp b/doc/snippets/MatrixBase_block_int_int.cpp
index 810ea5eb5..974f86b54 100644
--- a/doc/snippets/MatrixBase_block_int_int.cpp
+++ b/doc/snippets/MatrixBase_block_int_int.cpp
@@ -1,4 +1,4 @@
-RowVector4i v = RowVector4i::random();
+RowVector4i v = RowVector4i::Random();
cout << "Here is the vector v:" << endl << v << endl;
cout << "Here is v.block(1, 2):" << endl << v.block(1, 2) << endl;
v.block(1, 2).setZero();
diff --git a/doc/snippets/MatrixBase_block_int_int_int_int.cpp b/doc/snippets/MatrixBase_block_int_int_int_int.cpp
index 1aeadfb18..7238cbbed 100644
--- a/doc/snippets/MatrixBase_block_int_int_int_int.cpp
+++ b/doc/snippets/MatrixBase_block_int_int_int_int.cpp
@@ -1,4 +1,4 @@
-Matrix4i m = Matrix4i::random();
+Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.block(1, 1, 2, 2):" << endl << m.block(1, 1, 2, 2) << endl;
m.block(1, 1, 2, 2).setZero();
diff --git a/doc/snippets/MatrixBase_cast.cpp b/doc/snippets/MatrixBase_cast.cpp
index f59b97df6..016880b40 100644
--- a/doc/snippets/MatrixBase_cast.cpp
+++ b/doc/snippets/MatrixBase_cast.cpp
@@ -1,3 +1,3 @@
-Matrix2d md = Matrix2d::identity() * 0.45;
-Matrix2f mf = Matrix2f::identity();
+Matrix2d md = Matrix2d::Identity() * 0.45;
+Matrix2f mf = Matrix2f::Identity();
cout << md + mf.cast<double>() << endl;
diff --git a/doc/snippets/MatrixBase_col.cpp b/doc/snippets/MatrixBase_col.cpp
index ae287db32..87c91b129 100644
--- a/doc/snippets/MatrixBase_col.cpp
+++ b/doc/snippets/MatrixBase_col.cpp
@@ -1,3 +1,3 @@
-Matrix3d m = Matrix3d::identity();
+Matrix3d m = Matrix3d::Identity();
m.col(1) = Vector3d(4,5,6);
cout << m << endl;
diff --git a/doc/snippets/MatrixBase_computeInverse.cpp b/doc/snippets/MatrixBase_computeInverse.cpp
index 4873d0d34..ba7377a4a 100644
--- a/doc/snippets/MatrixBase_computeInverse.cpp
+++ b/doc/snippets/MatrixBase_computeInverse.cpp
@@ -1,4 +1,4 @@
-Matrix3d m = Matrix3d::random();
+Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
Matrix3d inv;
m.computeInverse(&inv);
diff --git a/doc/snippets/MatrixBase_corner_enum_int_int.cpp b/doc/snippets/MatrixBase_corner_enum_int_int.cpp
index a332bda91..fd6c950cc 100644
--- a/doc/snippets/MatrixBase_corner_enum_int_int.cpp
+++ b/doc/snippets/MatrixBase_corner_enum_int_int.cpp
@@ -1,4 +1,4 @@
-Matrix4i m = Matrix4i::random();
+Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the bottom-right 2x3 corner in m:" << endl
<< m.corner(Eigen::BottomRight, 2, 3) << endl;
diff --git a/doc/snippets/MatrixBase_diagonal.cpp b/doc/snippets/MatrixBase_diagonal.cpp
index 005fba7b6..cd63413f3 100644
--- a/doc/snippets/MatrixBase_diagonal.cpp
+++ b/doc/snippets/MatrixBase_diagonal.cpp
@@ -1,4 +1,4 @@
-Matrix3i m = Matrix3i::random();
+Matrix3i m = Matrix3i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here are the coefficients on the main diagonal of m:" << endl
<< m.diagonal() << endl;
diff --git a/doc/snippets/MatrixBase_end_int.cpp b/doc/snippets/MatrixBase_end_int.cpp
index 12b5f19f2..aaa54b668 100644
--- a/doc/snippets/MatrixBase_end_int.cpp
+++ b/doc/snippets/MatrixBase_end_int.cpp
@@ -1,4 +1,4 @@
-RowVector4i v = RowVector4i::random();
+RowVector4i v = RowVector4i::Random();
cout << "Here is the vector v:" << endl << v << endl;
cout << "Here is v.end(2):" << endl << v.end(2) << endl;
v.end(2).setZero();
diff --git a/doc/snippets/MatrixBase_eval.cpp b/doc/snippets/MatrixBase_eval.cpp
index 376957359..732293043 100644
--- a/doc/snippets/MatrixBase_eval.cpp
+++ b/doc/snippets/MatrixBase_eval.cpp
@@ -1,4 +1,4 @@
-Matrix2f M = Matrix2f::random();
+Matrix2f M = Matrix2f::Random();
Matrix2f m;
m = M;
cout << "Here is the matrix m:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_extract.cpp b/doc/snippets/MatrixBase_extract.cpp
index 0996ad654..bedf4dfbd 100644
--- a/doc/snippets/MatrixBase_extract.cpp
+++ b/doc/snippets/MatrixBase_extract.cpp
@@ -1,8 +1,8 @@
-Matrix3i m = Matrix3i::random();
+Matrix3i m = Matrix3i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the upper-triangular matrix extracted from m:" << endl
- << m.extract<Eigen::Upper>() << endl;
+ << m.part<Eigen::Upper>() << endl;
cout << "Here is the strictly-upper-triangular matrix extracted from m:" << endl
- << m.extract<Eigen::StrictlyUpper>() << endl;
+ << m.part<Eigen::StrictlyUpper>() << endl;
cout << "Here is the unit-lower-triangular matrix extracted from m:" << endl
- << m.extract<Eigen::UnitLower>() << endl;
+ << m.part<Eigen::UnitLower>() << endl;
diff --git a/doc/snippets/MatrixBase_identity.cpp b/doc/snippets/MatrixBase_identity.cpp
index cac2a7205..b5c1e59c9 100644
--- a/doc/snippets/MatrixBase_identity.cpp
+++ b/doc/snippets/MatrixBase_identity.cpp
@@ -1 +1 @@
-cout << Matrix<double, 3, 4>::identity() << endl;
+cout << Matrix<double, 3, 4>::Identity() << endl;
diff --git a/doc/snippets/MatrixBase_identity_int_int.cpp b/doc/snippets/MatrixBase_identity_int_int.cpp
index 5b2adfc20..918649d64 100644
--- a/doc/snippets/MatrixBase_identity_int_int.cpp
+++ b/doc/snippets/MatrixBase_identity_int_int.cpp
@@ -1 +1 @@
-cout << MatrixXd::identity(4, 3) << endl;
+cout << MatrixXd::Identity(4, 3) << endl;
diff --git a/doc/snippets/MatrixBase_inverse.cpp b/doc/snippets/MatrixBase_inverse.cpp
index b5c645cba..a56142ee0 100644
--- a/doc/snippets/MatrixBase_inverse.cpp
+++ b/doc/snippets/MatrixBase_inverse.cpp
@@ -1,3 +1,3 @@
-Matrix3d m = Matrix3d::random();
+Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Its inverse is:" << endl << m.inverse() << endl;
diff --git a/doc/snippets/MatrixBase_isDiagonal.cpp b/doc/snippets/MatrixBase_isDiagonal.cpp
index 5c2f7d4d2..5b1d59977 100644
--- a/doc/snippets/MatrixBase_isDiagonal.cpp
+++ b/doc/snippets/MatrixBase_isDiagonal.cpp
@@ -1,4 +1,4 @@
-Matrix3d m = 10000 * Matrix3d::identity();
+Matrix3d m = 10000 * Matrix3d::Identity();
m(0,2) = 1;
cout << "Here's the matrix m:" << endl << m << endl;
cout << "m.isDiagonal() returns: " << m.isDiagonal() << endl;
diff --git a/doc/snippets/MatrixBase_isIdentity.cpp b/doc/snippets/MatrixBase_isIdentity.cpp
index 19d0156eb..17b756c97 100644
--- a/doc/snippets/MatrixBase_isIdentity.cpp
+++ b/doc/snippets/MatrixBase_isIdentity.cpp
@@ -1,4 +1,4 @@
-Matrix3d m = Matrix3d::identity();
+Matrix3d m = Matrix3d::Identity();
m(0,2) = 1e-4;
cout << "Here's the matrix m:" << endl << m << endl;
cout << "m.isIdentity() returns: " << m.isIdentity() << endl;
diff --git a/doc/snippets/MatrixBase_isOnes.cpp b/doc/snippets/MatrixBase_isOnes.cpp
index 3cd82ab7b..f82f62809 100644
--- a/doc/snippets/MatrixBase_isOnes.cpp
+++ b/doc/snippets/MatrixBase_isOnes.cpp
@@ -1,4 +1,4 @@
-Matrix3d m = Matrix3d::ones();
+Matrix3d m = Matrix3d::Ones();
m(0,2) += 1e-4;
cout << "Here's the matrix m:" << endl << m << endl;
cout << "m.isOnes() returns: " << m.isOnes() << endl;
diff --git a/doc/snippets/MatrixBase_isUnitary.cpp b/doc/snippets/MatrixBase_isUnitary.cpp
index d29aa5f71..3877da347 100644
--- a/doc/snippets/MatrixBase_isUnitary.cpp
+++ b/doc/snippets/MatrixBase_isUnitary.cpp
@@ -1,4 +1,4 @@
-Matrix3d m = Matrix3d::identity();
+Matrix3d m = Matrix3d::Identity();
m(0,2) = 1e-4;
cout << "Here's the matrix m:" << endl << m << endl;
cout << "m.isUnitary() returns: " << m.isUnitary() << endl;
diff --git a/doc/snippets/MatrixBase_isZero.cpp b/doc/snippets/MatrixBase_isZero.cpp
index efab3d624..c2cfe2201 100644
--- a/doc/snippets/MatrixBase_isZero.cpp
+++ b/doc/snippets/MatrixBase_isZero.cpp
@@ -1,4 +1,4 @@
-Matrix3d m = Matrix3d::zero();
+Matrix3d m = Matrix3d::Zero();
m(0,2) = 1e-4;
cout << "Here's the matrix m:" << endl << m << endl;
cout << "m.isZero() returns: " << m.isZero() << endl;
diff --git a/doc/snippets/MatrixBase_marked.cpp b/doc/snippets/MatrixBase_marked.cpp
index 5c08cd9ca..f367def43 100644
--- a/doc/snippets/MatrixBase_marked.cpp
+++ b/doc/snippets/MatrixBase_marked.cpp
@@ -1,7 +1,7 @@
-Matrix3d m = Matrix3d::zero();
+Matrix3d m = Matrix3d::Zero();
m.part<Eigen::Upper>().setOnes();
cout << "Here is the matrix m:" << endl << m << endl;
-Matrix3d n = Matrix3d::ones();
+Matrix3d n = Matrix3d::Ones();
n.part<Eigen::Lower>() *= 2;
cout << "Here is the matrix n:" << endl << n << endl;
cout << "And now here is m.inverse()*n, taking advantage of the fact that"
diff --git a/doc/snippets/MatrixBase_minor.cpp b/doc/snippets/MatrixBase_minor.cpp
index 5f9dc5c96..2915d7eed 100644
--- a/doc/snippets/MatrixBase_minor.cpp
+++ b/doc/snippets/MatrixBase_minor.cpp
@@ -1,3 +1,3 @@
-Matrix3i m = Matrix3i::random();
+Matrix3i m = Matrix3i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.minor(1,1):" << endl << m.minor(1,1) << endl;
diff --git a/doc/snippets/MatrixBase_ones.cpp b/doc/snippets/MatrixBase_ones.cpp
index 2434f518a..02c767c95 100644
--- a/doc/snippets/MatrixBase_ones.cpp
+++ b/doc/snippets/MatrixBase_ones.cpp
@@ -1,2 +1,2 @@
-cout << Matrix2d::ones() << endl;
-cout << 6 * RowVector4i::ones() << endl;
+cout << Matrix2d::Ones() << endl;
+cout << 6 * RowVector4i::Ones() << endl;
diff --git a/doc/snippets/MatrixBase_ones_int.cpp b/doc/snippets/MatrixBase_ones_int.cpp
index 0610bc2f2..2ef188e7d 100644
--- a/doc/snippets/MatrixBase_ones_int.cpp
+++ b/doc/snippets/MatrixBase_ones_int.cpp
@@ -1,2 +1,2 @@
-cout << 6 * RowVectorXi::ones(4) << endl;
-cout << VectorXf::ones(2) << endl;
+cout << 6 * RowVectorXi::Ones(4) << endl;
+cout << VectorXf::Ones(2) << endl;
diff --git a/doc/snippets/MatrixBase_ones_int_int.cpp b/doc/snippets/MatrixBase_ones_int_int.cpp
index faecee1af..60f5a31eb 100644
--- a/doc/snippets/MatrixBase_ones_int_int.cpp
+++ b/doc/snippets/MatrixBase_ones_int_int.cpp
@@ -1 +1 @@
-cout << MatrixXi::ones(2,3) << endl;
+cout << MatrixXi::Ones(2,3) << endl;
diff --git a/doc/snippets/MatrixBase_part.cpp b/doc/snippets/MatrixBase_part.cpp
index 29b9577b1..fbc55b1ca 100644
--- a/doc/snippets/MatrixBase_part.cpp
+++ b/doc/snippets/MatrixBase_part.cpp
@@ -1,4 +1,4 @@
-Matrix3d m = Matrix3i::zero();
+Matrix3d m = Matrix3i::Zero();
m.part<Eigen::StrictlyUpper>().setOnes();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "And let us now compute m*m.adjoint() in a very optimized way" << endl
diff --git a/doc/snippets/MatrixBase_random.cpp b/doc/snippets/MatrixBase_random.cpp
index 09b5fb2db..65fc524f1 100644
--- a/doc/snippets/MatrixBase_random.cpp
+++ b/doc/snippets/MatrixBase_random.cpp
@@ -1 +1 @@
-cout << 100 * Matrix2i::random() << endl;
+cout << 100 * Matrix2i::Random() << endl;
diff --git a/doc/snippets/MatrixBase_random_int.cpp b/doc/snippets/MatrixBase_random_int.cpp
index a1f609ce0..f161d03c2 100644
--- a/doc/snippets/MatrixBase_random_int.cpp
+++ b/doc/snippets/MatrixBase_random_int.cpp
@@ -1 +1 @@
-cout << VectorXi::random(2) << endl;
+cout << VectorXi::Random(2) << endl;
diff --git a/doc/snippets/MatrixBase_random_int_int.cpp b/doc/snippets/MatrixBase_random_int_int.cpp
index 235dd4721..3f0f7dd5d 100644
--- a/doc/snippets/MatrixBase_random_int_int.cpp
+++ b/doc/snippets/MatrixBase_random_int_int.cpp
@@ -1 +1 @@
-cout << MatrixXi::random(2,3) << endl;
+cout << MatrixXi::Random(2,3) << endl;
diff --git a/doc/snippets/MatrixBase_row.cpp b/doc/snippets/MatrixBase_row.cpp
index 3f1d73b9e..b15e6260c 100644
--- a/doc/snippets/MatrixBase_row.cpp
+++ b/doc/snippets/MatrixBase_row.cpp
@@ -1,3 +1,3 @@
-Matrix3d m = Matrix3d::identity();
+Matrix3d m = Matrix3d::Identity();
m.row(1) = Vector3d(4,5,6);
cout << m << endl;
diff --git a/doc/snippets/MatrixBase_set.cpp b/doc/snippets/MatrixBase_set.cpp
index f6ccb1099..9487008db 100644
--- a/doc/snippets/MatrixBase_set.cpp
+++ b/doc/snippets/MatrixBase_set.cpp
@@ -3,7 +3,7 @@ m1 << 1, 2, 3,
4, 5, 6,
7, 8, 9;
cout << m1 << endl << endl;
-Matrix3i m2 = Matrix3i::identity();
+Matrix3i m2 = Matrix3i::Identity();
m2.block(0,0, 2,2) << 10, 11, 12, 13;
cout << m2 << endl << endl;
Vector2i v1;
diff --git a/doc/snippets/MatrixBase_setIdentity.cpp b/doc/snippets/MatrixBase_setIdentity.cpp
index 17a706ca2..4fd0aa24a 100644
--- a/doc/snippets/MatrixBase_setIdentity.cpp
+++ b/doc/snippets/MatrixBase_setIdentity.cpp
@@ -1,3 +1,3 @@
-Matrix4i m = Matrix4i::zero();
+Matrix4i m = Matrix4i::Zero();
m.block<3,3>(1,0).setIdentity();
cout << m << endl;
diff --git a/doc/snippets/MatrixBase_setOnes.cpp b/doc/snippets/MatrixBase_setOnes.cpp
index c4d0ac1de..4cef9c1eb 100644
--- a/doc/snippets/MatrixBase_setOnes.cpp
+++ b/doc/snippets/MatrixBase_setOnes.cpp
@@ -1,3 +1,3 @@
-Matrix4i m = Matrix4i::random();
+Matrix4i m = Matrix4i::Random();
m.row(1).setOnes();
cout << m << endl;
diff --git a/doc/snippets/MatrixBase_setRandom.cpp b/doc/snippets/MatrixBase_setRandom.cpp
index 242306ee3..e2c257d44 100644
--- a/doc/snippets/MatrixBase_setRandom.cpp
+++ b/doc/snippets/MatrixBase_setRandom.cpp
@@ -1,3 +1,3 @@
-Matrix4i m = Matrix4i::zero();
+Matrix4i m = Matrix4i::Zero();
m.col(1).setRandom();
cout << m << endl;
diff --git a/doc/snippets/MatrixBase_setZero.cpp b/doc/snippets/MatrixBase_setZero.cpp
index 22575494d..9b5b9583c 100644
--- a/doc/snippets/MatrixBase_setZero.cpp
+++ b/doc/snippets/MatrixBase_setZero.cpp
@@ -1,3 +1,3 @@
-Matrix4i m = Matrix4i::random();
+Matrix4i m = Matrix4i::Random();
m.row(1).setZero();
cout << m << endl;
diff --git a/doc/snippets/MatrixBase_start_int.cpp b/doc/snippets/MatrixBase_start_int.cpp
index cee28f329..eb43a5dc7 100644
--- a/doc/snippets/MatrixBase_start_int.cpp
+++ b/doc/snippets/MatrixBase_start_int.cpp
@@ -1,4 +1,4 @@
-RowVector4i v = RowVector4i::random();
+RowVector4i v = RowVector4i::Random();
cout << "Here is the vector v:" << endl << v << endl;
cout << "Here is v.start(2):" << endl << v.start(2) << endl;
v.start(2).setZero();
diff --git a/doc/snippets/MatrixBase_template_int_end.cpp b/doc/snippets/MatrixBase_template_int_end.cpp
index eb6990167..0908c0305 100644
--- a/doc/snippets/MatrixBase_template_int_end.cpp
+++ b/doc/snippets/MatrixBase_template_int_end.cpp
@@ -1,4 +1,4 @@
-RowVector4i v = RowVector4i::random();
+RowVector4i v = RowVector4i::Random();
cout << "Here is the vector v:" << endl << v << endl;
cout << "Here is v.end(2):" << endl << v.end<2>() << endl;
v.end<2>().setZero();
diff --git a/doc/snippets/MatrixBase_template_int_int_corner_enum.cpp b/doc/snippets/MatrixBase_template_int_int_corner_enum.cpp
index fb64406e4..05ed0ad2f 100644
--- a/doc/snippets/MatrixBase_template_int_int_corner_enum.cpp
+++ b/doc/snippets/MatrixBase_template_int_int_corner_enum.cpp
@@ -1,4 +1,4 @@
-Matrix4i m = Matrix4i::random();
+Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the bottom-right 2x3 corner in m:" << endl
<< m.corner<2,3>(Eigen::BottomRight) << endl;
diff --git a/doc/snippets/MatrixBase_template_int_start.cpp b/doc/snippets/MatrixBase_template_int_start.cpp
index 0cd424a94..231fc3299 100644
--- a/doc/snippets/MatrixBase_template_int_start.cpp
+++ b/doc/snippets/MatrixBase_template_int_start.cpp
@@ -1,4 +1,4 @@
-RowVector4i v = RowVector4i::random();
+RowVector4i v = RowVector4i::Random();
cout << "Here is the vector v:" << endl << v << endl;
cout << "Here is v.start(2):" << endl << v.start<2>() << endl;
v.start<2>().setZero();
diff --git a/doc/snippets/MatrixBase_transpose.cpp b/doc/snippets/MatrixBase_transpose.cpp
index 342d14a81..88eea83c4 100644
--- a/doc/snippets/MatrixBase_transpose.cpp
+++ b/doc/snippets/MatrixBase_transpose.cpp
@@ -1,4 +1,4 @@
-Matrix2i m = Matrix2i::random();
+Matrix2i m = Matrix2i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the transpose of m:" << endl << m.transpose() << endl;
cout << "Here is the coefficient (1,0) in the transpose of m:" << endl
diff --git a/doc/snippets/MatrixBase_zero.cpp b/doc/snippets/MatrixBase_zero.cpp
index 8b4af04a9..606493677 100644
--- a/doc/snippets/MatrixBase_zero.cpp
+++ b/doc/snippets/MatrixBase_zero.cpp
@@ -1,2 +1,2 @@
-cout << Matrix2d::zero() << endl;
-cout << RowVector4i::zero() << endl;
+cout << Matrix2d::Zero() << endl;
+cout << RowVector4i::Zero() << endl;
diff --git a/doc/snippets/MatrixBase_zero_int.cpp b/doc/snippets/MatrixBase_zero_int.cpp
index 4ef99edeb..370a9ba0a 100644
--- a/doc/snippets/MatrixBase_zero_int.cpp
+++ b/doc/snippets/MatrixBase_zero_int.cpp
@@ -1,2 +1,2 @@
-cout << RowVectorXi::zero(4) << endl;
-cout << VectorXf::zero(2) << endl;
+cout << RowVectorXi::Zero(4) << endl;
+cout << VectorXf::Zero(2) << endl;
diff --git a/doc/snippets/MatrixBase_zero_int_int.cpp b/doc/snippets/MatrixBase_zero_int_int.cpp
index b108c763b..4099c5d4d 100644
--- a/doc/snippets/MatrixBase_zero_int_int.cpp
+++ b/doc/snippets/MatrixBase_zero_int_int.cpp
@@ -1 +1 @@
-cout << MatrixXi::zero(2,3) << endl;
+cout << MatrixXi::Zero(2,3) << endl;
diff --git a/test/adjoint.cpp b/test/adjoint.cpp
index cfcf1f0a5..835af5e64 100644
--- a/test/adjoint.cpp
+++ b/test/adjoint.cpp
@@ -35,18 +35,18 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
int rows = m.rows();
int cols = m.cols();
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
- mzero = MatrixType::zero(rows, cols),
+ mzero = MatrixType::Zero(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
- ::identity(rows, rows),
+ ::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);
+ ::Random(rows, rows);
+ VectorType v1 = VectorType::Random(rows),
+ v2 = VectorType::Random(rows),
+ v3 = VectorType::Random(rows),
+ vzero = VectorType::Zero(rows);
Scalar s1 = ei_random<Scalar>(),
s2 = ei_random<Scalar>();
diff --git a/test/array.cpp b/test/array.cpp
index 3acb4ab55..eb78322c2 100644
--- a/test/array.cpp
+++ b/test/array.cpp
@@ -37,16 +37,16 @@ template<typename MatrixType> void scalarAdd(const MatrixType& m)
int rows = m.rows();
int cols = m.cols();
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols);
Scalar s1 = ei_random<Scalar>(),
s2 = ei_random<Scalar>();
VERIFY_IS_APPROX(m1.cwise() + s1, s1 + m1.cwise());
- VERIFY_IS_APPROX(m1.cwise() + s1, MatrixType::constant(rows,cols,s1) + m1);
- VERIFY_IS_APPROX((m1*Scalar(2)).cwise() - s2, (m1+m1) - MatrixType::constant(rows,cols,s2) );
+ VERIFY_IS_APPROX(m1.cwise() + s1, MatrixType::Constant(rows,cols,s1) + m1);
+ VERIFY_IS_APPROX((m1*Scalar(2)).cwise() - s2, (m1+m1) - MatrixType::Constant(rows,cols,s2) );
m3 = m1;
m3.cwise() += s2;
VERIFY_IS_APPROX(m3, m1.cwise() + s2);
@@ -71,8 +71,8 @@ template<typename MatrixType> void comparisons(const MatrixType& m)
int r = ei_random<int>(0, rows-1),
c = ei_random<int>(0, cols-1);
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols);
VERIFY(((m1.cwise() + Scalar(1)).cwise() > m1).all());
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp
index 4e3db3c1b..9da5167e6 100644
--- a/test/basicstuff.cpp
+++ b/test/basicstuff.cpp
@@ -34,17 +34,17 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
// this test relies a lot on Random.h, and there's not much more that we can do
// to test it, hence I consider that we will have tested Random.h
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
- mzero = MatrixType::zero(rows, cols),
+ mzero = MatrixType::Zero(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
- ::identity(rows, rows),
+ ::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);
+ ::Random(rows, rows);
+ VectorType v1 = VectorType::Random(rows),
+ v2 = VectorType::Random(rows),
+ vzero = VectorType::Zero(rows);
int r = ei_random<int>(0, rows-1),
c = ei_random<int>(0, cols-1);
@@ -68,7 +68,7 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
// hence has no _write() method, the corresponding MatrixBase method (here zero())
// should return a const-qualified object so that it is the const-qualified
// operator() that gets called, which in turn calls _read().
- VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::zero(rows,cols)(r,c), static_cast<Scalar>(1));
+ VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::Zero(rows,cols)(r,c), static_cast<Scalar>(1));
// now test copying a row-vector into a (column-)vector and conversely.
square.col(r) = square.row(r).eval();
diff --git a/test/cholesky.cpp b/test/cholesky.cpp
index 4c02b4124..eab1febf2 100644
--- a/test/cholesky.cpp
+++ b/test/cholesky.cpp
@@ -38,8 +38,8 @@ template<typename MatrixType> void cholesky(const MatrixType& m)
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
- MatrixType a = MatrixType::random(rows,cols);
- VectorType b = VectorType::random(rows);
+ MatrixType a = MatrixType::Random(rows,cols);
+ VectorType b = VectorType::Random(rows);
SquareMatrixType covMat = a * a.adjoint();
CholeskyWithoutSquareRoot<SquareMatrixType> cholnosqrt(covMat);
diff --git a/test/commainitializer.cpp b/test/commainitializer.cpp
index acd1fb630..fa3e3e348 100644
--- a/test/commainitializer.cpp
+++ b/test/commainitializer.cpp
@@ -35,7 +35,7 @@ void test_commainitializer()
double data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
- m3 = Matrix3d::random();
+ m3 = Matrix3d::Random();
m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9;
VERIFY_IS_APPROX(m3, (Matrix<double,3,3,RowMajorBit>::map(data)) );
@@ -43,14 +43,14 @@ void test_commainitializer()
vec[0] << 1, 4, 7;
vec[1] << 2, 5, 8;
vec[2] << 3, 6, 9;
- m3 = Matrix3d::random();
+ m3 = Matrix3d::Random();
m3 << vec[0], vec[1], vec[2];
VERIFY_IS_APPROX(m3, (Matrix<double,3,3,RowMajorBit>::map(data)) );
vec[0] << 1, 2, 3;
vec[1] << 4, 5, 6;
vec[2] << 7, 8, 9;
- m3 = Matrix3d::random();
+ m3 = Matrix3d::Random();
m3 << vec[0].transpose(),
4, 5, 6,
vec[2].transpose();
diff --git a/test/cwiseop.cpp b/test/cwiseop.cpp
index 9278dd08d..6e94d4b29 100644
--- a/test/cwiseop.cpp
+++ b/test/cwiseop.cpp
@@ -42,18 +42,18 @@ template<typename MatrixType> void cwiseops(const MatrixType& m)
int rows = m.rows();
int cols = m.cols();
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
- mzero = MatrixType::zero(rows, cols),
- mones = MatrixType::ones(rows, cols),
+ mzero = MatrixType::Zero(rows, cols),
+ mones = MatrixType::Ones(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
- ::identity(rows, rows),
+ ::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);
+ ::Random(rows, rows);
+ VectorType v1 = VectorType::Random(rows),
+ v2 = VectorType::Random(rows),
+ vzero = VectorType::Zero(rows);
m2 = m2.template binaryExpr<AddIfNull<Scalar> >(mones);
diff --git a/test/eigensolver.cpp b/test/eigensolver.cpp
index 89cbfe8fc..9837162f6 100644
--- a/test/eigensolver.cpp
+++ b/test/eigensolver.cpp
@@ -35,14 +35,14 @@ template<typename MatrixType> void eigensolver(const MatrixType& m)
typedef typename std::complex<typename NumTraits<typename MatrixType::Scalar>::Real> Complex;
- MatrixType a = MatrixType::random(rows,cols);
+ MatrixType a = MatrixType::Random(rows,cols);
MatrixType symmA = a.adjoint() * a;
SelfAdjointEigenSolver<MatrixType> eiSymm(symmA);
VERIFY_IS_APPROX(symmA * eiSymm.eigenvectors(), (eiSymm.eigenvectors() * eiSymm.eigenvalues().asDiagonal().eval()));
// generalized eigen problem Ax = lBx
- MatrixType b = MatrixType::random(rows,cols);
+ MatrixType b = MatrixType::Random(rows,cols);
MatrixType symmB = b.adjoint() * b;
eiSymm.compute(symmA,symmB);
VERIFY_IS_APPROX(symmA * eiSymm.eigenvectors(), symmB * (eiSymm.eigenvectors() * eiSymm.eigenvalues().asDiagonal().eval()));
diff --git a/test/geometry.cpp b/test/geometry.cpp
index 395d1c2c8..053a3b87a 100644
--- a/test/geometry.cpp
+++ b/test/geometry.cpp
@@ -42,9 +42,9 @@ template<typename Scalar> void geometry(void)
typedef AngleAxis<Scalar> AngleAxis;
Quaternion q1, q2;
- Vector3 v0 = Vector3::random(),
- v1 = Vector3::random(),
- v2 = Vector3::random();
+ Vector3 v0 = Vector3::Random(),
+ v1 = Vector3::Random(),
+ v2 = Vector3::Random();
Matrix3 matrot1;
Scalar a = ei_random<Scalar>(-M_PI, M_PI);
@@ -116,7 +116,7 @@ template<typename Scalar> void geometry(void)
t1.setIdentity();
t1.affine() = q1.toRotationMatrix();
- v0 << 50, 2, 1;//= Vector3::random().cwiseProduct(Vector3(10,2,0.5));
+ v0 << 50, 2, 1;//= Vector3::Random().cwiseProduct(Vector3(10,2,0.5));
t0.scale(v0);
t1.prescale(v0);
@@ -140,8 +140,8 @@ template<typename Scalar> void geometry(void)
// 2D transformation
Transform2 t20, t21;
- Vector2 v20 = Vector2::random();
- Vector2 v21 = Vector2::random();
+ Vector2 v20 = Vector2::Random();
+ Vector2 v21 = Vector2::Random();
t21.setIdentity();
t21.affine() = Rotation2D<Scalar>(a).toRotationMatrix();
VERIFY_IS_APPROX(t20.fromPositionOrientationScale(v20,a,v21).matrix(),
diff --git a/test/inverse.cpp b/test/inverse.cpp
index 0324cd1ea..5614c987d 100644
--- a/test/inverse.cpp
+++ b/test/inverse.cpp
@@ -36,10 +36,10 @@ template<typename MatrixType> void inverse(const MatrixType& m)
typedef typename MatrixType::Scalar Scalar;
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, 1> VectorType;
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
- mzero = MatrixType::zero(rows, cols),
- identity = MatrixType::identity(rows, rows);
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
+ mzero = MatrixType::Zero(rows, cols),
+ identity = MatrixType::Identity(rows, rows);
m2 = m1.inverse();
VERIFY_IS_APPROX(m1, m2.inverse() );
diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp
index 8096d2f3e..8e20b450d 100644
--- a/test/linearstructure.cpp
+++ b/test/linearstructure.cpp
@@ -38,17 +38,17 @@ template<typename MatrixType> void linearStructure(const MatrixType& m)
// this test relies a lot on Random.h, and there's not much more that we can do
// to test it, hence I consider that we will have tested Random.h
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
- mzero = MatrixType::zero(rows, cols),
+ mzero = MatrixType::Zero(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
- ::identity(rows, rows),
+ ::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);
+ ::Random(rows, rows);
+ VectorType v1 = VectorType::Random(rows),
+ v2 = VectorType::Random(rows),
+ vzero = VectorType::Zero(rows);
Scalar s1 = ei_random<Scalar>();
diff --git a/test/map.cpp b/test/map.cpp
index 39e40af15..e7c1cf03d 100644
--- a/test/map.cpp
+++ b/test/map.cpp
@@ -33,7 +33,7 @@ template<typename VectorType> void tmap(const VectorType& m)
// test Map.h
Scalar* array1 = ei_aligned_malloc<Scalar>(size);
Scalar* array2 = ei_aligned_malloc<Scalar>(size);
- Map<VectorType, Aligned>(array1, size) = VectorType::random(size);
+ Map<VectorType, Aligned>(array1, size) = VectorType::Random(size);
Map<VectorType>(array2, size) = Map<VectorType>(array1, size);
VectorType ma1 = Map<VectorType>(array1, size);
VectorType ma2 = Map<VectorType, Aligned>(array2, size);
diff --git a/test/miscmatrices.cpp b/test/miscmatrices.cpp
index aed7f36f1..5f1e77c8f 100644
--- a/test/miscmatrices.cpp
+++ b/test/miscmatrices.cpp
@@ -37,18 +37,18 @@ template<typename MatrixType> void miscMatrices(const MatrixType& m)
int cols = m.cols();
int r = ei_random<int>(0, rows-1), r2 = ei_random<int>(0, rows-1), c = ei_random<int>(0, cols-1);
- VERIFY_IS_APPROX(MatrixType::ones(rows,cols)(r,c), static_cast<Scalar>(1));
- MatrixType m1 = MatrixType::ones(rows,cols);
+ VERIFY_IS_APPROX(MatrixType::Ones(rows,cols)(r,c), static_cast<Scalar>(1));
+ MatrixType m1 = MatrixType::Ones(rows,cols);
VERIFY_IS_APPROX(m1(r,c), static_cast<Scalar>(1));
- VectorType v1 = VectorType::random(rows);
+ VectorType v1 = VectorType::Random(rows);
v1[0];
Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
square = v1.asDiagonal();
if(r==r2) VERIFY_IS_APPROX(square(r,r2), v1[r]);
else VERIFY_IS_MUCH_SMALLER_THAN(square(r,r2), static_cast<Scalar>(1));
- square = MatrixType::zero(rows, rows);
- square.diagonal() = VectorType::ones(rows);
- VERIFY_IS_APPROX(square, MatrixType::identity(rows, rows));
+ square = MatrixType::Zero(rows, rows);
+ square.diagonal() = VectorType::Ones(rows);
+ VERIFY_IS_APPROX(square, MatrixType::Identity(rows, rows));
}
void test_miscmatrices()
diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp
index d9653588d..a1b12f57c 100644
--- a/test/nomalloc.cpp
+++ b/test/nomalloc.cpp
@@ -56,17 +56,17 @@ template<typename MatrixType> void nomalloc(const MatrixType& m)
// this test relies a lot on Random.h, and there's not much more that we can do
// to test it, hence I consider that we will have tested Random.h
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
- mzero = MatrixType::zero(rows, cols),
+ mzero = MatrixType::Zero(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
- ::identity(rows, rows),
+ ::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);
+ ::Random(rows, rows);
+ VectorType v1 = VectorType::Random(rows),
+ v2 = VectorType::Random(rows),
+ vzero = VectorType::Zero(rows);
Scalar s1 = ei_random<Scalar>();
@@ -82,7 +82,7 @@ template<typename MatrixType> void nomalloc(const MatrixType& m)
void test_nomalloc()
{
// check that our operator new is indeed called:
- VERIFY_RAISES_ASSERT(MatrixXd dummy = MatrixXd::random(3,3));
+ VERIFY_RAISES_ASSERT(MatrixXd dummy = MatrixXd::Random(3,3));
CALL_SUBTEST( nomalloc(Matrix<float, 1, 1>()) );
CALL_SUBTEST( nomalloc(Matrix4d()) );
}
diff --git a/test/product.cpp b/test/product.cpp
index 48999119f..2f6677ff1 100644
--- a/test/product.cpp
+++ b/test/product.cpp
@@ -54,21 +54,21 @@ template<typename MatrixType> void product(const MatrixType& m)
// this test relies a lot on Random.h, and there's not much more that we can do
// to test it, hence I consider that we will have tested Random.h
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
- mzero = MatrixType::zero(rows, cols);
+ mzero = MatrixType::Zero(rows, cols);
RowSquareMatrixType
- identity = RowSquareMatrixType::identity(rows, rows),
- square = RowSquareMatrixType::random(rows, rows),
- res = RowSquareMatrixType::random(rows, rows);
+ identity = RowSquareMatrixType::Identity(rows, rows),
+ square = RowSquareMatrixType::Random(rows, rows),
+ res = RowSquareMatrixType::Random(rows, rows);
ColSquareMatrixType
- square2 = ColSquareMatrixType::random(cols, cols),
- res2 = ColSquareMatrixType::random(cols, cols);
- RowVectorType v1 = RowVectorType::random(rows),
- v2 = RowVectorType::random(rows),
- vzero = RowVectorType::zero(rows);
- ColVectorType vc2 = ColVectorType::random(cols), vcres;
+ square2 = ColSquareMatrixType::Random(cols, cols),
+ res2 = ColSquareMatrixType::Random(cols, cols);
+ RowVectorType v1 = RowVectorType::Random(rows),
+ v2 = RowVectorType::Random(rows),
+ vzero = RowVectorType::Zero(rows);
+ ColVectorType vc2 = ColVectorType::Random(cols), vcres;
OtherMajorMatrixType tm1 = m1;
Scalar s1 = ei_random<Scalar>();
@@ -99,7 +99,7 @@ template<typename MatrixType> void product(const MatrixType& m)
VERIFY_IS_APPROX(v1, identity*v1);
VERIFY_IS_APPROX(v1.transpose(), v1.transpose() * identity);
// again, test operator() to check const-qualification
- VERIFY_IS_APPROX(MatrixType::identity(rows, cols)(r,c), static_cast<Scalar>(r==c));
+ VERIFY_IS_APPROX(MatrixType::Identity(rows, cols)(r,c), static_cast<Scalar>(r==c));
if (rows!=cols)
VERIFY_RAISES_ASSERT(m3 = m1*m1);
diff --git a/test/qr.cpp b/test/qr.cpp
index 716ec94c9..be9e97a04 100644
--- a/test/qr.cpp
+++ b/test/qr.cpp
@@ -37,10 +37,10 @@ template<typename MatrixType> void qr(const MatrixType& m)
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime> SquareMatrixType;
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, 1> VectorType;
- MatrixType a = MatrixType::random(rows,cols);
+ MatrixType a = MatrixType::Random(rows,cols);
QR<MatrixType> qrOfA(a);
VERIFY_IS_APPROX(a, qrOfA.matrixQ() * qrOfA.matrixR());
- VERIFY_IS_NOT_APPROX(a+MatrixType::identity(rows, cols), qrOfA.matrixQ() * qrOfA.matrixR());
+ VERIFY_IS_NOT_APPROX(a+MatrixType::Identity(rows, cols), qrOfA.matrixQ() * qrOfA.matrixR());
SquareMatrixType b = a.adjoint() * a;
@@ -52,7 +52,7 @@ template<typename MatrixType> void qr(const MatrixType& m)
HessenbergDecomposition<SquareMatrixType> hess(b);
VERIFY_IS_APPROX(b, hess.matrixQ() * hess.matrixH() * hess.matrixQ().adjoint());
VERIFY_IS_APPROX(tridiag.matrixT(), hess.matrixH());
- b = SquareMatrixType::random(cols,cols);
+ b = SquareMatrixType::Random(cols,cols);
hess.compute(b);
VERIFY_IS_APPROX(b, hess.matrixQ() * hess.matrixH() * hess.matrixQ().adjoint());
}
diff --git a/test/submatrices.cpp b/test/submatrices.cpp
index d486943e3..f0475f99f 100644
--- a/test/submatrices.cpp
+++ b/test/submatrices.cpp
@@ -62,18 +62,18 @@ template<typename MatrixType> void submatrices(const MatrixType& m)
int rows = m.rows();
int cols = m.cols();
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
- mzero = MatrixType::zero(rows, cols),
+ mzero = MatrixType::Zero(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
- ::identity(rows, rows),
+ ::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);
+ ::Random(rows, rows);
+ VectorType v1 = VectorType::Random(rows),
+ v2 = VectorType::Random(rows),
+ v3 = VectorType::Random(rows),
+ vzero = VectorType::Zero(rows);
Scalar s1 = ei_random<Scalar>();
diff --git a/test/triangular.cpp b/test/triangular.cpp
index 01d4ecf84..185471dc7 100644
--- a/test/triangular.cpp
+++ b/test/triangular.cpp
@@ -32,23 +32,23 @@ template<typename MatrixType> void triangular(const MatrixType& m)
int rows = m.rows();
int cols = m.cols();
- MatrixType m1 = MatrixType::random(rows, cols),
- m2 = MatrixType::random(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
r1(rows, cols),
r2(rows, cols),
- mzero = MatrixType::zero(rows, cols),
- mones = MatrixType::ones(rows, cols),
+ mzero = MatrixType::Zero(rows, cols),
+ mones = MatrixType::Ones(rows, cols),
identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
- ::identity(rows, rows),
+ ::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);
+ ::Random(rows, rows);
+ VectorType v1 = VectorType::Random(rows),
+ v2 = VectorType::Random(rows),
+ vzero = VectorType::Zero(rows);
- MatrixType m1up = m1.template extract<Eigen::Upper>();
- MatrixType m2up = m2.template extract<Eigen::Upper>();
+ MatrixType m1up = m1.template part<Eigen::Upper>();
+ MatrixType m2up = m2.template part<Eigen::Upper>();
if (rows*cols>1)
{
@@ -70,18 +70,18 @@ template<typename MatrixType> void triangular(const MatrixType& m)
m1.setZero();
m1.template part<Eigen::Upper>() = (m2.transpose() * m2).lazy();
m3 = m2.transpose() * m2;
- VERIFY_IS_APPROX(m3.template extract<Eigen::Lower>().transpose(), m1);
+ VERIFY_IS_APPROX(m3.template part<Eigen::Lower>().transpose(), m1);
// test overloaded operator=
m1.setZero();
m1.template part<Eigen::Lower>() = (m2.transpose() * m2).lazy();
- VERIFY_IS_APPROX(m3.template extract<Eigen::Lower>(), m1);
+ VERIFY_IS_APPROX(m3.template part<Eigen::Lower>(), m1);
// test back and forward subsitution
- m1 = MatrixType::random(rows, cols);
- VERIFY_IS_APPROX(m1.template extract<Eigen::Upper>() * (m1.template extract<Eigen::Upper>().inverseProduct(m2)), m2);
- VERIFY_IS_APPROX(m1.template extract<Eigen::Lower>() * (m1.template extract<Eigen::Lower>().inverseProduct(m2)), m2);
- VERIFY((m1.template extract<Eigen::Upper>() * m2.template extract<Eigen::Upper>()).isUpper());
+ m1 = MatrixType::Random(rows, cols);
+ VERIFY_IS_APPROX(m1.template part<Eigen::Upper>() * (m1.template part<Eigen::Upper>().inverseProduct(m2)), m2);
+ VERIFY_IS_APPROX(m1.template part<Eigen::Lower>() * (m1.template part<Eigen::Lower>().inverseProduct(m2)), m2);
+ VERIFY((m1.template part<Eigen::Upper>() * m2.template part<Eigen::Upper>()).isUpper());
}