* Added support for a comma initializer: mat.block(i,j,2,2) << 1, 2, 3, 4;

If the number of coefficients does not match the matrix size, then an assertion is raised.
  No support for xpr on the right side for the moment.

* Added support for assertion checking. This allows to test that an assertion is indeed raised
  when it should be.

* Fixed a mistake in the CwiseUnary example.
This commit is contained in:
Gael Guennebaud
2008-03-08 19:02:24 +00:00
parent 138aad0ed0
commit 721626dfc5
13 changed files with 259 additions and 67 deletions

View File

@@ -151,8 +151,9 @@ struct ei_has_nothing {int a[1];};
struct ei_has_std_result_type {int a[2];};
struct ei_has_tr1_result {int a[3];};
/** Convenient struct to get the result type of a unary or binary functor.
*
/** \internal
* Convenient struct to get the result type of a unary or binary functor.
*
* It supports both the current STL mechanism (using the result_type member) as well as
* upcoming next STL generation (using a templated result member).
* If none of these member is provided, then the type of the first argument is returned.
@@ -175,7 +176,7 @@ struct ei_result_of<Func(ArgType)> {
template<typename T>
static ei_has_tr1_result testFunctor(T const *, typename T::template result<T(ArgType)>::type const * = 0);
static ei_has_nothing testFunctor(...);
typedef typename ei_unary_result_of_select<Func, ArgType, sizeof(testFunctor(static_cast<Func*>(0)))>::type type;
};
@@ -197,7 +198,7 @@ struct ei_result_of<Func(ArgType0,ArgType1)> {
template<typename T>
static ei_has_tr1_result testFunctor(T const *, typename T::template result<T(ArgType0,ArgType1)>::type const * = 0);
static ei_has_nothing testFunctor(...);
typedef typename ei_binary_result_of_select<Func, ArgType0, ArgType1, sizeof(testFunctor(static_cast<Func*>(0)))>::type type;
};