Commit Graph

186 Commits

Author SHA1 Message Date
Gael Guennebaud
db030d4e28 * fix issues with "long double" type (useful to enforce the use of x87 registers)
* extend the documentation on "extending Eigen"
2008-09-14 11:59:10 +00:00
Gael Guennebaud
e5c50afed6 * Quaternion: added dot product and angularDistance functions. The latter is
based on the former.
* opengl_demo: makes IcoSphere better (vertices are instanciated only once) and
               removed the generation of a big geometry for the fancy spheres...
2008-09-11 11:19:34 +00:00
Gael Guennebaud
703539110b add the missing templated version of block for sub-vectors 2008-09-09 09:30:23 +00:00
Gael Guennebaud
52406aecad * Extend a bit ParametrizedLine and move it to a separate file,
add unit-tests for it.
* remove "using namespace std" in test/main.h such that the compilation
  bug found today in SVD won't happen again.
2008-09-03 22:35:45 +00:00
Gael Guennebaud
c29c7b0ea9 Fix bugs reported by Timothy Hunter:
* CholeskyWithoutSqrt with 1x1 matrices
 * .part<Diagonal>()
Updated unit tests to handle these cases
2008-09-03 20:52:26 +00:00
Gael Guennebaud
e14aa8c8aa Add coeff-wise comparisons to scalar operators. You can now write:
mat.cwise() < 2
instead of:
   mat.cwise() < MatrixType::Constant(mat.rows(), mat.cols(), 2)
2008-09-03 17:56:06 +00:00
Gael Guennebaud
59dc1da5bf Add a Select expression in the Array module which mimics a coeff-wise ?: operator.
Example:
  mat = (mat.cwise().abs().cwise() < Ones()).select(0,mat);
replaces all small values by 0. (the scalar version is "s = abs(s)<1 ? 0 : s")
2008-09-03 17:16:28 +00:00
Gael Guennebaud
3bbd1b3114 Bugfix regarding alignent in Assign.h (updated map unit test to detect this bug)
Anyway: LinearVectorization+CompleteUnrolling actually uses the InnerVectorization
unrollers, so these two cases could be merged to a single one...
2008-09-03 14:42:36 +00:00
Gael Guennebaud
75649551c2 compilation fixes with MSVC 2008-09-03 11:26:19 +00:00
Gael Guennebaud
f52d119b9c Solve a big issue with data alignment and dynamic allocation:
* add a WithAlignedOperatorNew class with overloaded operator new
* make Matrix (and Quaternion, Transform, Hyperplane, etc.) use it
  if needed such that "*(new Vector4) = xpr" does not failed anymore.
* Please: make sure your classes having fixed size Eigen's vector
  or matrice attributes inherit WithAlignedOperatorNew
* add a ei_new_allocator STL memory allocator to use with STL containers.
  This allocator really calls operator new on your types (unlike GCC's
  new_allocator). Example:
  std::vector<Vector4f> data(10);
  will segfault if the vectorization is enabled, instead use:
  std::vector<Vector4f,ei_new_allocator<Vector4f> > data(10);
NOTE: you only have to worry if you deal with fixed-size matrix types
with "sizeof(matrix_type)%16==0"...
2008-09-03 00:32:56 +00:00
Gael Guennebaud
d8df318d77 resurrected sparse triangular solver 2008-09-02 19:55:26 +00:00
Daniel Gomez Ferro
8fb1678f0f Extended sparse unit-test: nested blocks and InnerIterators.
Block specialization for sparse matrices.
InnerIterators for Blocks and fixes in CoreIterators.
2008-09-02 15:28:49 +00:00
Benoit Jacob
46fe7a3d9e if EIGEN_NICE_RANDOM is defined, the random functions will return numbers with
few bits left of the comma and for floating-point types will never return zero.
This replaces the custom functions in test/main.h, so one does not anymore need
to think about that when writing tests.
2008-09-01 17:31:21 +00:00
Gael Guennebaud
49ff9b204c remove the conceptualy broken "NoShear" transformation traits,
and rename NonAfine => Projective, GenericAffine => Affine, NoScaling => Isometry
2008-09-01 17:14:34 +00:00
Gael Guennebaud
7e8aa63bb7 * Add Hyperplane::transform(Matrix/Transform)
* Fix compilations with gcc 3.4, ICC and doxygen
* Fix krazy directives (hopefully)
2008-08-31 13:32:29 +00:00
Benoit Jacob
5c34d8e20a The discussed changes to Hyperplane, the ParametrizedLine class, and the
API update in Regression...
2008-08-31 04:25:30 +00:00
Gael Guennebaud
5c8c09e021 add uniform scale/prescale functions in Tranform 2008-08-30 23:10:46 +00:00
Gael Guennebaud
6ba991aa3a * added a RotationBase class following the CRT pattern
This allow code factorization and generic template specialization
  of functions
* added any_rotation * {Translation,Scaling,Transform} products methods
* rewrite of the actually broken ToRoationMatrix helper class to
  a global ei_toRotationMatrix function.
2008-08-30 20:11:04 +00:00
Gael Guennebaud
f1e6c56b77 * rename TranformationKnowledge to TransformTraits
* apply the same principle to extractRotation and fix it to
  extract a rotation corresponding to a positive scaling
2008-08-30 15:22:45 +00:00
Gael Guennebaud
236b7a545d update Transform::inverse() to take an optional argument stating whether the transformation is:
NonAffine, Affine (default), contains NoShear, contains NoScaling
that allows significant speed improvements. If you like it, this concept could be applied to
Transform::extractRotation (or to a more advanced decomposition function) and to Hyperplane::transformed()
and maybe to some other places... e.g., I think a Transform::normalMatrix() function would not harm and
warn user that the transformation of normals is not that trivial (I saw this mistake much too often)
2008-08-30 12:42:06 +00:00
Gael Guennebaud
9e7a9cde14 Add Scaling and Translation class as discussed on ML, still missing:
* handling Quaternion, AngleAxis and Rotation2D, 2 options here:
 1- make all of them inheriting a common base class Rotation such that we can
    have a single version of operator* for all the rotation type (they all get converted to a matrix)
 2- write a version for all type (so 3 rotations types * 3 for Transform,Translation and Scaling)
* real documentation
2008-08-30 00:08:23 +00:00
Gael Guennebaud
6d841512c7 some hyperplane changes:
- the coefficients are stored in a single vector
- added transformation methods
- removed Line* typedef since in 2D this is really an hyperplane
  and not really a line...
- HyperPlane => Hyperplane
2008-08-29 13:30:37 +00:00
Gael Guennebaud
7ea821d18e spelling + some krazy directives 2008-08-28 21:44:56 +00:00
Gael Guennebaud
9b4d46c82e * Add an HyperPlane class in the Geometry module
with its respective unit-test.
  Feel free to discuss the API on the ML.
* Some bugfix in unitOrthogonal found by the hyperplane unit test.
2008-08-28 17:44:27 +00:00
Gael Guennebaud
d2b345e6a9 bugfix in test/packetmath.h 2008-08-25 14:19:57 +00:00
Benoit Jacob
5ac883b10a Fix a bug discovered in Avogadro: the AngleAxis*Matrix and the newer
AngleAxis*Vector products were wrong because they returned the product
_expression_
   toRotationMatrix()*other;
and toRotationMatrix() died before that expression would be later
evaluated. Here it would not have been practical to NestByValue as this
is a whole matrix. So, let them simply evaluate and return the result by
value.

The geometry.cpp unit-test only checked for compatibility between
various rotations, it didn't check the correctness of the rotations
themselves. That's why this bug escaped us. So, this commit checks that
the rotations produced by AngleAxis have all the expected properties.
Since the compatibility with the other rotations is already checked,
this should validate them as well.
2008-08-24 23:16:51 +00:00
Benoit Jacob
251ecc0ab9 Rename someOrthogonal to unitOrthogonal. Fix a bug in it, with dyn-size vectors of size <=3.
Update doc and test to reflect that it always returns a unit vector.
2008-08-24 17:31:03 +00:00
Gael Guennebaud
aeca7a63f4 nothing to see here 2008-08-24 16:00:53 +00:00
Gael Guennebaud
bf17467ce0 bugfix in Product and ei_L2_block_traits 2008-08-24 16:00:17 +00:00
Gael Guennebaud
440664cd5d temporary fix of the pèrevious commit 2008-08-24 15:27:05 +00:00
Gael Guennebaud
ba100998bf * split Meta.h to Meta.h (generic meta programming) and XprHelper.h (relates to eigen mechanism)
* added a meta.cpp unit test
* EIGEN_TUNE_FOR_L2_CACHE_SIZE now represents L2 block size in Bytes (whence the ei_meta_sqrt...)
* added a CustomizeEigen.dox page
* added a TOC to QuickStartGuide.dox
2008-08-24 15:15:32 +00:00
Gael Guennebaud
bfe86b8fc0 * add documentation of the cool (?) "print with format" feature
* move the ioformat.cpp test to a documentation example
* rename IoFormat => IOFormat
2008-08-23 19:41:00 +00:00
Gael Guennebaud
f2f48b6560 * remove LargeBit and related stuff
* replaced the Flags template parameter of Matrix by StorageOrder
  and move it back to the 4th position such that we don't have to
  worry about the two Max* template parameters
* extended EIGEN_USING_MATRIX_TYPEDEFS with the ei_* math functions
2008-08-23 17:11:44 +00:00
Gael Guennebaud
2120fed849 * bug fixes in: Dot, generalized eigen problem, singular matrix detetection in Cholesky
* fix all numerical instabilies in the unit tests, now all tests can be run 2000 times
  with almost zero failures.
2008-08-23 15:14:20 +00:00
Gael Guennebaud
0e60e22151 extended cwise unit tests to cover all Cwise API 2008-08-22 22:49:09 +00:00
Gael Guennebaud
f0394edfa7 * bugfix in SolveTriangular found by Timothy Hunter (did not compiled for very small fixed size matrices)
* bugfix in Dot unroller
* added special random generator for the unit tests and reduced the tolerance threshold by an order of magnitude
  this fixes issues with sum.cpp but other tests still failed sometimes, this have to be carefully checked...
2008-08-22 17:48:36 +00:00
Benoit Jacob
a814ebe180 fix a number of compiler errors and warnings with gcc 4.3. There was a missing
#include<algorithm> so I'm not sure how it compiled at all for you :)
2008-08-22 01:19:53 +00:00
Gael Guennebaud
58061f5ffc extend sparse unit test and more bugfix, major todo: finilize the SparseSetter 2008-08-21 18:40:56 +00:00
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
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
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
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
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
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
Gael Guennebaud
5546e963c9 bugfix in CholeskyWithoutSquareRoot::solve found by Timothy Hunter 2008-08-16 07:09:39 +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
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
b13148c358 renamed inverseProduct => solveTriangular 2008-08-09 20:06:25 +00:00