aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-12-07 21:40:53 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-12-07 21:40:53 +0000
commit069ecbb4ab6104c0e04d5dafffa8cf750bdd82b0 (patch)
tree19e35988f995c86bf6f5eb8c58d9f35d3543b6c5
parent09fd69d7344c8abea3179a4f4e68fb7f23f10d1f (diff)
* complete the change norm2->squaredNorm in PartialRedux
* somehow the NICE_RANDOM stuff wasn't being used anymore and tests were sometimes failing again. Fixed by #including Eigen/Array instead of cherry-picking just Random.h. * little fixes in the unaligned assert page
-rw-r--r--Eigen/src/Array/PartialRedux.h8
-rw-r--r--doc/UnalignedArrayAssert.dox8
-rw-r--r--doc/snippets/PartialRedux_squaredNorm.cpp (renamed from doc/snippets/PartialRedux_norm2.cpp)0
-rw-r--r--test/main.h5
4 files changed, 9 insertions, 12 deletions
diff --git a/Eigen/src/Array/PartialRedux.h b/Eigen/src/Array/PartialRedux.h
index aca20633b..612d9c250 100644
--- a/Eigen/src/Array/PartialRedux.h
+++ b/Eigen/src/Array/PartialRedux.h
@@ -107,7 +107,7 @@ class PartialReduxExpr : ei_no_assignment_operator,
{ return mat.MEMBER(); } \
}
-EIGEN_MEMBER_FUNCTOR(norm2, Size * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost);
+EIGEN_MEMBER_FUNCTOR(squaredNorm, Size * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost);
EIGEN_MEMBER_FUNCTOR(norm, (Size+5) * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost);
EIGEN_MEMBER_FUNCTOR(sum, (Size-1)*NumTraits<Scalar>::AddCost);
EIGEN_MEMBER_FUNCTOR(minCoeff, (Size-1)*NumTraits<Scalar>::AddCost);
@@ -204,11 +204,11 @@ template<typename ExpressionType, int Direction> class PartialRedux
/** \returns a row (or column) vector expression of the squared norm
* of each column (or row) of the referenced expression.
*
- * Example: \include PartialRedux_norm2.cpp
- * Output: \verbinclude PartialRedux_norm2.out
+ * Example: \include PartialRedux_squaredNorm.cpp
+ * Output: \verbinclude PartialRedux_squaredNorm.out
*
* \sa MatrixBase::squaredNorm() */
- const typename ReturnType<ei_member_norm2>::Type squaredNorm() const
+ const typename ReturnType<ei_member_squaredNorm>::Type squaredNorm() const
{ return _expression(); }
/** \returns a row (or column) vector expression of the norm
diff --git a/doc/UnalignedArrayAssert.dox b/doc/UnalignedArrayAssert.dox
index e58380d2b..a0fb0b314 100644
--- a/doc/UnalignedArrayAssert.dox
+++ b/doc/UnalignedArrayAssert.dox
@@ -43,7 +43,7 @@ By "vectorizable fixed-size Eigen object" we mean an Eigen matrix or vector of f
\section how How to fix this bug?
-Your structure having this Eigen object as member needs to have an aligned operator new. Eigen makes it easy for you to do that, you only have one line of code to change:
+Very easy, you just need to let your struct Foo inherit Eigen::WithAlignedOperatorNew, like this:
\code
struct Foo : Eigen::WithAlignedOperatorNew
@@ -85,11 +85,11 @@ For this reason, Eigen takes care by itself to require 128-bit alignment for Eig
Thus, normally, you don't have to worry about anything, Eigen handles alignment for you...
-... except in one case. When you have a struct Foo like above, and you dynamically allocate a new Foo as above, then, since Foo doesn't have aligned operator new, the returned pointer foo is not necessarily 128-bit aligned.
+... except in one case. When you have a struct Foo like above, and you dynamically allocate a new Foo as above, then, since Foo doesn't have aligned "operator new", the returned pointer foo is not necessarily 128-bit aligned.
The alignment attribute of the member v is then relative to the start of the struct, foo. If the foo pointer wasn't aligned, then foo->v won't be aligned either!
-The solution is to let struct Foo have an aligned operator new, as we showed in the previous section.
+The solution is to let struct Foo have an aligned "operator new", as we showed in the previous section.
\section movetotop Should I then put all the members of Eigen types at the beginning of my struct?
@@ -119,7 +119,7 @@ Dynamic-size matrices and vectors, such as Eigen::VectorXd, allocate dynamically
\section bugineigen So is this a bug in Eigen?
-No, it's not our bug. It's more like an inherent problem of the C++ language -- though it must be said that any other existing language probably has the same problem. The problem is that there is no way that you can specify an alignment property that would propagate to classes having you as member data.
+No, it's not our bug. It's more like an inherent problem of the C++ language -- though it must be said that any other existing language probably has the same problem. The problem is that there is no way that you can specify an aligned "operator new" that would propagate to classes having you as member data.
*/
diff --git a/doc/snippets/PartialRedux_norm2.cpp b/doc/snippets/PartialRedux_squaredNorm.cpp
index 9f3293e65..9f3293e65 100644
--- a/doc/snippets/PartialRedux_norm2.cpp
+++ b/doc/snippets/PartialRedux_squaredNorm.cpp
diff --git a/test/main.h b/test/main.h
index 459097782..cfff229ca 100644
--- a/test/main.h
+++ b/test/main.h
@@ -136,11 +136,8 @@ namespace Eigen
#define EIGEN_INTERNAL_DEBUGGING
#define EIGEN_NICE_RANDOM
-#include <Eigen/Core>
+#include <Eigen/Array>
-namespace Eigen {
-#include <Eigen/src/Array/Random.h>
-}
#define VERIFY(a) do { if (!(a)) { \
std::cerr << "Test " << g_test_stack.back() << " failed in "EI_PP_MAKE_STRING(__FILE__) << " (" << EI_PP_MAKE_STRING(__LINE__) << ")" \