aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/stable_norm.cpp
Commit message (Collapse)AuthorAge
* Fix stable_norm_1 test.Gravatar Antonio Sanchez2021-01-21
| | | | | | | | Test enters an infinite loop if size is 1x1 when choosing to select unique indices for adding `inf` and `NaN` to the input. Here we revert to non-unique indices, and split the `hypotNorm` check into two cases: one where both `inf` and `NaN` are added, and one where only `NaN` is added.
* Improved std::complex sqrt and rsqrt.Gravatar Antonio Sanchez2021-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces `std::sqrt` with `complex_sqrt` for all platforms (previously `complex_sqrt` was only used for CUDA and MSVC), and implements custom `complex_rsqrt`. Also introduces `numext::rsqrt` to simplify implementation, and modified `numext::hypot` to adhere to IEEE IEC 6059 for special cases. The `complex_sqrt` and `complex_rsqrt` implementations were found to be significantly faster than `std::sqrt<std::complex<T>>` and `1/numext::sqrt<std::complex<T>>`. Benchmark file attached. ``` GCC 10, Intel Xeon, x86_64: --------------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------------- BM_Sqrt<std::complex<float>> 9.21 ns 9.21 ns 73225448 BM_StdSqrt<std::complex<float>> 17.1 ns 17.1 ns 40966545 BM_Sqrt<std::complex<double>> 8.53 ns 8.53 ns 81111062 BM_StdSqrt<std::complex<double>> 21.5 ns 21.5 ns 32757248 BM_Rsqrt<std::complex<float>> 10.3 ns 10.3 ns 68047474 BM_DivSqrt<std::complex<float>> 16.3 ns 16.3 ns 42770127 BM_Rsqrt<std::complex<double>> 11.3 ns 11.3 ns 61322028 BM_DivSqrt<std::complex<double>> 16.5 ns 16.5 ns 42200711 Clang 11, Intel Xeon, x86_64: --------------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------------- BM_Sqrt<std::complex<float>> 7.46 ns 7.45 ns 90742042 BM_StdSqrt<std::complex<float>> 16.6 ns 16.6 ns 42369878 BM_Sqrt<std::complex<double>> 8.49 ns 8.49 ns 81629030 BM_StdSqrt<std::complex<double>> 21.8 ns 21.7 ns 31809588 BM_Rsqrt<std::complex<float>> 8.39 ns 8.39 ns 82933666 BM_DivSqrt<std::complex<float>> 14.4 ns 14.4 ns 48638676 BM_Rsqrt<std::complex<double>> 9.83 ns 9.82 ns 70068956 BM_DivSqrt<std::complex<double>> 15.7 ns 15.7 ns 44487798 Clang 9, Pixel 2, aarch64: --------------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------------- BM_Sqrt<std::complex<float>> 24.2 ns 24.1 ns 28616031 BM_StdSqrt<std::complex<float>> 104 ns 103 ns 6826926 BM_Sqrt<std::complex<double>> 31.8 ns 31.8 ns 22157591 BM_StdSqrt<std::complex<double>> 128 ns 128 ns 5437375 BM_Rsqrt<std::complex<float>> 31.9 ns 31.8 ns 22384383 BM_DivSqrt<std::complex<float>> 99.2 ns 98.9 ns 7250438 BM_Rsqrt<std::complex<double>> 46.0 ns 45.8 ns 15338689 BM_DivSqrt<std::complex<double>> 119 ns 119 ns 5898944 ```
* Get rid of EIGEN_TEST_FUNC, unit tests must now be declared with ↵Gravatar Gael Guennebaud2018-07-17
| | | | | | | | | 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
* Remove local Index typedef from unit-testsGravatar Gael Guennebaud2018-07-12
|
* Make stableNorm and blueNorm compatible with 2D matrices.Gravatar Gael Guennebaud2018-04-04
|
* bug #1521: add unit test dedicated to numbest::hyposGravatar Gael Guennebaud2018-04-04
|
* Fix compilation of stableNorm with some expressions as inputGravatar Gael Guennebaud2017-12-15
|
* Avoid overflow in unit test.Gravatar Gael Guennebaud2016-01-30
|
* bug #977: add stableNormalize[d] methods: they are analogues to normalize[d] ↵Gravatar Gael Guennebaud2016-01-23
| | | | but with carefull handling of under/over-flow
* Protect further isnan/isfinite/isinf callsGravatar Christoph Hertzberg2015-08-16
|
* Workaround broken complex*real product on old clang versionsGravatar Gael Guennebaud2015-06-17
|
* Rename free functions isFinite, isInf, isNaN to be compatible with c++11Gravatar Gael Guennebaud2015-06-10
|
* Remove ambiguity with recent numext methods isNaN and isInfGravatar Deanna Hood2015-03-17
|
* Fix bug #859: pexp(NaN) returned Inf instead of NaNGravatar Gael Guennebaud2014-10-20
|
* avoid division by 0Gravatar Gael Guennebaud2014-09-16
|
* Fix hypot() and hypotNorm() wrt NaN and INF values.Gravatar Gael Guennebaud2014-09-02
|
* Fix blueNorm wrt NaN/INF.Gravatar Gael Guennebaud2014-09-02
|
* Fix stableNorm() with respect to NaN and inf, and add respective unit tests. ↵Gravatar Gael Guennebaud2014-09-02
| | | | blueNorm() and hypotNorm() are broken wrt to NaN/inf
* Fix stable_norm unit test for complexesGravatar Gael Guennebaud2014-02-13
|
* Fix bug #740: overflow issue in stableNormGravatar Gael Guennebaud2014-02-13
|
* Fix bug #314:Gravatar Gael Guennebaud2012-11-06
| | | | | - remove most of the metaprogramming kung fu in MathFunctions.h (only keep functions that differs from the std) - remove the overloads for array expression that were in the std namespace
* Automatic relicensing to MPL2 using Keirs script. Manual fixup follows.Gravatar Benoit Jacob2012-07-13
|
* the min/max macros to detect unprotected min/max were undefined by some std ↵Gravatar Gael Guennebaud2011-08-19
| | | | | | header, so let's declare them after and do the respective fixes ;)
* fix stable_norm test: the |small| value was 0 on clang with complex<float>.Gravatar Benoit Jacob2011-02-27
|
* workaround ICC aggressive optimizationGravatar Gael Guennebaud2011-02-21
|
* fix bug #187: stable norm test was quite brokenGravatar Benoit Jacob2011-02-18
|
* bug #86 : use internal:: namespace instead of ei_ prefixGravatar Benoit Jacob2010-10-25
|
* email changeGravatar Gael Guennebaud2010-06-24
|
* Utilize Index in all unit tests.Gravatar Hauke Heibel2010-06-20
|
* Fix devision by zero warning.Gravatar Hauke Heibel2010-06-09
|
* Fix stable_norm compilation.Gravatar Hauke Heibel2010-06-08
|
* improve/fix stable_norm unit testGravatar Gael Guennebaud2010-06-08
|
* Fixed stablenorm test, condition was not met when running testsGravatar Carlos Becker2010-04-26
|
* export stableNorm(), blueNorm() and hypotNorm() to colwise() and rowwise()Gravatar Thomas Capricelli2009-11-26
| | | | + rudimentary test
* big huge changes, so i dont remember everything.Gravatar Benoit Jacob2009-10-28
| | | | | | | | | | * 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
* really fix stable norm compilation for older gccGravatar Gael Guennebaud2009-10-07
|
* fix compilation in stable norm, move a platform check to the unit testsGravatar Gael Guennebaud2009-10-06
|
* fix stable_norm unit testGravatar Gael Guennebaud2009-09-18
|
* Added missing casts.Gravatar Hauke Heibel2009-09-08
|
* add a stable_norm unit testGravatar Gael Guennebaud2009-09-07