Commit Graph

2100 Commits

Author SHA1 Message Date
Jonathan Hseu
3453b00a1e Fix vector indexing with uint64_t 2017-02-11 21:45:32 -08:00
Gael Guennebaud
c16ee72b20 bug #1392: fix #include <Eigen/Sparse> with mpl2-only 2017-02-11 10:35:01 +01:00
Gael Guennebaud
4a4a72951f Fix previous commits: disbale only problematic indexed view methods for old compilers instead of disabling everything.
Tested with gcc 4.7 (c++03) and gcc 4.8 (c++03 & c++11)
2017-02-11 10:28:44 +01:00
Benoit Steiner
8b3cc54c42 Added a new EIGEN_HAS_INDEXED_VIEW define that set to 0 for older compilers that are known to fail to compile the indexed views (I used the define from the indexed_views.cpp test).
Only include the indexed view methods when the compiler supports the code.
This makes it possible to use Eigen again in complex code bases such as TensorFlow and older compilers such as gcc 4.8
2017-02-10 13:08:49 -08:00
Gael Guennebaud
84090027c4 Disable a part of the unit test for gcc 4.8 2017-02-01 23:37:44 +01:00
Gael Guennebaud
53026d29d4 bug #478: fix regression in the eigen decomposition of zero matrices. 2017-01-31 14:22:42 +01:00
Gael Guennebaud
c86911ac73 bug #1384: fix evaluation of "sparse/scalar" that used the wrong evaluation path. 2017-01-30 13:38:24 +01:00
Gael Guennebaud
251ad3e04f Fix unamed type as template parametre issue. 2017-01-27 11:57:52 +01:00
Gael Guennebaud
25a1703579 Merged in ggael/eigen-flexidexing (pull request PR-294)
generalized operator() for indexed access and slicing
2017-01-26 08:04:23 +00:00
Gael Guennebaud
28351073d8 Fix unamed type as template argument (ok in c++11 only) 2017-01-25 22:54:51 +01: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
296d24be4d bug #1381: fix sparse.diagonal() used as a rvalue.
The problem was that is "sparse" is not const, then sparse.diagonal() must have the
LValueBit flag meaning that sparse.diagonal().coeff(i) must returns a const reference,
const Scalar&. However, sparse::coeff() cannot returns a reference for a non-existing
zero coefficient. The trick is to return a reference to a local member of
evaluator<SparseMatrix>.
2017-01-25 17:39:01 +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
d83db761a2 Add support for std::integral_constant 2017-01-24 16:28:12 +01:00
Gael Guennebaud
bc10201854 Add test for multiple symbols 2017-01-24 16:27:51 +01:00
Gael Guennebaud
5783158e8f Add unit test for FixedInt and Symbolic 2017-01-24 10:55:12 +01:00
Gael Guennebaud
ba3f977946 bug #1376: add missing assertion on size mismatch with compound assignment operators (e.g., mat += mat.col(j)) 2017-01-23 22:06:08 +01:00
Gael Guennebaud
0fe278f7be bug #1379: fix compilation in sparse*diagonal*dense with openmp 2017-01-21 23:27:01 +01:00
Gael Guennebaud
4d302a080c Recover compile-time size from seq(A,B) when A and B are fixed values. (c++11 only) 2017-01-19 20:34:18 +01:00
Gael Guennebaud
e84ed7b6ef Remove dead code 2017-01-18 23:18:28 +01:00
Gael Guennebaud
15471432fe Add a .reverse() member to ArithmeticSequence. 2017-01-18 11:35:27 +01:00
Gael Guennebaud
198507141b Update all block expressions to accept compile-time sizes passed by fix<N> or fix<N>(n) 2017-01-18 09:43:58 +01:00
Gael Guennebaud
655ba783f8 Defer set-to-zero in triangular = product so that no aliasing issue occur in the common:
A.triangularView() = B*A.sefladjointView()*B.adjoint()
case that used to work in 3.2.
2017-01-17 18:03:35 +01:00
Gael Guennebaud
5e36ec3b6f Fix regression when passing enums to operator() 2017-01-17 17:10:16 +01:00
Gael Guennebaud
f7852c3d16 Fix -Wunnamed-type-template-args 2017-01-17 16:05:58 +01:00
Gael Guennebaud
4f36dcfda8 Add a generic block() method compatible with Eigen::fix 2017-01-17 11:34:28 +01:00
Gael Guennebaud
4989922be2 Add support for symbolic expressions as arguments of operator() 2017-01-16 22:21:23 +01:00
Gael Guennebaud
a9232af845 Introduce a variable_or_fixed<N> proxy returned by fix<N>(val) to pass both a compile-time and runtime fallback value in case N means "runtime".
This mechanism is used by the seq/seqN functions. The proxy object is immediately converted to pure compile-time (as fix<N>) or pure runtime (i.e., an Index) to avoid redundant template instantiations.
2017-01-16 16:17:01 +01:00
Gael Guennebaud
752bd92ba5 Large code refactoring:
- generalize some utilities and move them to Meta (size(), array_size())
 - move handling of all and single indices to IndexedViewHelper.h
 - several cleanup changes
2017-01-11 17:24:02 +01:00
Gael Guennebaud
04397f17e2 Add 1D overloads of operator() 2017-01-11 13:17:09 +01:00
Gael Guennebaud
d072fc4b14 add writeable IndexedView 2017-01-10 17:10:35 +01:00
Gael Guennebaud
87963f441c Fallback to Block<> when possible (Index, all, seq with > increment).
This is important to take advantage of the optimized implementations (evaluator, products, etc.),
and to support sparse matrices.
2017-01-10 14:25:30 +01:00
Gael Guennebaud
acd08900c9 Move 'last' and 'end' to their own namespace 2017-01-10 10:31:07 +01:00
Gael Guennebaud
1df2377d78 Implement c++98 version of seq() 2017-01-10 10:28:45 +01:00
Gael Guennebaud
ecd9cc5412 Isolate legacy code (we keep it for performance comparison purpose) 2017-01-10 09:34:25 +01:00
Gael Guennebaud
b50c3e967e Add a minimalistic symbolic scalar type with expression template and make use of it to define the last placeholder and to unify the return type of seq and seqN. 2017-01-09 23:42:16 +01:00
Gael Guennebaud
68064e14fa Rename span/range to seqN/seq 2017-01-09 17:35:21 +01:00
Gael Guennebaud
233dff1b35 Add support for plain arrays for columns and both rows/columns 2017-01-06 22:01:53 +01:00
Gael Guennebaud
3264d3c761 Add support for plain-array as indices, e.g., mat({1,2,3,4}) 2017-01-06 21:53:32 +01:00
Gael Guennebaud
a875167d99 Propagate compile-time increment and strides.
Had to introduce a UndefinedIncr constant for non structured list of indices.
2017-01-06 15:54:55 +01:00
Gael Guennebaud
fad1fa75b3 Propagate compile-time size with "all" and add c++11 array unit test 2017-01-06 13:29:33 +01:00
Gael Guennebaud
3730e3ca9e Use "fix" for compile-time values, propagate compile-time sizes for span, clean some cleanup. 2017-01-06 13:10:10 +01:00
Gael Guennebaud
60e99ad8d7 Add unit test for indexed views 2017-01-06 11:59:08 +01:00
Gael Guennebaud
f3f026c9aa Convert integers to real numbers when computing relative L2 error 2017-01-05 13:36:08 +01:00
Gael Guennebaud
7136267461 Add missing .outer() member to iterators of evaluators of cwise sparse binary expression 2016-12-27 16:34:30 +01:00
Gael Guennebaud
684cfc762d Add transpose, adjoint, conjugate methods to SelfAdjointView (useful to write generic code) 2016-12-20 16:33:53 +01:00
Christoph Hertzberg
10c6bcdc2e Add support for long indexes and for (real-valued) row-major matrices to CholmodSupport module 2016-12-19 14:07:42 +01:00
Gael Guennebaud
f5d644b415 Make sure that HyperPlane::transform manitains a unit normal vector in the Affine case. 2016-12-20 09:35:00 +01:00
ermak
d60cca32e5 Transformation methods added to ParametrizedLine class. 2016-12-17 00:45:13 +07:00
Gael Guennebaud
7d5303a083 Partly revert changeset 642dddcce2
, just in case the x87 issue popup again
2016-12-16 09:25:14 +01:00
Christoph Hertzberg
4247d35d4b Fixed bug which (extremely rarely) could end in an infinite loop 2016-12-15 17:22:12 +01:00
Christoph Hertzberg
642dddcce2 Fix nonnull-compare warning 2016-12-15 17:16:56 +01:00
Gael Guennebaud
11b492e993 bug #1358: fix compilation for sparse += sparse.selfadjointView(); 2016-12-14 17:53:47 +01:00
Gael Guennebaud
e67397bfa7 bug #1359: fix compilation of col_major_sparse.row() *= scalar
(used to work in 3.2.9 though the expression is not really writable)
2016-12-14 17:05:26 +01:00
Gael Guennebaud
c817ce3ba3 bug #1361: fix compilation issue in mat=perm.inverse() 2016-12-13 23:10:27 +01:00
Srinivas Vasudevan
218764ee1f Added support for expm1 in Eigen. 2016-12-02 14:13:01 -08:00
Gael Guennebaud
037b46762d Fix misleading-indentation warnings. 2016-12-01 16:05:42 +01:00
Gael Guennebaud
c927af60ed Fix a performance regression in (mat*mat)*vec for which mat*mat was evaluated multiple times. 2016-11-30 17:59:13 +01:00
Gael Guennebaud
6a84246a6a Fix regression in assigment of sparse block to spasre block. 2016-11-21 21:46:42 +01:00
Gael Guennebaud
8193ffb3d3 bug #1343: fix compilation regression in mat+=selfadjoint_view.
Generic EigenBase2EigenBase assignment was incomplete.
2016-11-18 10:17:34 +01:00
Gael Guennebaud
cebff7e3a2 bug #1343: fix compilation regression in array = matrix_product 2016-11-18 10:09:33 +01:00
Konstantinos Margaritis
a1d5c503fa replace sizeof(Packet) with PacketSize else it breaks for ZVector.Packet4f 2016-11-17 13:27:45 -05:00
Gael Guennebaud
2e334f5da0 bug #426: move operator && and || to MatrixBase and SparseMatrixBase. 2016-11-14 18:47:02 +01:00
Gael Guennebaud
eedb87f4ba Fix regression in SparseMatrix::ReverseInnerIterator 2016-11-14 14:05:53 +01:00
Gael Guennebaud
73985ead27 Extend unit test to check sparse solvers with a SparseVector as the rhs and result. 2016-11-06 20:29:57 +01:00
Benoit Steiner
c80587c92b Merged eigen/eigen into default 2016-11-03 03:55:11 -07: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
598de8b193 Add pinsertfirst function and implement pinsertlast for complex on SSE/AVX. 2016-11-02 10:38:13 +01:00
Gael Guennebaud
3ecb343dc3 Fix regression in X = (X*X.transpose())/s with X rectangular by deferring resizing of the destination after the creation of the evaluator of the source expression. 2016-10-26 22:50:41 +02: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
13fc18d3a2 Add a pinsertlast function replacing the last entry of a packet by a scalar.
(useful to vectorize LinSpaced)
2016-10-25 16:48:49 +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
Benoit Steiner
78d2926508 Merged eigen/eigen into default 2016-10-12 13:46:29 -07:00
Gael Guennebaud
f939c351cb Fix SPQR for rectangular matrices 2016-10-12 22:39:33 +02:00
Gael Guennebaud
5c366fe1d7 Merged in rmlarsen/eigen (pull request PR-230)
Fix a bug in psqrt for SSE and AVX when EIGEN_FAST_MATH=1
2016-10-12 16:30:51 +00:00
Gael Guennebaud
4860727ac2 Remove static qualifier of free-functions (inline is enough and this helps ICC to find the right overload) 2016-10-07 09:21:12 +02:00
Benoit Steiner
507b661106 Renamed predux_half into predux_downto4 2016-10-06 17:57:04 -07:00
Gael Guennebaud
80b5133789 Fix compilation of qr.inverse() for column and full pivoting variants. 2016-10-06 09:55:50 +02:00
Benoit Steiner
78b569f685 Merged latest updates from trunk 2016-10-05 18:48:55 -07:00
Rasmus Munk Larsen
3ed67cb0bb Fix a bug in the implementation of Carmack's fast sqrt algorithm in Eigen (enabled by EIGEN_FAST_MATH), which causes the vectorized parts of the computation to return -0.0 instead of NaN for negative arguments.
Benchmark speed in Giga-sqrts/s
Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz
-----------------------------------------
                    SSE        AVX
Fast=1              2.529G     4.380G
Fast=0              1.944G     1.898G
Fast=1 fixed        2.214G     3.739G

This table illustrates the worst case in terms speed impact: It was measured by repeatedly computing the sqrt of an n=4096 float vector that fits in L1 cache. For large vectors the operation becomes memory bound and the differences between the different versions almost negligible.
2016-10-04 14:22:56 -07:00
Benoit Steiner
616a7a1912 Improved support for compiling CUDA code with clang as the host compiler 2016-10-03 17:09:33 -07:00
Gael Guennebaud
8b84801f7f bug #1310: workaround a compilation regression from 3.2 regarding triangular * homogeneous 2016-09-30 22:49:59 +02:00
Gael Guennebaud
33500050c3 bug #1308: fix compilation of some small products involving nullary-expressions. 2016-09-29 09:40:44 +02:00
Gael Guennebaud
779774f98c bug #1311: fix alignment logic in some cases of (scalar*small).lazyProduct(small) 2016-09-26 23:53:40 +02:00
Gael Guennebaud
48dfe98abd bug #1308: fix compilation of vector * rowvector::nullary. 2016-09-25 14:54:35 +02:00
Gael Guennebaud
86caba838d bug #1304: fix Projective * scaling and Projective *= scaling 2016-09-23 13:41:21 +02:00
Gael Guennebaud
66cbabafed Add a note regarding gcc bug #72867 2016-09-22 11:18:52 +02:00
Gael Guennebaud
aecc51a3e8 fix typo 2016-09-21 21:53:00 +02:00
Gael Guennebaud
1fc3a21ed0 Disable a failure test if extended double precision is in use (x87) 2016-09-21 20:09:07 +02:00
Gael Guennebaud
5269d11935 Fix compilation if ICC. 2016-09-21 17:08:51 +02:00
Gael Guennebaud
bf03820339 Silent warning. 2016-09-17 14:14:01 +02:00
Gael Guennebaud
de05a18fe0 fix compilation with boost::multiprec 2016-09-17 14:13:48 +02:00
Gael Guennebaud
4cc2c73e6a Fix alignement of statically allocated temporaries in gemv. 2016-09-17 12:52:27 +02:00
Gael Guennebaud
4adeababf9 Fix undeflow 2016-09-16 11:46:46 +02:00
Gael Guennebaud
471eac5399 bug #1195: move NumTraits::Div<>::Cost to internal::scalar_div_cost (with some specializations in arch/SSE and arch/AVX) 2016-09-08 08:36:27 +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
3cb914f332 bug #1266: remove CUDA guards on MatrixBase::<decomposition> definitions. (those used to break old nvcc versions that we propably don't care anymore) 2016-09-06 09:55:50 +02:00
Gael Guennebaud
dabc81751f Fix compilation when cuda_fp16.h does not exist. 2016-09-05 17:14:20 +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
efe2c225c9 bug #1283: add regression unit test 2016-08-31 13:04:29 +02:00
Gael Guennebaud
8c48d42530 Fix 4x4 inverse with non-linear destination 2016-08-30 23:16:38 +02:00
Gael Guennebaud
c57317035a Fix unit test for 1x1 matrices 2016-08-30 10:20:23 +02:00
Gael Guennebaud
7e029d1d6e bug #1271: add SparseMatrix::coeffs() methods returning a 1D view of the non zero coefficients. 2016-08-29 12:06:37 +02:00
Gael Guennebaud
a93e354d92 Add some pre-allocation unit tests (not working yet) 2016-08-29 11:08:44 +02:00
Gael Guennebaud
6cd7b9ea6b Fix compilation with cuda 8 2016-08-29 11:06:08 +02:00
Gael Guennebaud
441b7eaab2 Add support for non trivial scalar factor in sparse selfadjoint * dense products, and enable +=/-= assignement for such products.
This changeset also improves the performance by working on column of the result at once.
2016-08-24 13:06:34 +02:00
Gael Guennebaud
8132a12625 bug #1268: detect faillure in LDLT and report them through info() 2016-08-23 23:15:55 +02:00
Gael Guennebaud
326320ec7b Fix compilation in non C++11 mode. 2016-08-23 19:28:57 +02:00
Gael Guennebaud
00b2666853 bug #645: patch from Tobias Wood implementing the extraction of eigenvectors in GeneralizedEigenSolver 2016-08-23 17:37:38 +02:00
Gael Guennebaud
504a4404f1 Optimize expression matching "d?=a-b*c" as "d?=a; d?=b*c;" 2016-08-23 16:52:22 +02:00
Gael Guennebaud
e47a8928ec Fix compilation in check_for_aliasing due to ambiguous specializations 2016-08-23 16:19:10 +02:00
Gael Guennebaud
82147cefff Fix possible overflow and biais in integer random generator 2016-08-23 13:25:31 +02:00
Christoph Hertzberg
c83b754ee0 bug #1272: Disable assertion when total number of columns is zero.
Also moved assertion to finished() method and adapted unit-test
2016-08-12 15:15:34 +02:00
Igor Babuschkin
aee693ac52 Add log1p support for CUDA and half floats 2016-08-08 20:24:59 +01:00
Christoph Hertzberg
3e4a33d4ba bug #1272: Let CommaInitializer work for more border cases (enhances fix of bug #1242).
The unit test tests all combinations of 2x2 block-sizes from 0 to 3.
2016-08-08 17:26:48 +02:00
Benoit Steiner
373bb12dc6 Check that it's possible to forward declare the hlaf type. 2016-08-03 16:07:31 -07:00
Gael Guennebaud
7995cec90c Fix vectorization logic for coeff-based product for some corner cases. 2016-07-31 15:20:22 +02:00
Gael Guennebaud
fd2f989b1d Fix testing of nearly zero input matrices. 2016-07-26 14:46:02 +02:00
Gael Guennebaud
c9e3e438eb Add more very small numbers in the list of nearly "zero" values when testing SVD and EVD algorithms 2016-07-26 14:45:44 +02:00
Gael Guennebaud
757971e7ea bug #1258: fix compilation of Map<SparseMatrix>::coeffRef 2016-07-26 09:40:19 +02:00
Gael Guennebaud
9908020d36 Add minimal support for Array<string>, and fix Tensor<string> 2016-07-25 14:25:56 +02:00
Gael Guennebaud
4184a3e544 Extend boost.multiprec unit test with ET on, complexes, and general/generalized eigenvalue solvers. 2016-07-25 12:36:22 +02:00
Gael Guennebaud
1b2049fbda Enforce scalar types in calls to max/min (helps with expression template scalar types) 2016-07-25 12:35:10 +02:00
Gael Guennebaud
32d95e86c9 merge 2016-07-22 16:43:12 +02:00
Gael Guennebaud
60d5980a41 add a note 2016-07-22 15:46:23 +02:00
Gael Guennebaud
24af67a6cc Fix boostmultiprec for C++03 2016-07-22 15:30:54 +02:00
Gael Guennebaud
d075d122ea Move half unit test from unsupported to main tests 2016-07-22 14:34:19 +02:00
Gael Guennebaud
72950effdf enable testing of Boost.Multiprecision with expression templates 2016-07-20 18:21:30 +02:00
Gael Guennebaud
b64b9d0172 Add a unit test to stress our solvers with Boost.Multiprecision 2016-07-20 15:20:14 +02:00
Gael Guennebaud
5e4dda8a12 Enable custom scalar types in some unit tests. 2016-07-20 15:19:17 +02:00
Gael Guennebaud
87d480d785 Make use of EIGEN_TEST_MAX_SIZE 2016-07-20 15:14:20 +02:00
Gael Guennebaud
9e8476ef22 Add missing Eigen::rsqrt global function 2016-07-20 11:59:49 +02:00
Gael Guennebaud
db9b154193 Add missing non-const reverse method in VectorwiseOp. 2016-07-16 15:19:28 +02:00
Gael Guennebaud
263993a7b6 Fix test for nearly null input 2016-07-12 17:19:26 +02:00
Benoit Steiner
03b71c273e Made the packetmath test compile again. A better fix would be to move the special function tests to the unsupported directory where the code now resides. 2016-07-11 13:50:24 -07:00
Gael Guennebaud
fd60966310 merge 2016-07-11 18:11:47 +02:00
Gael Guennebaud
57113e00f9 Relax strict equality 2016-07-09 23:37:11 +02:00
Gael Guennebaud
2f7e2614e7 bug #1232: refactor special functions as a new SpecialFunctions module, currently in unsupported/. 2016-07-08 11:13:55 +02:00
Gael Guennebaud
c684e37d32 Prevent division by zero. 2016-07-07 11:03:01 +02:00
Gael Guennebaud
5ca2457fa5 Fix unit test. 2016-07-06 22:25:24 +02:00
Gael Guennebaud
9b68ed4537 Relax is_equal to is_approx because scaling might modify last bit. 2016-07-06 15:02:49 +02:00
Gael Guennebaud
5b3a6f51d3 Improve numerical robustness of RealSchur: add scaling and compare sub-diag entries to largest diagonal entry instead of the 2 neighbors. 2016-07-06 13:45:30 +02:00
Gael Guennebaud
d2b5a19e0f Fix warning. 2016-07-06 11:05:30 +02:00
Gael Guennebaud
43696ede8f Revert unwanted changes. 2016-07-04 22:40:36 +02:00
Gael Guennebaud
b39fd8217f Fix nesting of SolveWithGuess, and add unit test. 2016-07-04 17:47:47 +02:00
Gael Guennebaud
fbcfc2f862 Add unit test for solveWithGuess, and fix template resolution. 2016-07-04 17:19:38 +02:00
Gael Guennebaud
32a41ee659 bug #707: add inplace decomposition through Ref<> for Cholesky, LU and QR decompositions. 2016-07-04 15:13:35 +02:00