Commit Graph

42 Commits

Author SHA1 Message Date
Gael Guennebaud
48fe78c375 bug #1630: fix linspaced when requesting smaller packet size than default one. 2018-11-28 13:15:06 +01:00
Gael Guennebaud
dff3a92d52 Remove usage of #if EIGEN_TEST_PART_XX in unit tests that does not require them (splitting can thus be avoided for them) 2018-07-17 15:52:58 +02:00
Gael Guennebaud
82f0ce2726 Get rid of EIGEN_TEST_FUNC, unit tests must now be declared with EIGEN_DECLARE_TEST(mytest) { /* code */ }.
This provide several advantages:
- more flexibility in designing unit tests
- unit tests can be glued to speed up compilation
- unit tests are compiled with same predefined macros, which is a requirement for zapcc
2018-07-17 14:46:15 +02:00
Gael Guennebaud
9deee79922 bug #1457: add setUnit() methods for consistency. 2017-08-22 16:48:07 +02:00
Gael Guennebaud
850ca961d2 bug #1383: fix regression in LinSpaced for integers and high<low 2017-01-25 18:13:53 +01:00
Gael Guennebaud
d06a48959a bug #1383: Fix regression from 3.2 with LinSpaced(n,0,n-1) with n==0. 2017-01-25 15:27:13 +01:00
Gael Guennebaud
a07bb428df bug #1004: improve accuracy of LinSpaced for abs(low) >> abs(high). 2016-11-02 11:34:38 +01:00
Gael Guennebaud
58146be99b bug #1004: one more rewrite of LinSpaced for floating point numbers to guarantee both interpolation and monotonicity.
This version simply does low+i*step plus a branch to return high if i==size-1.
Vectorization is accomplished with a branch and the help of pinsertlast.
Some quick benchmark revealed that the overhead is really marginal, even when filling small vectors.
2016-10-25 16:53:09 +02:00
Gael Guennebaud
b027d7a8cf bug #1004: remove the inaccurate "sequential" path for LinSpaced, mark respective function as deprecated, and enforce strict interpolation of the higher range using a correction term.
Now, even with floating point precision, both the 'low' and 'high' bounds are exactly reproduced at i=0 and i=size-1 respectively.
2016-10-24 20:27:21 +02:00
Gael Guennebaud
53c77061f0 bug #698: rewrite LinSpaced for integer scalar types to avoid overflow and guarantee an even spacing when possible.
Otherwise, the "high" bound is implicitly lowered to the largest value allowing for an even distribution.
This changeset also disable vectorization for this integer path.
2016-10-24 15:50:27 +02:00
Gael Guennebaud
e8e56c7642 Add unit test for overflow in LinSpaced 2016-10-24 15:43:51 +02:00
Gael Guennebaud
b046a3f87d Workaround MSVC instantiation faillure of has_*ary_operator at the level of triats<Ref>::match so that the has_*ary_operator are really properly instantiated throughout the compilation unit. 2016-09-06 15:47:04 +02:00
Gael Guennebaud
e13071dd13 Workaround a weird msvc 2012 compilation error. 2016-09-05 15:50:41 +02:00
Gael Guennebaud
218c37beb4 bug #1286: automatically detect the available prototypes of functors passed to CwiseNullaryExpr such that functors have only to implement the operators that matters among:
operator()()
 operator()(i)
 operator()(i,j)
Linear access is also automatically detected based on the availability of operator()(i,j).
2016-08-31 15:45:25 +02:00
Gael Guennebaud
6e0a86194c Fix integer path for num_steps==1 2016-02-01 15:00:04 +01:00
Gael Guennebaud
e1d219e5c9 bug #698: fix linspaced for integer types. 2016-02-01 14:25:34 +01:00
Gael Guennebaud
dd934ad057 Re-enable vectorization of LinSpaced, plus some cleaning 2015-10-08 17:27:01 +02:00
Gael Guennebaud
fc202bab39 Index refactoring: StorageIndex must be used for storage only (and locally when it make sense). In all other cases use the global Index type. 2015-02-13 18:57:41 +01:00
Gael Guennebaud
fe51319980 Merge Index-refactoring branch with default, fix PastixSupport, remove some useless typedefs 2015-02-13 10:03:53 +01:00
Gael Guennebaud
99501a2c4c Fix wrong negative in nullary unit test when extended precision is used (FPU). 2014-12-16 16:23:47 +01:00
Christoph Hertzberg
e8cdbedefb bug #877, bug #572: Introduce a global Index typedef. Rename Sparse*::Index to StorageIndex, make Dense*::StorageIndex an alias to DenseIndex. Overall this commit gets rid of all Index conversion warnings. 2014-12-04 22:48:53 +01:00
Jitse Niesen
b4f6aec195 Fix linear vectorized transversal in linspace (fixes bug #526). 2013-02-18 17:26:03 +00:00
Benoit Jacob
69124cfca2 Automatic relicensing to MPL2 using Keirs script. Manual fixup follows. 2012-07-13 14:42:47 -04:00
Hauke Heibel
c08521ea6b Improved the unit tests for setLinSpaced.
Provide a default constructed step size as opposed to an int when the size is 1.
2012-03-07 16:18:35 +01:00
Hauke Heibel
ef022da28e Fixed setLinSpaced for size==1. 2012-03-07 15:34:39 +01:00
Gael Guennebaud
42e2578ef9 the min/max macros to detect unprotected min/max were undefined by some std header,
so let's declare them after and do the respective fixes ;)
2011-08-19 14:18:05 +02:00
Jitse Niesen
c6ad2deead Bug fix in linspace_op::packetOp(row,col). Fixes bug #232.
Also, add regression test.
2011-03-24 10:42:11 +00:00
Jitse Niesen
e7d2376688 Change int to Index in equalsIdentity().
This fixes compilation errors in nullary test on 64-bits machines.
2011-03-11 11:06:13 +00:00
Jitse Niesen
151e3294cf Fix equalsIdentity() for rectangular matrices. 2011-03-10 13:49:06 +00:00
Gael Guennebaud
c6c6c34909 repeat nullary tests, and fix some tests 2011-03-07 16:41:59 +01:00
Benoit Jacob
4716040703 bug #86 : use internal:: namespace instead of ei_ prefix 2010-10-25 10:15:22 -04:00
Hauke Heibel
9f8b6ad43e Fixed bug #79. 2010-10-19 09:43:54 +02:00
Hauke Heibel
734469e43f Unified LinSpaced in order to be conform with other setter methods as e.g. Constant. 2010-07-22 14:04:00 +02:00
Carlos Becker
97f3c7f282 Fixed nullary test not passing on Core Duo 2010-06-30 19:17:29 +01:00
Gael Guennebaud
768bdd08c8 fix bad tests 2010-06-28 01:01:29 +02:00
Hauke Heibel
bb46a45340 Finally fixed the matrix function/exponential warning.
Index fixes.
2010-06-20 23:13:24 +02:00
Hauke Heibel
f1679c7185 Utilize Index in all unit tests. 2010-06-20 17:37:56 +02:00
Gael Guennebaud
4b5d359c3a improve/fix stable_norm unit test 2010-06-08 13:29:27 +02:00
Hauke Heibel
1a77334d54 Silenced type conversion warnings. 2010-02-03 19:20:25 +01:00
Hauke Heibel
4365a48748 Added an ei_linspaced_op to create linearly spaced vectors.
Added setLinSpaced/LinSpaced functionality to DenseBase.
Improved vectorized assignment - overcomes MSVC optimization issues.
CwiseNullaryOp is now requiring functors to offer 1D and 2D operators.
Adapted existing functors to the new CwiseNullaryOp requirements.
Added ei_plset to create packages as [a, a+1, ..., a+size].
Added more nullaray unit tests.
2010-01-26 19:42:17 +01:00
Jitse Niesen
dbf3af866e Remove some Array #includes. 2010-01-21 12:31:03 +00:00
Jitse Niesen
e0c2c6385f Add small test for Matrix::setIdentity()
This is to exhibit the bug that makes the jacobisvd_7 test fail.
2010-01-20 10:51:59 +00:00