Commit Graph

385 Commits

Author SHA1 Message Date
Gael Guennebaud
52cf07d266 sparse module:
* add row(i), col(i) functions
* add prune() function to remove small coefficients
2009-01-21 18:46:04 +00:00
Benoit Jacob
5f43a42ee7 * remove set(), revert to old behavior where = resizes
* try to be clever in matrix ctors and operator=: be lazy when we can, always allow
  to copy rowvector into columnvector, check the template parameters,
  try to factor the code better
* add missing copy ctor in UnalignedType
* fix bug in the traits of DiagonalProduct
* renaming: EIGEN_TUNE_FOR_CPU_CACHE_SIZE
* update the dox a little
2009-01-21 17:10:23 +00:00
Marijn Kruisselbrink
a5fbf27843 don't claim googlehash is there when only qt4 has been found :) 2009-01-20 22:15:51 +00:00
Benoit Jacob
294682a25a lu test:don't fail 2009-01-20 19:06:39 +00:00
Gael Guennebaud
f645d1f911 * complete the support of QVector via a QtAlignedMalloc header
* add a unit test for QVector which shows the issue with QVector::fill
2009-01-20 16:50:47 +00:00
Gael Guennebaud
3134d5290b forgot to include the update of the qr test 2009-01-20 10:38:56 +00:00
Gael Guennebaud
36c478cd6e optimize A * v product for A sparse and row major 2009-01-19 22:29:28 +00:00
Gael Guennebaud
178858f1bd add a flexible sparse matrix class designed for fast matrix assembly 2009-01-19 15:20:45 +00:00
Gael Guennebaud
ccdcebcf03 Sparse module: add support for sparse selfadjoint * dense 2009-01-15 18:52:14 +00:00
Gael Guennebaud
9a4b7998cf Sparse module: add row/col methods to the iterators 2009-01-15 14:16:41 +00:00
Gael Guennebaud
87241089e1 Sparse module: bugfix in SparseMatrix::resize(), now the indices are
correctly initialized to 0.
2009-01-15 13:30:50 +00:00
Gael Guennebaud
2d53466fa9 Sparse module:
* improved performance of mat*=scalar
* bug fix in cwise*
2009-01-14 21:27:54 +00:00
Gael Guennebaud
0b606dcccd Add support for sparse * dense and dense * sparse matrix/vector products 2009-01-14 17:41:55 +00:00
Gael Guennebaud
c4c70669d1 Big rewrite in the Sparse module: SparseMatrixBase no longer inherits MatrixBase.
That means a lot of features which were available for sparse matrices
via the dense (and super slow) implemention are no longer available.
All features which make sense for sparse matrices (aka can be implemented efficiently) will be
implemented soon, but don't expect to see an API as rich as for the dense path.
Other changes:
* no block(), row(), col() anymore.
* instead use .innerVector() to get a col or row vector of a matrix.
* .segment(), start(), end() will be back soon, not sure for block()
* faster cwise product
2009-01-14 14:24:10 +00:00
Gael Guennebaud
ee87f5ee49 s/EIGEN_WORK_DIRECTORY/EIGEN_WORK_DIR in testsuite script 2009-01-14 10:43:36 +00:00
Gael Guennebaud
62d01d3cf4 hm it seems cmake does not understand CYGWIN (=> UNIX) 2009-01-12 19:39:50 +00:00
Gael Guennebaud
534dc60672 improved a bit the testsuite script 2009-01-12 18:10:41 +00:00
Benoit Jacob
4d44ca226e * make std::vector specializations also for Transform and for Quaternion
* update test_stdvector
* Quaternion() does nothing (instead of bug)
* update test_geometry
* some renaming
2009-01-12 16:06:04 +00:00
Gael Guennebaud
9d97c06d9d fix a warning in test/alignedbox 2009-01-12 15:29:51 +00:00
Gael Guennebaud
1fc17c4792 remove stupid output in test/meta 2009-01-12 15:27:25 +00:00
Benoit Jacob
336ad58213 * move cwise *= and /= to Core (like * and /)
* tidy the StdVector module
* fix warnings (especially a | instead of ||) in stdvector test
2009-01-12 13:41:40 +00:00
Gael Guennebaud
af5034b3c0 add a clean configuration summary for the unit tests (useful to analyze the dashboards) 2009-01-12 13:40:02 +00:00
Gael Guennebaud
7f881e814f another warning fix 2009-01-12 13:01:31 +00:00
Gael Guennebaud
b365f443a2 make the testsuite works on windows with nmake 2009-01-12 12:53:41 +00:00
Gael Guennebaud
484ed3bbe2 fix a warning in test/sparse.h 2009-01-12 12:52:36 +00:00
Gael Guennebaud
92959aa5f3 add the possiblity to disable Fortran (workaround cmake's bug 2009-01-12 12:51:40 +00:00
Gael Guennebaud
2db5888253 update testsuite script 2009-01-12 11:55:52 +00:00
Gael Guennebaud
9e8f437a6f extend stdvector test with more push_back... 2009-01-11 21:59:04 +00:00
Benoit Jacob
824b75f182 forgot to commit updated test 2009-01-11 21:04:23 +00:00
Benoit Jacob
0c1ef2f4c6 make the std::vector fix work also with dynamic size Eigen objects, e.g.
std::vector<VectorXd>
update unit test
2009-01-10 13:10:23 +00:00
Benoit Jacob
3efe6e4176 remove ei_new_allocator
remove corresponding part of test_dynalloc
2009-01-10 02:50:09 +00:00
Benoit Jacob
335d3bcf05 Based on code + help from Alex Stapleton:
*Add Eigen/StdVector header.
Including it #includes<vector> and "Core" and generates a partial
specialization of std::vector<T> for T=Eigen::Matrix<...>
that will work even with vectorizable fixed-size Eigen types
(working around a design issue in the c++ STL)
*Add unit-test

CCMAIL: alex.stapleton@gmail.com
2009-01-09 23:26:45 +00:00
Benoit Jacob
fd831d5a12 * implement handmade aligned malloc, fast but always wastes 16 bytes of memory.
only used as fallback for now, needs benchmarking.
  also notice that some malloc() impls do waste memory to keep track of alignment
  and other stuff (check msdn's page on malloc).
* expand test_dynalloc to cover low level aligned alloc funcs. Remove the old
  #ifdef EIGEN_VECTORIZE...
* rewrite the logic choosing an aligned alloc, some new stuff:
  * malloc() already aligned on freebsd and windows x64 (plus apple already)
  * _mm_malloc() used only if EIGEN_VECTORIZE
  * posix_memalign: correct detection according to man page (not necessarily
    linux specific), don't attempt to declare it if the platform didn't declare it
    (there had to be a reason why it didn't declare it, right?)
2009-01-09 14:56:44 +00:00
Gael Guennebaud
b315f4c359 add a ctest testsuite.cmake script to simplify the generation of nightly builds 2009-01-08 18:38:58 +00:00
Benoit Jacob
eb7dcbbfce EIGEN_MAKE_ALIGNED_OPERATOR_NEW didn't actually need to get the class
name as parameter
2009-01-08 15:37:13 +00:00
Benoit Jacob
1d52bd4cad the big memory changes. the most important changes are:
ei_aligned_malloc now really behaves like a malloc
 (untyped, doesn't call ctor)
ei_aligned_new is the typed variant calling ctor
EIGEN_MAKE_ALIGNED_OPERATOR_NEW now takes the class name as parameter
2009-01-08 15:20:21 +00:00
Gael Guennebaud
af27fb7590 Add cdash.org support:
* the dashboard is there: http://my.cdash.org/index.php?project=Eigen
* now you can run the tests from the top build dir
  and submit report like that (from the top build dir):
  ctest -D Experimental
* todo:
 - add some nighlty builds (I'll add a few on my computer)
 - add valgrind memory checks, performances tests, compilation time tests, etc.
2009-01-08 11:53:21 +00:00
Gael Guennebaud
cb71dc4bbf Add a vectorization_logic unit test for assign and sum.
Need to add dot and more tests, but it seems I've already
found some room for improvement in sum.
2009-01-07 22:20:03 +00:00
Gael Guennebaud
709e903335 Sparse module:
* extend unit tests
* add support for generic sum reduction and dot product
* optimize the cwise()* : this is a special case of CwiseBinaryOp where
  we only have to process the coeffs which are not null for *both* matrices.
  Perhaps there exist some other binary operations like that ?
2009-01-07 17:01:57 +00:00
Benoit Jacob
2db434265b remove the Matrix_ prefix 2009-01-06 18:07:16 +00:00
Benoit Jacob
1c29d70312 * introduce macros to replace inheritance for operator new overloading
(former solution still available and tested)
  This plays much better with classes that already have base classes --
  don't force the user to mess with multiple inheritance, which gave
  much trouble with MSVC.
* Expand the unaligned assert dox page
* Minor fixes in the lazy evaluation dox page
2009-01-06 03:16:50 +00:00
Benoit Jacob
7db3f2f72a *fix compilation with MSVC 2005 in the Transform::construct_from_matrix
*fix warnings with MSVC 2005: converting M_PI to float gives loss-of-precision warnings
2009-01-05 14:47:38 +00:00
Armin Berres
dae7f065d4 didn't meant to commit the fortran check. but anyway, unfortunately it doesn't work the way iot should. the test fails and cmake will terminate if it doesn't find a fortran compiler 2009-01-05 14:40:27 +00:00
Armin Berres
ab660a4d29 inherit from ei_with_aligned_operator_new even with disabled vectorization 2009-01-05 14:35:07 +00:00
Benoit Jacob
986f301233 *add PartialRedux::cross() with unit test
*add transform-from-matrices test
*undo an unwanted change in Matrix
2009-01-05 14:26:34 +00:00
Benoit Jacob
e1ee876daa fix segfault due to non-aligned packets 2009-01-04 23:23:32 +00:00
Benoit Jacob
269bf67796 rename Regression --> LeastSquares 2009-01-04 15:55:54 +00:00
Benoit Jacob
15ca6659ac * the 4th template param of Matrix is now Options. One bit for storage
order, one bit for enabling/disabling auto-alignment. If you want to
disable, do:
Matrix<float,4,1,Matrix_DontAlign>
The Matrix_ prefix is the only way I can see to avoid
ambiguity/pollution. The old RowMajor, ColMajor constants are
deprecated, remain for now.
* this prompted several improvements in matrix_storage. ei_aligned_array
renamed to ei_matrix_array and moved there. The %16==0 tests are now
much more centralized in 1 place there.
* unalignedassert test: updated
* update FindEigen2.cmake from KDElibs
* determinant test: use VERIFY_IS_APPROX to fix false positives; add
testing of 1 big matrix
2009-01-04 15:26:32 +00:00
Benoit Jacob
d9e5fd393a * In LU solvers: no need anymore to use row-major matrices
* Matrix: always inherit WithAlignedOperatorNew, regardless of
vectorization or not
* rename ei_alloc_stack to ei_aligned_stack_alloc
* mixingtypes test: disable vectorization as SSE intrinsics don't allow
mixing types and we just get compile errors there.
2009-01-03 22:33:08 +00:00
Benoit Jacob
d671205755 fix the nomalloc test: it didn't catch the ei_stack_alloc in
cachefriendlyproduct, that should be banned as well as depending on the
platform they can give a malloc, and they could happen even with (large
enough) fixed size matrices. Corresponding fix in Product.h:
cachefriendly is now only used for dynamic matrices -- fixedsize, no
matter how large, doesn't use the cachefriendly product. We don't need
to care (in my opinion) about performance for large fixed size, as large
fixed size is a bad idea in the first place and it is more important to
be able to guarantee clearly that fixed size never causes a malloc.
2008-12-31 00:25:31 +00:00
Benoit Jacob
3958e7f751 add unit-test checking the assertion on unaligned arrays -- checking
that it's triggered when and only when it should.
2008-12-31 00:05:22 +00:00
Benoit Jacob
164f410bb5 * make WithAlignedOperatorNew always align even when vectorization is disabled
* make ei_aligned_malloc and ei_aligned_free honor custom operator new and delete
2008-12-30 14:11:35 +00:00
Gael Guennebaud
ce3984844d Sparse module:
* enable complex support for the CHOLMOD LLT backend
   using CHOLMOD's triangular solver
 * quick fix for complex support in SparseLLT::solve
2008-12-27 18:13:29 +00:00
Benoit Jacob
4336cf3833 * add unit-tests to check allowed and forbiddent mixing of different scalar types
* fix issues in Product revealed by this test
* in Dot.h forbid mixing of different types (at least for now, might allow real.dot(complex) in the future).
2008-12-22 19:17:44 +00:00
Benoit Jacob
9e00d94543 * the Upper->UpperTriangular change
* finally get ei_add_test right
2008-12-20 13:36:12 +00:00
Benoit Jacob
21ab65e4b3 fix nasty little bug in ei_add_test 2008-12-20 01:13:38 +00:00
Gael Guennebaud
ebf906a23a add matrix * transform product 2008-12-19 16:31:22 +00:00
Benoit Jacob
df4bd5e46f * fix a test giving some false positives
* add coverage for various operator*=
2008-12-19 16:16:39 +00:00
Benoit Jacob
a3fad2e3c3 Transform*Transform should return Transform
unit test compiles again
2008-12-19 15:55:35 +00:00
Benoit Jacob
22875683b9 * extractRotation ---> rotation
* expand the geometry/Transform tests, after Mek's reports
* fix my own stupidity in eigensolver test
2008-12-19 14:52:03 +00:00
Benoit Jacob
e4980616fd SelfAdjointEigenSolver: add operatorSqrt() and operatorInverseSqrt() 2008-12-19 14:15:32 +00:00
Benoit Jacob
84bb868f07 * more MSVC warning fixes from Kenneth Riddile
* actually GCC 4.3.0 has a bug, "deprecated" placed at the end
  of a function prototype doesn't have any effect, moving them to
  the start of the function prototype makes it actually work!
* finish porting the cholesky unit-test to the new LLT/LDLT,
  after the above fix revealed a deprecated warning
2008-12-19 02:59:04 +00:00
Benoit Jacob
fabaa6915b * fix in IO.h, a useless copy was made because of assignment from
Derived to MatrixBase.
* the optimization of eval() for Matrix now consists in a partial
  specialization of ei_eval, which returns a reference type for Matrix.
  No overriding of eval() in Matrix anymore. Consequence: careful,
  ei_eval is no longer guaranteed to give a plain matrix type!
  For that, use ei_plain_matrix_type, or the PlainMatrixType typedef.
* so lots of changes to adapt to that everywhere. Hope this doesn't
  break (too much) MSVC compilation.
* add code examples for the new image() stuff.
* lower a bit the precision for floats in the unit tests as
  we were already doing some workarounds in inverse.cpp and we got some
  failed tests.
2008-12-18 20:36:25 +00:00
Gael Guennebaud
93f8d56789 improved MSVC support in cmake files (SSE) 2008-12-18 09:07:36 +00:00
Gael Guennebaud
6e138d0069 more MSVC cmake fixes 2008-12-17 18:37:04 +00:00
Gael Guennebaud
4cb63808d4 some cmake fixes for windows and GSL 2008-12-17 17:50:43 +00:00
Benoit Jacob
c22d10f94c LU class:
* add image() and computeImage() methods, with unit test
* fix a mistake in the definition of KernelResultType
* fix and improve comments
2008-12-17 16:47:55 +00:00
Benoit Jacob
89f468671d * replace postfix ++ by prefix ++ wherever that makes sense in Eigen/
* fix some "unused variable" warnings in the tests; there remains a libstdc++ "deprecated"
warning which I haven't looked much into
2008-12-17 14:30:01 +00:00
Benoit Jacob
38b83b4157 * throw bad_alloc if exceptions are enabled, after patch by Kenneth Riddile
* disable vectorization on MSVC 2005, as it doesn't have all the required intrinsics. require 2008.
2008-12-16 15:17:29 +00:00
Gael Guennebaud
5015e48361 Sparse module: add a more flexible SparseMatrix::fillrand() function
which allows to fill a matrix with random inner coordinates (makes sense
only when a very few coeffs are inserted per col/row)
2008-12-11 18:26:24 +00:00
Gael Guennebaud
beabf008b0 bugfix in DiagonalProduct: a "DiagonalProduct<SomeXpr>" expression
is now evaluated as a "DiagonalProduct<Matrix<SomeXpr::Eval> >".
Note that currently this only happens in DiagonalProduct.
2008-12-10 19:02:13 +00:00
Benoit Jacob
069ecbb4ab * complete the change norm2->squaredNorm in PartialRedux
* somehow the NICE_RANDOM stuff wasn't being used anymore and
  tests were sometimes failing again. Fixed by #including Eigen/Array
  instead of cherry-picking just Random.h.
* little fixes in the unaligned assert page
2008-12-07 21:40:53 +00:00
Gael Guennebaud
9c0deb55ca bugfix in matrix to Euler-angles function 2008-12-06 11:04:33 +00:00
Gael Guennebaud
faf942a947 Add a generic matrix to Euler-angles function.
Perhaps the prototype of this function could be improved,
see comments in the code
2008-12-05 15:56:28 +00:00
Benoit Jacob
c1e2156d8a * Much better, consistent error msgs when mixing different scalar types:
- in matrix-matrix product, static assert on the two scalar types to be the same.
- Similarly in CwiseBinaryOp. POTENTIALLY CONTROVERSIAL: we don't allow anymore binary
  ops to take two different scalar types. The functors that we defined take two args
  of the same type anyway; also we still allow the return type to be different.
  Again the reason is that different scalar types are incompatible with vectorization.
  Better have the user realize explicitly what mixing different numeric types costs him
  in terms of performance.
  See comment in CwiseBinaryOp constructor.
- This allowed to fix a little mistake in test/regression.cpp, mixing float and double
- Remove redundant semicolon (;) after static asserts
2008-12-03 21:01:55 +00:00
Gael Guennebaud
20c11bc52c prefix all Eigen cmake variable with EIGEN_ and switched to lowercase for all cmake files 2008-12-02 12:59:10 +00:00
Gael Guennebaud
eb9dadf3b2 clean FindUmfpack.cmake wrt enable_language(Fortran) 2008-12-02 12:20:13 +00:00
Benoit Jacob
00f89a8f37 Update e-mail address 2008-11-24 13:40:43 +00:00
Gael Guennebaud
139529e97b * add .imag() function
* fix a very old bug in EigenSolver that I had completely forgotten
  (thanks to Timothy to refresh my mind)
* fix doc of Matrix::Map
2008-11-14 09:55:25 +00:00
Gael Guennebaud
86ccd99d8d Several improvements in sparse module:
* add a LDL^T factorization with solver using code from T. Davis's LDL
  library (LPGL2.1+)
* various bug fixes in trianfular solver, matrix product, etc.
* improve cmake files for the supported libraries
* split the sparse unit test
* etc.
2008-11-05 13:47:55 +00:00
Benoit Jacob
e80099932a add lpNorm<p>() method to MatrixBase, implemented in Array module, with
specializations for cases p=1,2,Eigen::Infinity.
2008-11-03 22:47:00 +00:00
Benoit Jacob
a0ec0fca5a Add Matrix::Map() and Matrix::AlignedMap() static methods 2008-11-03 21:49:03 +00:00
Benoit Jacob
3d90c13970 norm2() renamed to squaredNorm(), kept as deprecated for now. 2008-11-03 19:14:17 +00:00
Gael Guennebaud
ebe14aae7d add transposeInPlace (not optimized yet for rectangular matrix) 2008-10-29 15:24:08 +00:00
Gael Guennebaud
9f873a855f unit-tests: link to external libs only for the tests which require them 2008-10-26 21:38:30 +00:00
Gael Guennebaud
94f6f2a7de Add an axis aligned box in the geometry module.
Some naming questions:
- for "extend" we could also think of: "expand", "union", "add"
- same for "clamp": "crop", "intersect"
- same for "contains": "isInside", "intersect"
=> ah "intersect" is conflicting, so that eliminates this one !
2008-10-26 15:04:31 +00:00
Gael Guennebaud
ec0a423862 Add isApprox in Geometry module's classes.
Complete unit tests wrt previous commits.
2008-10-25 23:10:21 +00:00
Gael Guennebaud
568a7e8eba improve assertion checking in product 2008-10-25 11:52:13 +00:00
Gael Guennebaud
8ea8b481de As discussed on ML:
* remove the automatic resizing feature of operator =
 * add function Matrix::set() to be used when the previous
   behavior is wanted
 * the default constructor of dynamic-size matrices now
   creates a "null" matrix (data=0, rows = cols = 0)
   instead of a 1x1 matrix
 * fix UnixX typos ;)
2008-10-24 21:42:03 +00:00
Gael Guennebaud
cf0f82ecbe sparse module:
- remove some useless stuff => let's focus on a single sparse matrix format
 - finalize the new RandomSetter
2008-10-21 13:35:04 +00:00
Gael Guennebaud
5066fe8bbe * sparse LU: add extraction of L,U,P, and Q, as well as determinant
for both backends.
* extended a bit the sparse unit tests
2008-10-20 17:03:09 +00:00
Gael Guennebaud
e1c50a3cb1 add unit tests for sparse LU and fix a couple of warnings 2008-10-20 11:37:45 +00:00
Gael Guennebaud
fa27cd1ed0 * add cmake files to find (optional) supported libraries
* add unit tests for sparse cholesky
2008-10-20 10:43:11 +00:00
Gael Guennebaud
765219aa51 Big API change in Cholesky module:
* rename Cholesky to LLT
 * rename CholeskyWithoutSquareRoot to LDLT
 * rename MatrixBase::cholesky() to llt()
 * rename MatrixBase::choleskyNoSqrt() to ldlt()
 * make {LLT,LDLT}::solve() API consistent with other modules

Note that we are going to keep a source compatibility untill the next beta release.
E.g., the "old" Cholesky* classes, etc are still available for some time.
To be clear, Eigen beta2 should be (hopefully) source compatible with beta1,
and so beta2 will contain all the deprecated API of beta1. Those features marked
as deprecated will be removed in beta3 (or in the final 2.0 if there is no beta 3 !).

Also includes various updated in sparse Cholesky.
2008-10-13 15:53:27 +00:00
Gael Guennebaud
e2bd8623f8 Solve the issue found by Timothy in solveTriangular:
=> row-major rhs are now evaluated to a column-major
     temporary before the computations.
Add solveInPlace in Cholesky*
2008-10-13 13:14:43 +00:00
Gael Guennebaud
a930dfb229 extend sparse unit tests with transpose and matrix product 2008-10-04 14:25:00 +00:00
Gael Guennebaud
1fc503e3ce add EigenSolver::eigenvectors() method for non symmetric matrices.
However, for matrices larger than 5, it seems there is constantly a quite large error for a very
few coefficients. I don't what's going on, but that's certainely not due to numerical issues only.
(also note that the test with the pseudo eigenvectors fails the same way)
2008-10-03 13:22:54 +00:00
Gael Guennebaud
d907cd4410 Fixes in Eigensolver:
* eigenvectors => pseudoEigenvectors
 * added pseudoEigenvalueMatrix
 * clear the documentation
 * added respective unit test
Still missing: a proper eigenvectors() function.
2008-10-01 10:17:08 +00:00
Benoit Jacob
247f2b0ffa * block() for vectors ---> segment()
* documentation improvements, especially in quickstart guide
2008-09-15 15:45:41 +00:00
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
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