Commit Graph

479 Commits

Author SHA1 Message Date
Gael Guennebaud
60804c306d *patch by Daniel Gomez:
- bugfix in SparseMatrix
 - add a sparse unit test
* renamed Transform::affine => linear
2008-08-21 17:02:47 +00:00
Benoit Jacob
082e309d2a patch by Patrick Spendrin: fix MSVC compatibility 2008-08-21 16:17:51 +00:00
Gael Guennebaud
67813e01bf disable the vectorization of div for AltiVec 2008-08-21 14:03:17 +00:00
Gael Guennebaud
f729fc1d70 * Add the possibility to customize the output of matrices, e.g.:
IoFormat OctaveFmt(4, AlignCols, ", ", ";\n", "", "", "[", "]");
   cout << mat.format(OctaveFmt);
  The first "4" is the precision.
  Documentation missing.
* Some compilation fixes
2008-08-21 13:17:21 +00:00
Benoit Jacob
591d497b84 add resize() methods to Map, doing nothing but assertions.
This is useful in Krita where I call lu().solve() with a Map object
as result. As solve() resizes the result, this was needed.
2008-08-21 04:36:48 +00:00
Gael Guennebaud
84a39e04bf added Sub matrices section and a couple of cross ref to the API doc 2008-08-20 23:04:58 +00:00
Gael Guennebaud
fd681507dc Add a packetmath unit test, re-enable the comma-initializer unit test,
and bug fix in PacketMath/SSE
2008-08-20 20:08:38 +00:00
Benoit Jacob
ff8e98c974 Fix bugs in Sum.h, add unit-test 2008-08-20 16:43:28 +00:00
Gael Guennebaud
c501c7a4ef * Fix CMakeLists.txt issue with SVD
* Fix on stack memory allocation issues
2008-08-20 15:58:01 +00:00
Gael Guennebaud
752ec27293 minor bugfix found using gcc-4.0 2008-08-20 14:05:57 +00:00
Gael Guennebaud
8afaeb4ad5 doc fixes, and extended Basic Linear Algebra and Reductions sections 2008-08-20 13:07:46 +00:00
Gael Guennebaud
db8fbf2b39 some updated of the quick start guide 2008-08-20 11:31:50 +00:00
Benoit Jacob
c705c38a23 * it's \returns not \Returns
* add some explanations in the typedefs page
* expand a bit the new QuickStartGuide. Some placeholders (not a pb since
it's not even yet linked to from other pages). The point I want to make is
that it's super important to have fully compilable short programs (even
with compile instructions for the first one) not just small snippets, at
least at the beginning. Let's start with examples of compilable programs.
2008-08-20 04:34:04 +00:00
Gael Guennebaud
8551fe28ce fix a few typos 2008-08-20 01:12:56 +00:00
Gael Guennebaud
7aba51ce53 * Added .all() and .any() members to PartialRedux
* Bug fixes in euler angle snippet, Assign and MapBase
* Started a "quick start guide" (draft state)
2008-08-20 00:58:25 +00:00
Gael Guennebaud
c6674ab076 missing SVD header file 2008-08-19 20:18:46 +00:00
Gael Guennebaud
104f8fd36e Added a SVD module:
- the decompostion code has been adfapted from JAMA
 - handles non square matrices of size MxN with M>=N
 - does not work for complex matrices
 - includes a solver where the parts corresponding to zero singular values are set to zero
2008-08-19 17:52:04 +00:00
Benoit Jacob
54137f1ca7 * fix bug found by Boudewijn Rempt: no CMakeLists in arch/ subdir
* fix warning in SolveTriangular
2008-08-19 13:15:13 +00:00
Gael Guennebaud
a6d387a359 Various compilation fixes for MSVC 9. All tests compile but some
still fail at runtime in ei_aligned_free() (even without vectorization).
2008-08-19 11:06:40 +00:00
Benoit Jacob
9466e5f94e * doc improvements in Cwise and PartialRedux:
- 33 new snippets
  - unfuck doxygen output in Cwise (issues with function macros)
  - more see-also links from outside, making Cwise more discoverable
* rename matrixNorm() to operatorNorm(). There are many matrix norms
  (the L2 is another one) but only one is called the operator norm.
  Risk of confusion with keyword operator is not too scary after all.
2008-08-19 04:30:28 +00:00
Gael Guennebaud
95dd09bea6 * revert the previous interface change in solveTriangular (pointer vs reference)
* remove the cast operators in the Geometry module: they are replaced by constructors
  and new operator= in Matrix
* extended the operations supported by Rotation2D
* rewrite in solveTriangular:
  - merge the Upper and Lower specializations
  - big optimization of the path for row-major triangular matrices
2008-08-18 22:17:42 +00:00
Benoit Jacob
e778ae2559 only use alloca on linux. Use malloc on other platforms. Needed for mingw
compatibility.
2008-08-18 16:36:47 +00:00
Benoit Jacob
baf0cffedd *add operator()(int) for vectors, synonymous to operator[](int).
I don't see any reason not to allow it, it doesn't add much code, and
 it makes porting from eigen1 easier.
*expand tests/basicstuff to first test coefficient access methods
2008-08-18 12:33:14 +00:00
Benoit Jacob
95a1283bf6 fix compilation of unit-tests when cmake is run on kdesupport/ parent
directory
2008-08-17 15:25:53 +00:00
Benoit Jacob
239b47e033 *make Eigen2 install to prefix/include/eigen2/Eigen
*Add FindEigen2.cmake module in kdelibs
2008-08-16 12:56:38 +00:00
Gael Guennebaud
5546e963c9 bugfix in CholeskyWithoutSquareRoot::solve found by Timothy Hunter 2008-08-16 07:09:39 +00:00
Benoit Jacob
d9d69de382 updated tutorial 2008-08-15 14:28:06 +00:00
Benoit Jacob
3bc2746928 Copy eigen2 into kdesupport, alongside eigen1 for now, co-installable,
will remove eigen1 once no code uses it anymore (soon).
2008-08-14 13:21:11 +00:00
Gael Guennebaud
8a3e6b1ee2 change solveTriangularInPlace() to take a pointer as input (as discussed on IRC).
extended the documentation of the triangular solver.
2008-08-12 07:49:59 +00:00
Benoit Jacob
13ad88736e last small fixes, this is alpha6, eigen2 is now ready for eigen1 apps to
port to.
2008-08-12 02:14:02 +00:00
Benoit Jacob
f04c1cb774 Complete LU documentation 2008-08-11 21:26:37 +00:00
Benoit Jacob
17ec407ccd * add Regression module, from eigen1, improved, with doc and unit-test.
* fix .normalized() so that Random().normalized() works; since the return
type became complicated to write down i just let it return an actual
vector, perhaps not optimal.
* add Sparse/CMakeLists.txt. I suppose that it was intentional that it
didn't have CMakeLists, but in <=2.0 releases I'll just manually remove
Sparse.
2008-08-11 02:25:40 +00:00
Gael Guennebaud
55e8d670ce Renamed allowAligned() => forceAligned() and added the constants ForceAligned
and AsRequested for the PacketAccess parameter of MapBase. Updated respective
documentation.
2008-08-09 21:57:50 +00:00
Gael Guennebaud
b13148c358 renamed inverseProduct => solveTriangular 2008-08-09 20:06:25 +00:00
Benoit Jacob
d6e88f8155 * add LU unit-test. Seems like we have very good numerical stability!
* some cleanup, and grant me a copyright line on the determinant test.
2008-08-09 19:26:14 +00:00
Gael Guennebaud
4fa40367e9 * Big change in Block and Map:
- added a MapBase base xpr on top of which Map and the specialization
    of Block are implemented
  - MapBase forces both aligned loads (and aligned stores, see below) in expressions
    such as "x.block(...) += other_expr"
* Significant vectorization improvement:
 - added a AlignedBit flag meaning the first coeff/packet is aligned,
   this allows to not generate extra code to deal with the first unaligned part
 - removed all unaligned stores when no unrolling
 - removed unaligned loads in Sum when the input as the DirectAccessBit flag
* Some code simplification in CacheFriendly product
* Some minor documentation improvements
2008-08-09 18:41:24 +00:00
Benoit Jacob
becbeda50a * reimplement the general case of inverse() on top of LU. Advantages:
- removes much code
  - 2.5x faster (even though LU uses complete pivoting contrary to what
inverse used to do!)
  - there _were_ numeric stability problems with the partial pivoting
approach of inverse(), with 200x200 matrices inversion failed almost
half of the times (overflow). Now these problems are solved thanks to
complete pivoting.

* remove some useless stuff in LU
2008-08-09 15:50:07 +00:00
Benoit Jacob
681e944670 *implement LU solver (solves any rectangular system)
*in test/CMakeLists : modify EI_ADD_TEST so that 2nd argument is
additional compiler flags. used to add -O2 to test_product_large so it
doesn't take forever.
2008-08-09 15:23:54 +00:00
Benoit Jacob
a41f2b4216 * fix bug in SwapWrapper : store the wrapped expression by reference
* optimize setIdentity: when the matrix is large enough it is better to
  setZero() and overwrite the diagonal
* start of LU solver, disabled for now
2008-08-09 04:37:09 +00:00
Benoit Jacob
9bbe396939 forgot to remove that old code 2008-08-07 21:50:29 +00:00
Benoit Jacob
5f350448e1 - add kernel computation using the triangular solver
- take advantage of the fact that our LU dec sorts the eigenvalues of U
in decreasing order
- add meta selector in determinant
2008-08-07 21:48:21 +00:00
Benoit Jacob
58ba9ca72f LU: remove partial-pivoting path (moderately useful since it's does
not allow to easily get the rank), fix a bug (which could have been
triggered by matrices having coefficients of very different
magnitudes).
Part: add an assert to prevent hard to find bugs
Swap: update comments
2008-08-07 04:31:05 +00:00
Benoit Jacob
88bb2087c1 New implementation of Swap as discussed, reusing Assign. Makes LU run
10% faster overall.
2008-08-05 21:55:57 +00:00
Benoit Jacob
c94be35bc8 introduce copyCoeff and copyPacket methods in MatrixBase, used by
Assign, in preparation for new Swap impl reusing Assign code.
remove last remnant of old Inverse class in Transform.
2008-08-05 18:00:23 +00:00
Benoit Jacob
09ef7db9d9 Add partial pivoting runtime option to LU.
Note: in fact, inverse() always uses partial pivoting because the algo
currently used doesn't make sense with complete pivoting. No num
stability issue so far even with size 200x200. If there is any problem
we can of course reimplement inverse on top of LU.
2008-08-05 15:43:11 +00:00
Benoit Jacob
e741b7beca further big perf improvement in Inverse 2008-08-04 23:47:09 +00:00
Benoit Jacob
79a0feee68 big performance improvement in inverse and LU 2008-08-04 23:34:21 +00:00
Gael Guennebaud
a7a05382d1 Add a LU decomposition action in BTL and various cleaning in BTL. For instance
all per plot settings have been moved to a single file, go_mean now takes an
optional second argument "tiny" to generate plots for tiny matrices, and
output of comparison information wrt to previous benchs (if any).
2008-08-04 23:12:48 +00:00
Benoit Jacob
c2f8ecf466 * LU decomposition, supporting all rectangular matrices, with full
pivoting for better numerical stability. For now the only application is
determinant.
* New determinant unit-test.
* Disable most of Swap.h for now as it makes LU fail (mysterious).
Anyway Swap needs a big overhaul as proposed on IRC.
* Remnants of old class Inverse removed.
* Some warnings fixed.
2008-08-04 04:45:59 +00:00
Gael Guennebaud
f81dfcf00b fix two perf issues in product.
fix positive definite test in Cholesky.
remove #include <cstring> in CoreDeclaration.
2008-08-03 20:23:06 +00:00