Commit Graph

57 Commits

Author SHA1 Message Date
Gael Guennebaud
dada863d23 Enable unit tests of PartialPivLU on fixed size matrices, and increase tested matrix size (blocking was not tested!) 2019-02-11 17:56:20 +01:00
Patrick Peltzer
15e53d5d93 PR 567: makes all dense solvers inherit SoverBase (LU,Cholesky,QR,SVD).
This changeset also includes:
 * add HouseholderSequence::conjugateIf
 * define int as the StorageIndex type for all dense solvers
 * dedicated unit tests, including assertion checking
 * _check_solve_assertion(): this method can be implemented in derived solver classes to implement custom checks
 * CompleteOrthogonalDecompositions: add applyZOnTheLeftInPlace, fix scalar type in applyZAdjointOnTheLeftInPlace(), add missing assertions
 * Cholesky: add missing assertions
 * FullPivHouseholderQR: Corrected Scalar type in _solve_impl()
 * BDCSVD: Unambiguous return type for ternary operator
 * SVDBase: Corrected Scalar type in _solve_impl()
2019-01-17 01:17:39 +01:00
Gael Guennebaud
f566724023 Fix StorageIndex FIXME in dense LU solvers 2019-01-13 17:54:30 +01:00
Gael Guennebaud
efaf03bf96 Fix noise in lu unit test 2018-12-08 00:05:03 +01:00
Matthieu Vigne
8d7a73e48e bug #1617: Fix SolveTriangular.solveInPlace crashing for empty matrix.
This made FullPivLU.kernel() crash when used on the zero matrix.
Add unit test for FullPivLU.kernel() on the zero matrix.
2018-10-31 20:28:18 +01: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
12e1ebb68b Remove local Index typedef from unit-tests 2018-07-12 17:16:40 +02:00
Rasmus Munk Larsen
86e0ed81f8 Addresses comments on Eigen pull request PR-174.
* Get rid of code-duplication for real vs. complex matrices.
* Fix flipped arguments to select.
* Make the condition estimation functions free functions.
* Use Vector::Unit() to generate canonical unit vectors.
* Misc. cleanup.
2016-04-04 14:20:01 -07:00
Rasmus Munk Larsen
f54137606e Add condition estimation to Cholesky (LLT) factorization. 2016-04-01 16:19:45 -07:00
Rasmus Munk Larsen
91414e0042 Fix comments in ConditionEstimator and minor cleanup. 2016-04-01 11:58:17 -07:00
Rasmus Munk Larsen
1aa89fb855 Add matrix condition estimator module that implements the Higham/Hager algorithm from http://www.maths.manchester.ac.uk/~higham/narep/narep135.pdf used in LPACK. Add rcond() methods to FullPivLU and PartialPivLU. 2016-04-01 10:27:59 -07:00
Gael Guennebaud
0bb12fa614 Add LU::transpose().solve() and LU::adjoint().solve() API. 2015-12-01 14:38:47 +01:00
Rasmus Munk Larsen
1663d15da7 Add internal method _solve_impl_transposed() to LU decomposition classes that solves A^T x = b or A^* x = b. 2015-11-30 13:39:24 -08:00
Christoph Hertzberg
da2baf685d Regression test for bug #302
(transplanted from 80fd8fab87
)
Changed DenseIndex to Index
2015-04-26 21:05:33 +02:00
Gael Guennebaud
899c0c2b6c Clean source code and unit tests with respect to -Wunused-local-typedefs 2013-04-10 22:27:35 +02:00
Benoit Jacob
69124cfca2 Automatic relicensing to MPL2 using Keirs script. Manual fixup follows. 2012-07-13 14:42:47 -04: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
Gael Guennebaud
a8f66fec65 add the possibility to configure the maximal matrix size in the unit tests 2011-07-12 14:41:00 +02:00
Benoit Jacob
4716040703 bug #86 : use internal:: namespace instead of ei_ prefix 2010-10-25 10:15:22 -04:00
Hauke Heibel
f1679c7185 Utilize Index in all unit tests. 2010-06-20 17:37:56 +02:00
Hauke Heibel
1c9b7a8d9f Fighting for a green dashboard! Next warning's gone. 2010-06-08 16:02:22 +02:00
Adolfo Rodriguez Tsouroukdissian
28dde19e40 - Added problem size constructor to decompositions that did not have one. It preallocates member data structures.
- Updated unit tests to check above constructor.
- In the compute() method of decompositions: Made temporary matrices/vectors class members to avoid heap allocations during compute() (when dynamic matrices are used, of course).

These  changes can speed up decomposition computation time when a solver instance is used to solve multiple same-sized problems. An added benefit is that the compute() method can now be invoked in contexts were heap allocations are forbidden, such as in real-time control loops.

CAVEAT: Not all of the decompositions in the Eigenvalues module have a heap-allocation-free compute() method. A future patch may address this issue, but some required API changes need to be incorporated first.
2010-04-21 17:15:57 +02:00
Gael Guennebaud
7dd81aad74 factorize default performance related settings to a single file
included after the architecture specific files such that they
can be adapted by each platform.
2010-03-03 18:47:58 +01:00
Gael Guennebaud
7c98c04412 add reconstructedMatrix() to LLT, and LUs
=> they show that some improvements have still to be done
   for permutations, tr*tr, trapezoidal matrices
2010-02-24 19:16:10 +01:00
Benoit Jacob
d92df336ad Further LU test improvements. I'm not aware of any test failures anymore, not even with huge numbers of repetitions.
Finally the createRandomMatrixOfRank() function is renamed to createRandomPIMatrixOfRank, where PI stands for 'partial isometry', that is, a matrix whose singular values are 0 or 1.
2010-02-23 15:40:24 -05:00
Benoit Jacob
7dc75380c1 * FullPivLU: replace "remaining==0" termination condition (from Golub) by a fuzzy compare
(fixes lu test failures when testing solve())
* LU test: set appropriate threshold and limit the number of times that a specially tricky test
  is run. (fixes lu test failures when testing rank()).
* Tests: rename createRandomMatrixOfRank to createRandomProjectionOfRank
2010-02-23 09:04:59 -05:00
Hauke Heibel
abc8c01080 Renamed PlainMatrixType to PlainObject (Array != Matrix).
Renamed ReturnByValue::ReturnMatrixType ReturnByValue::ReturnType (again, Array != Matrix).
2010-02-20 15:53:57 +01:00
Benoit Jacob
828d058b4b EIGEN_ENUM_MIN ---> EIGEN_SIZE_MIN 2010-01-27 11:42:04 -05:00
Benoit Jacob
b90744dc05 Port FullPivLU to PermutationMatrix 2009-11-16 17:05:12 -05:00
Benoit Jacob
9a0900e33e last round of changes, mainly to return derived types instead of base types, and fix various compilation issues 2009-11-09 07:51:31 -05:00
Benoit Jacob
da363d997f introduce ei_xxx_return_value and ei_xxx_impl for xxx in solve,kernel,impl
put them in a new internal 'misc' directory
2009-11-03 02:18:10 -05:00
Benoit Jacob
6b48e932e9 *port the Cholesky module to the new solve() API
*improve documentation
2009-10-29 21:11:05 -04:00
Benoit Jacob
2840ac7e94 big huge changes, so i dont remember everything.
* renaming, e.g. LU ---> FullPivLU
* split tests framework: more robust, e.g. dont generate empty tests if a number is skipped
* make all remaining tests use that splitting, as needed.
* Fix 4x4 inversion (see stable branch)
* Transform::inverse() and geo_transform test : adapt to new inverse() API, it was also trying to instantiate inverse() for 3x4 matrices.
* CMakeLists: more robust regexp to parse the version number
* misc fixes in unit tests
2009-10-28 18:19:29 -04:00
Benoit Jacob
6c1b91678b kill ei_add_test_multi. Now the macro ei_add_test does all that automatically, by parsing the source file. No risk anymore to specify the wrong number of tests! Also, introduce CALL_SUBTESTX for X=1..10 that allows to port existing code much quicker. And port already the product* and eigensolver* files. 2009-10-19 14:40:35 -04:00
Benoit Jacob
580672ea43 Add new default option EIGEN_SPLIT_LARGE_TESTS and cmake macro ei_add_test_multi.
When enabled, large tests are split into smaller executables.
This needs minimal changes in the unit tests.
Updated the LU test to use it.
2009-10-19 13:29:00 -04:00
Benoit Jacob
9a700c2974 * LU unit test: finally test fixed sizes
* ReturnByValue: after all don't eval to temporary for generic MatrixBase impl
2009-10-19 10:56:37 -04:00
Benoit Jacob
47eeb40380 remove the m_originalMatrix member. Instead, image() now takes the original matrix as parameter. It was the only method to use it anyway. Introduce m_isInitialized. 2009-10-18 15:21:19 -04:00
Benoit Jacob
0255f28279 oops, didn't want to commit that 2009-10-18 01:35:07 -04:00
Benoit Jacob
8332c232db big huge changes in LU!
* continue the decomposition until a pivot is exactly zero;
  don't try to compute the rank in the decomposition itself.
* Instead, methods such as rank() use a new internal parameter
  called 'threshold' to determine which pivots are to be
  considered nonzero.
* The threshold is by default determined by defaultThreshold()
  but the user can override that by calling useThreshold(value).
* In solve/kernel/image, don't assume that the diagonal of U
  is sorted in decreasing order, because that's only approximately
  true. Additional work was needed to extract the right pivots.
2009-10-18 00:47:40 -04:00
Benoit Jacob
e82ab8a5dd move also inverse() to ReturnByValue, by doing a solve on NestByValue<Identity>.
also: adding resize() to MatrixBase was really needed ;)
2009-09-26 11:40:29 -04:00
Benoit Jacob
176c26feb5 allow to do xpr = solve(b) etc... just by adding a dummy MatrixBase::resize() 2009-09-22 01:41:09 -04:00
Benoit Jacob
4f9e270343 * make LU::kernel() and LU::image() also use ReturnByValue
* make them return zero vector in the degenerate case, instead of asserting
  (let's stick to the principle that we only assert on memory errors)
2009-09-22 00:16:51 -04:00
Benoit Jacob
ab5cc8284a convert LU::solve() to the new API 2009-09-22 20:58:29 -04:00
Benoit Jacob
154bdac9f4 small improvements 2009-08-24 00:09:01 -04:00
Benoit Jacob
7b750182f2 * polish computeInverseWithCheck to share more code, fix documentation, fix coding style
* add snippet for computeInverseWithCheck documentation
* expand unit-tests to cover computeInverseWithCheck
2009-06-29 22:07:37 +02:00
Benoit Jacob
7667a93cbe merge 2009-05-22 20:31:26 +02:00
Benoit Jacob
6347b1db5b remove sentence "Eigen itself is part of the KDE project."
it never made very precise sense. but now does it still make any?
2009-05-22 20:25:33 +02:00
Hauke Heibel
2c247fc8a8 LU and PartialLU decomposition interface unification.
Added default ctor and public compute method as well
as safe-guards against uninitialized usage.
Added unit tests for the safe-guards.
2009-05-22 14:27:58 +02:00
Hauke Heibel
6358c12998 * introduced method createRandomMatrixOfRank (R = U*D*V where U,V unitary, D r-by-c diag. with rank non-zero values)
* switched lu/qr tests to be using createRandomMatrixOfRank
* removed unused methods doSomeRankPreservingOperations
* removed NOTE about doSomeRankPreservingOperations
2009-05-17 16:07:12 +02:00
Benoit Jacob
9e3c73110a fix a bunch of warnings (actual issues) reported by Frank 2009-01-22 00:09:34 +00:00