Commit Graph

118 Commits

Author SHA1 Message Date
Benoit Jacob
e27b2b95cf * rework Map, allow vectorization
* rework PacketMath and DummyPacketMath, make these actual template
specializations instead of just overriding by non-template inline
functions
* introduce ei_ploadt and ei_pstoret, make use of them in Map and Matrix
* remove Matrix::map() methods, use Map constructors instead.
2008-06-27 01:22:35 +00:00
Benoit Jacob
3b94436d2f * vectorize dot product, copying code from sum.
* make the conj functor vectorizable: it is just identity in real case,
  and complex doesn't use the vectorized path anyway.
* fix bug in Block: a 3x1 block in a 4x4 matrix (all fixed-size)
  should not be vectorizable, since in fixed-size we are assuming
  the size to be a multiple of packet size. (Or would you prefer
  Vector3d to be flagged "packetaccess" even though no packet access
  is possible on vectors of that type?)
* rename:
  isOrtho for vectors ---> isOrthogonal
  isOrtho for matrices ---> isUnitary
* add normalize()
* reimplement normalized with quotient1 functor
2008-06-24 15:13:00 +00:00
Benoit Jacob
8a967fb17c * implement slice vectorization. Because it uses unaligned
packet access, it is not certain that it will bring a performance
  improvement: benchmarking needed.
* improve logic choosing slice vectorization.
* fix typo in SSE packet math, causing crash in unaligned case.
* fix bug in Product, causing crash in unaligned case.
* add TEST_SSE3 CMake option.
2008-06-22 15:02:05 +00:00
Gael Guennebaud
8cef541b5a forgot to add the unit test array.cpp 2008-06-21 17:28:07 +00:00
Gael Guennebaud
32c5ea388e work on rotations in the Geometry module:
- convertions are done trough constructors and operator=
 - added a EulerAngles class
2008-06-21 15:01:49 +00:00
Gael Guennebaud
54238961d6 * added a pseudo expression Array giving access to:
- matrix-scalar addition/subtraction operators, e.g.:
       m.array() += 0.5;
   - matrix/matrix comparison operators, e.g.:
      if (m1.array() < m2.array()) {}
* fix compilation issues with Transform and gcc < 4.1
2008-06-20 12:38:03 +00:00
Gael Guennebaud
82c3cea1d5 * refactoring of Product:
* use ProductReturnType<>::Type to get the correct Product xpr type
  * Product is no longer instanciated for xpr types which are evaluated
  * vectorization of "a.transpose() * b" for the normal product (small and fixed-size matrix)
  * some cleanning
* removed ArrayBase
2008-06-19 17:33:57 +00:00
Gael Guennebaud
bc0c7c57ed Added an extensible mechanism to support any kind of rotation
representation in Transform via the template static class
ToRotationMatrix.
Added a lightweight AngleAxis class (similar to Rotation2D).
2008-06-15 17:22:41 +00:00
Gael Guennebaud
0ee6b08128 * split Product to a DiagonalProduct template specialization
to optimize matrix-diag and diag-matrix products without
  making Product over complicated.
* compilation fixes in Tridiagonalization and HessenbergDecomposition
  in the case of 2x2 matrices.
* added an Orientation2D small class with similar interface than Quaternion
  (used by Transform to handle 2D and 3D orientations seamlessly)
* added a couple of features in Transform.
2008-06-15 11:54:18 +00:00
Gael Guennebaud
fbbd8afe30 Started a Transform class in the Geometry module to represent
homography.
Fix indentation in Quaternion.h
2008-06-15 08:33:44 +00:00
Gael Guennebaud
4af7089ab8 * Added a generalized eigen solver for the selfadjoint case.
(as new members to SelfAdjointEigenSolver)
  The QR module now depends on Cholesky.
* Fix Transpose to correctly preserve the *TriangularBit.
2008-06-14 19:42:12 +00:00
Gael Guennebaud
f07f907810 Add QR and Cholesky module instantiations in the lib.
To try it with the unit tests set the cmake variable TEST_LIB to ON.
2008-06-14 13:02:41 +00:00
Gael Guennebaud
e3fac69f19 Added a Hessenberg decomposition class for both real and complex matrices.
This is the first step towards a non-selfadjoint eigen solver.
Notes:
 - We might consider merging Tridiagonalization and Hessenberg toghether ?
 - Or we could factorize some code into a Householder class (could also be shared with QR)
2008-06-08 15:03:23 +00:00
Benoit Jacob
869394ee8b fix some compile errors with gcc 4.3, some warnings, some documentation 2008-06-06 13:10:00 +00:00
Gael Guennebaud
60726f91a9 hack to to make the nomalloc unit test compiles with -pedantic 2008-06-04 10:15:48 +00:00
Gael Guennebaud
42ad9c4352 update of the eigeinsolver unit test to check complex 2008-06-03 18:04:36 +00:00
Gael Guennebaud
915587d03d * add CommaInitializer::finished to allow the use of (Matrix3() << v0, v1, v2).finished()
as an argument of a function. Other possibilities for the name could be "end" or "matrix" ??
* various update in Quaternion, in particular I added a lot of FIXME about the API options,
  these have to be discussed and fixed.
2008-06-03 15:50:09 +00:00
Gael Guennebaud
196f38f5db improved Quaternion class:
- Euler angles and angle axis conversions,
 - stable spherical interpolation
 - documentation
 - update the respective unit test
2008-06-03 13:43:29 +00:00
Gael Guennebaud
a9cf229e15 add a geometry unit test and fix a couple of typo in Quaternion.h 2008-06-03 07:32:12 +00:00
Gael Guennebaud
f2ebbee274 added unit tests for sizeof and dynamic memory allocation 2008-06-02 14:54:52 +00:00
Benoit Jacob
92b7e2d6a1 fix a couple of issues making the eigensolver test compile and run without aborting
on an assert. Had to fix a stupid bug in Block -- very strange we hadn't hit it
before.

However the test still fails.
2008-06-02 02:06:33 +00:00
Gael Guennebaud
d5cbb1d002 added a unit test for Inverse
discovered that m1 == m1.inverse().inverse() fails though
m1.inverse()*m1 == I
2008-05-31 23:44:11 +00:00
Gael Guennebaud
64169389ed added an *optional* Eigen2 dynamic library.
it allows the possiblity to save some compilation time by linking to it
*and* defining the token EIGEN_EXTERN_INSTANCIATIONS
2008-05-31 23:21:49 +00:00
Gael Guennebaud
310f7aa096 moved purely "array" related stuff to a new module Array.
This include:
 - cwise Pow,Sin,Cos,Exp...
 - cwise Greater and other comparison operators
 - .any(), .all() and partial reduction
 - random
2008-05-31 18:11:48 +00:00
Benoit Jacob
b501e08d81 now the unit-tests (hence all of Eigen) don't depend on Qt at all
anymore.
2008-05-29 03:37:16 +00:00
Benoit Jacob
486fdb26a1 many small fixes and documentation improvements,
this should be alpha5.
2008-05-29 03:12:30 +00:00
Benoit Jacob
aebecae510 * find the proper way of nesting the expression in Flagged:
finally that's more subtle than just using ei_nested, because when
  flagging with NestByValueBit we want to store the expression by value
  already, regardless of whether it already had the NestByValueBit set.
* rename temporary() ----> nestByValue()
* move the old Product.h to disabled/, replace by what was ProductWIP.h
* tweak -O and -g flags for tests and examples
* reorder the tests -- basic things go first
* simplifications, e.g. in many methoeds return derived() and count on
  implicit casting to the actual return type.
* strip some not-really-useful stuff from the heaviest tests
2008-05-28 04:38:16 +00:00
Gael Guennebaud
559233c73e * fix the QR module to use extract/part instead of the previous triangular stuff
* added qr and eigensolver tests
* fix a compilation warning in Matrix copy constructor
2008-05-27 09:16:27 +00:00
Benoit Jacob
953efdbfe7 - introduce Part and Extract classes, splitting and extending the former
Triangular class
- full meta-unrolling in Part
- move inverseProduct() to MatrixBase
- compilation fix in ProductWIP: introduce a meta-selector to only do
  direct access on types that support it.
- phase out the old Product, remove the WIP_DIRTY stuff.
- misc renaming and fixes
2008-05-27 05:47:30 +00:00
Gael Guennebaud
106a0c1bef restored the product test 2008-05-22 12:35:09 +00:00
Gael Guennebaud
522e24f2d7 update of the testing framework:
replaced the QTestLib framework my custom macros
and a (optional) custom script to run the tests from ctest.
2008-05-22 12:18:55 +00:00
Gael Guennebaud
f0eb3d2d3b updated product test to carefully test all scalar types
and fix an issue in the triangular test
2008-05-12 10:26:10 +00:00
Benoit Jacob
8c6007f80e * Patch by Konstantinos Margaritis: AltiVec vectorization.
* Fix several warnings, temporarily disable determinant test.
2008-05-03 12:21:23 +00:00
Gael Guennebaud
e19f9bc523 added a test for triangular matrices 2008-05-02 11:35:59 +00:00
Gael Guennebaud
64bacf1c3f * added ei_sqrt for complex
* updated Cholesky to support complex
* correct result_type for abs and abs2 functors
2008-04-27 14:05:40 +00:00
Gael Guennebaud
4ffffa670e added Cholesky module 2008-04-27 10:57:32 +00:00
Gael Guennebaud
1ec2d21ca5 Fixed a couple of issues introduced in previous commits.
Added a test for Triangular.
2008-04-26 20:28:27 +00:00
Gael Guennebaud
173e582e3c added a tough test to check the determinant that currently fails 2008-04-25 23:13:20 +00:00
Benoit Jacob
dcebc46cdc - cleaner use of OpenMP (no code duplication anymore)
using a macro and _Pragma.
- use OpenMP also in cacheOptimalProduct and in the
  vectorized paths as well
- kill the vector assignment unroller. implement in
  operator= the logic for assigning a row-vector in
  a col-vector.
- CMakeLists support for building tests/examples
  with -fopenmp and/or -msse2
- updates in bench/, especially replace identity()
  by ones() which prevents underflows from perturbing
  bench results.
2008-04-11 14:28:42 +00:00
Gael Guennebaud
1985fb0551 Added initial experimental support for explicit vectorization.
Currently only the following platform/operations are supported:
 - SSE2 compatible architecture
 - compiler compatible with intel's SSE2 intrinsics
 - float, double and int data types
 - fixed size matrices with a storage major dimension multiple of 4 (or 2 for double)
 - scalar-matrix product, component wise: +,-,*,min,max
 - matrix-matrix product only if the left matrix is vectorizable and column major
   or the right matrix is vectorizable and row major, e.g.:
   a.transpose() * b is not vectorized with the default column major storage.
To use it you must define EIGEN_VECTORIZE and EIGEN_INTEL_PLATFORM.
2008-04-09 12:31:55 +00:00
Gael Guennebaud
b4a156671f * make use of the EvalBeforeNestingBit and EvalBeforeAssigningBit
in ei_xpr_copy and operator=, respectively.
 * added Matrix::lazyAssign() when EvalBeforeAssigningBit must be skipped
   (mainly internal use only)
 * all expressions are now stored by const reference
 * added Temporary xpr: .temporary() must be called on any temporary expression
   not directly returned by a function (mainly internal use only)
 * moved all functors in the Functors.h header
 * added some preliminaries stuff for the explicit vectorization
2008-04-05 11:10:54 +00:00
Gael Guennebaud
048910caae * added cwise comparisons
* added "all" and "any" special redux operators
 * added support bool matrices
 * added support for cost model of STL functors via ei_functor_traits
  (By default ei_functor_traits query the functor member Cost)
2008-04-03 18:13:27 +00:00
Benoit Jacob
d1a29d6319 -new: recursive costs system, useful to determine automatically
when to evaluate arguments and when to meta-unroll.
-use it in Product to determine when to eval args. not yet used
 to determine when to unroll. for now, not used anywhere else but
 that'll follow.
-fix badness of my last commit
2008-04-03 11:10:17 +00:00
Benoit Jacob
cff5e3ce9c Make use of the LazyBit, introduce .lazy(), remove lazyProduct. 2008-03-31 16:20:06 +00:00
Benoit Jacob
f279162ec4 * introducte recursive Flags system for the expressions
-- currently 3 flags: RowMajor, Lazy and Large
 -- only RowMajor actually used for now
* many minor improvements
2008-03-30 18:43:22 +00:00
Benoit Jacob
a994e51c96 * add Gael copyright lines on 2 more files
* macro renaming: EIGEN_NDEBUG becomes EIGEN_NO_DEBUG
  as this is much better (and similar to Qt) and
  EIGEN_CUSTOM_ASSERT becomes EIGEN_USE_CUSTOM_ASSERT
* protect Core header by a EIGEN_CORE_H
2008-03-26 09:13:11 +00:00
Gael Guennebaud
908a0fbab5 small fix of VERIFY_ASSERT in debug mode 2008-03-13 09:51:18 +00:00
Benoit Jacob
afc64f3332 a lot of renaming
internal classes: AaBb -> ei_aa_bb
IntAtRunTimeIfDynamic -> ei_int_if_dynamic
unify UNROLLING_LIMIT (there was no reason to have operator= use
a higher limit)
etc...
2008-03-13 09:33:26 +00:00
Gael Guennebaud
16257d44dd fixed an issue with VERIFY_ASSERT 2008-03-12 18:44:42 +00:00
Gael Guennebaud
35bce20954 Removed Column and Row in favor of Block 2008-03-12 18:10:52 +00:00