Commit Graph

1705 Commits

Author SHA1 Message Date
Alex Stewart 8d3e64dd5e Use modern-style Eigen3 CMake variables
Change-Id: I4c14aa54552b3f718dff90eb397cb030aeb6ecd4
2021-11-16 19:51:06 +00:00
Sergiu Deitsch 2fba61434b support log1p and expm1 jet
Currently, it is not possible to accurately evaluate the derivative of
d/dx log(1 + x) under all circumstances and significant deviations from
the actual derivative d/dx log1p(x) can occur. This changeset introduces
the necessary Jet overload and its inverse, expm1.

Change-Id: Ifcf88f6d684f61ba86bbe49f0d551b703f34ad0d
2021-11-16 00:14:39 +01:00
Sergiu Deitsch a668cabbcf support norm jet
norm allows to compute the squared magnitude both of complex and real
numbers. While Jet does not support decaying of a std::complex to a
scalar performed by norm, the function is still useful when applied to
scalars alone for computing the square.

Change-Id: I27a3513f53f37fb3960411362e80d170d1ae6f74
2021-11-15 22:29:44 +00:00
Sergiu Deitsch a3a4b6d77f support copysign jet
libc++ (default on macOS) uses the copysign function for std::complex
multiplication which causes compilation errors such as these if
std::complex is combined with jets:

/Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:607:19: error: no matching function for call to 'copysign'
            __a = copysign(__libcpp_isinf_or_builtin(__a) ? _Tp(1) : _Tp(0), __a);
                  ^~~~~~~~
foo.hpp:218:39: note: in instantiation of function template specialization 'std::__1::operator*<ceres::Jet<double, 3> >' requested here
    std::complex<Scalar> result = lhs * rhs;

copysign is also useful in other situations where the sign is required
allowing it to compute without branching.

Change-Id: I84b2d23374f1bf3bae32833016bb686d97d74054
2021-11-15 23:27:33 +01:00
Sergiu Deitsch b75dac1694 fix abs jet test comment
The comment suggests a non-existing (incorrect) test. Update the comment
and extend the test.

Change-Id: I362f0b5a2e81d286b672476bdb4394ed20263eb1
2021-11-15 18:34:34 +00:00
Sergiu Deitsch 034bf566f0 use copysign for abs jet
abs() implementation does not correctly handle the sign of the
infinitesimal part when the value is a NaN. Define the function in terms
of copysign which is the only portable way of manipulating the sign of
a NaN value.

Change-Id: I2f13fb1db62d35ca8b09e6bff1c05a736cb91513
2021-11-14 17:07:14 +01:00
Dmitriy Korchemkin 31008453fe Add example for BiCubicInterpolator
Add example of BiCubicInterpolator usage, for both analytic and
automatic differentiation

Change-Id: I2e52bec5e0721a21a789e714a126ea24b1c0ce8b
2021-10-06 20:26:18 +03:00
Sameer Agarwal 7ef4a12218 Add a section on implicit and inverse function theorems
Change-Id: I0e6c7d2850a33d03aa629579f049ad44a7618621
2021-10-01 12:05:06 -07:00
Sameer Agarwal 686428f5cd Move the further reading section to bibliography
Change-Id: I673e74587486cdf5f91a146605dafa8fc2df6ee6
2021-09-24 05:44:45 -07:00
Sameer Agarwal e47d87fdd6 Add a note about Trigg's correction
Add a pointer about how the theory and practice of Trigg's correction
for loss function differs when the second derivative of the loss
function becomes positive.

https://github.com/ceres-solver/ceres-solver/issues/573

Change-Id: Ic22ce91cc230f7ed7fa7b70a1cc2050919039828
2021-09-24 05:02:40 -07:00
Sameer Agarwal d2852518d6 Fix the docs for Problem::RemoveResidualBlock & Problem::RemoveParameterBlock
The documentation was out of date about how memory management is
done in Problem.

https://github.com/ceres-solver/ceres-solver/issues/699

Change-Id: Ie55027796bc372cdcbaaca2bf2c93643c303a8e5
2021-09-23 09:32:11 -07:00
Sameer Agarwal 06e02a1735 Delete unused files split.h/cc
Change-Id: I67a4542389a0c1162875975efd23cdfbe797c6bc
2021-09-18 06:10:26 -07:00
Sameer Agarwal ac7268da52 Fix an 80cols issue in covariance_impl.cc
Change-Id: I2422282919e7100ac852be2176cd754941a8b472
2021-09-15 06:22:29 -07:00
Sameer Agarwal 17dccef91b Add NumericDiffFirstOrderFunction
This has been a long requested feature so that users can minimize
functions using numeric differentiation.

As part of this, I have also redone rosenbrock.cc, which now has three
variants.

rosenbrock.cc now uses automatic differentiation.
rosenbrock_numeric_diff.cc uses numeric differentiation.
rosenbrock_analytic_diff.cc uses analytic derivatives.

This is analogus to how the helloworld example code is structured.

The tutorial for GradientProblemSolver has also been updated to reflect
this.

https://github.com/ceres-solver/ceres-solver/issues/691

Change-Id: Ib0fb9e35127fe4c8299d4793bea3558722c70dd7
2021-09-15 06:21:02 -07:00
Sameer Agarwal 03d64141ae Fix a incorrect check in reorder_program.cc
Thanks to William Gandler for pointing this out.

Change-Id: I7a4e0eebd2e557f7572df7455d7fa77527c087b6
2021-09-14 17:36:07 -07:00
Sameer Agarwal 8841119134 Two changes to TinySolver
1. Add function_tolerance based termination, updating the
   termination logic to be in line with Ceres.
2. Replace the use of "error" with "residuals" in the code.

Change-Id: I3fd543f3a8226fe7f07eeec358559cba934679b2
2021-09-14 16:33:34 -07:00
Sameer Agarwal 4dff3ea2c4 Fix a number of typos in rotation.h
Thanks to @yiping for reporting these.
https://github.com/ceres-solver/ceres-solver/issues/672

Change-Id: I9c59d2b666430edf33f10aaba0d0ee4cd520e0a4
2021-09-13 17:19:49 -07:00
Sameer Agarwal 98719ced43 Fix a type in interfacing_with_autodiff.html
Thanks to @tangobravo for reporting this.

https://github.com/ceres-solver/ceres-solver/issues/701

Change-Id: I2b063267c9b501c698ce6cd439a666363ba16fde
2021-09-13 17:15:02 -07:00
Sameer Agarwal 0299ce9442 Update conf.py to be compatible with Sphinx 4.1.2
Change-Id: I905911121fca48ae85f046bef714135cbf641d0a
2021-09-13 17:12:02 -07:00
Sameer Agarwal 2a2b9bd6fa Fix a bug in covariance_impl.cc
A matrix reference was being incorrectly sized. It was using
the block_size number of rows, where as there are only block_local_size
number of rows that are present in the underlying matrix.

This did not affect the correctness of the resulting code, because
right after construction we then access a subblock with block_local_size
rows.

Thanks to William Gandler for reporting this.

Change-Id: I35e1f5a30b79e31b0b9fac79f7e361821d6073df
2021-08-15 16:52:08 -07:00
Sameer Agarwal 27fade7b8c Fix a bug in system_test.cc
Fix an error in the cost functor for Powell's function.
Reported by William Gandler.

Change-Id: I4ffbbca3b3731aa13c3608067baaebd06c1a044a
2021-08-15 16:44:15 -07:00
Sameer Agarwal d4eb83ee58 Fix the Jacobian in trust_region_minimizer_test.cc
The analytical Jacobians for Powell's singular function were
incorrect. Thanks to William Gandler for reporting this.

Change-Id: I780ffe449daa6935a79b904835e13edcf1cdffa2
2021-08-15 16:37:47 -07:00
Sameer Agarwal 5f6071a1cc Fix a bug in local_parameterization_test.cc
Fix an incorrect comparison between in QuaternionParameterizationTestHelper.
Reported by William Gandler.

Change-Id: If4d63a51f6a55013b4e6f0c299462c5af6e80c70
2021-08-15 16:10:12 -07:00
Sameer Agarwal b2e732b1e2 Fix errors in comments from William Gandler.
Change-Id: I1c1f1f7bdc4a1748994c3b43e72270b88f2a2b96
2021-08-15 16:01:40 -07:00
Sameer Agarwal 42f1d67176 Add accessors to GradientProblem
Change-Id: Ic818eec240fe69b09815f1cc54f7f132cca0abb8
2021-08-14 12:28:19 -07:00
Ahmed Taei aefd37b182 Refactor small_blas_gemm_benchmark
This allows benchmarking both dynamic and static problem sizes.

On my X86 2Ghz machine:

CPU Caches:
  L1 Data 32 KiB (x48)
  L1 Instruction 32 KiB (x48)
  L2 Unified 1024 KiB (x48)
  L3 Unified 39424 KiB (x2)

----------------------------------------------------------------------------------------------
Benchmark                                                    Time             CPU   Iterations
----------------------------------------------------------------------------------------------
BM_MatrixMatrixMultiplyEigen_Static_2x3x4                 10.9 ns         10.9 ns     63960496
BM_MatrixMatrixMultiplyEigen_Static_3x3x3                 11.9 ns         11.9 ns     58093785
BM_MatrixMatrixMultiplyEigen_Static_4x4x4                 24.9 ns         24.9 ns     28540133
BM_MatrixMatrixMultiplyEigen_Static_8x8x8                  258 ns          258 ns      2755921
BM_MatrixMatrixMultiplyEigen_Static_9x9x3                  255 ns          255 ns      2778628
BM_MatrixMatrixMultiplyEigen_Static_9x3x3                 37.7 ns         37.7 ns     18556359
BM_MatrixMatrixMultiplyEigen_Static_3x9x9                  220 ns          220 ns      3195163
BM_MatrixMatrixMultiplyEigen_Dynamic_2x3x4                37.8 ns         37.7 ns     18491162
BM_MatrixMatrixMultiplyEigen_Dynamic_3x3x3                48.8 ns         48.8 ns     13724884
BM_MatrixMatrixMultiplyEigen_Dynamic_4x4x4                74.5 ns         74.5 ns      9313146
BM_MatrixMatrixMultiplyEigen_Dynamic_8x8x8                 271 ns          271 ns      2595807
BM_MatrixMatrixMultiplyEigen_Dynamic_9x9x3                 259 ns          259 ns      2688515
BM_MatrixMatrixMultiplyEigen_Dynamic_9x3x3                 123 ns          123 ns      5792115
BM_MatrixMatrixMultiplyEigen_Dynamic_3x9x9                 236 ns          236 ns      2963896
BM_MatrixMatrixMultiplyNaive_Static_2x3x4                 12.2 ns         12.2 ns     56472772
BM_MatrixMatrixMultiplyNaive_Static_3x3x3                 15.5 ns         15.5 ns     44346456
BM_MatrixMatrixMultiplyNaive_Static_4x4x4                 41.5 ns         41.5 ns     17196984
BM_MatrixMatrixMultiplyNaive_Static_8x8x8                  199 ns          199 ns      3561730
BM_MatrixMatrixMultiplyNaive_Static_9x9x3                  148 ns          148 ns      4764814
BM_MatrixMatrixMultiplyNaive_Static_9x3x3                 38.4 ns         38.4 ns     17259019
BM_MatrixMatrixMultiplyNaive_Static_3x9x9                  115 ns          115 ns      6104752
BM_MatrixMatrixMultiplyNaive_Dynamic_2x3x4                9.66 ns         9.66 ns     74722971
BM_MatrixMatrixMultiplyNaive_Dynamic_3x3x3                13.0 ns         13.0 ns     53435308
BM_MatrixMatrixMultiplyNaive_Dynamic_4x4x4                47.8 ns         47.8 ns     14358184
BM_MatrixMatrixMultiplyNaive_Dynamic_8x8x8                 200 ns          200 ns      3572809
BM_MatrixMatrixMultiplyNaive_Dynamic_9x9x3                 104 ns          104 ns      6793797
BM_MatrixMatrixMultiplyNaive_Dynamic_9x3x3                34.0 ns         34.0 ns     20790695
BM_MatrixMatrixMultiplyNaive_Dynamic_3x9x9                 130 ns          130 ns      5170402
BM_MatrixTransposeMatrixMultiplyEigen_Static_2x3x4        10.3 ns         10.3 ns     69105234
BM_MatrixTransposeMatrixMultiplyEigen_Static_3x3x3        28.9 ns         28.9 ns     24478934
BM_MatrixTransposeMatrixMultiplyEigen_Static_4x4x4        23.7 ns         23.7 ns     29351926
BM_MatrixTransposeMatrixMultiplyEigen_Static_8x8x8         233 ns          233 ns      2929398
BM_MatrixTransposeMatrixMultiplyEigen_Static_9x9x3         211 ns          211 ns      3287409
BM_MatrixTransposeMatrixMultiplyEigen_Static_9x3x3        26.5 ns         26.5 ns     26515136
BM_MatrixTransposeMatrixMultiplyEigen_Static_3x9x9         196 ns          196 ns      3594314
BM_MatrixTransposeMatrixMultiplyEigen_Dynamic_2x3x4       9.05 ns         9.05 ns     77621001
BM_MatrixTransposeMatrixMultiplyEigen_Dynamic_3x3x3       11.1 ns         11.1 ns     62227812
BM_MatrixTransposeMatrixMultiplyEigen_Dynamic_4x4x4       25.5 ns         25.5 ns     27356089
BM_MatrixTransposeMatrixMultiplyEigen_Dynamic_8x8x8        248 ns          248 ns      2834983
BM_MatrixTransposeMatrixMultiplyEigen_Dynamic_9x9x3        229 ns          229 ns      3082369
BM_MatrixTransposeMatrixMultiplyEigen_Dynamic_9x3x3       28.4 ns         28.4 ns     24318629
BM_MatrixTransposeMatrixMultiplyEigen_Dynamic_3x9x9        229 ns          229 ns      3091288
BM_MatrixTransposeMatrixMultiplyNaive_Static_2x3x4        11.0 ns         11.0 ns     63773538
BM_MatrixTransposeMatrixMultiplyNaive_Static_3x3x3        19.1 ns         19.1 ns     37003139
BM_MatrixTransposeMatrixMultiplyNaive_Static_4x4x4        49.1 ns         49.1 ns     14142301
BM_MatrixTransposeMatrixMultiplyNaive_Static_8x8x8         244 ns          244 ns      2874755
BM_MatrixTransposeMatrixMultiplyNaive_Static_9x9x3         140 ns          140 ns      4992156
BM_MatrixTransposeMatrixMultiplyNaive_Static_9x3x3        46.2 ns         46.2 ns     15068317
BM_MatrixTransposeMatrixMultiplyNaive_Static_3x9x9         112 ns          112 ns      6213574
BM_MatrixTransposeMatrixMultiplyNaive_Dynamic_2x3x4       9.74 ns         9.74 ns     72155001
BM_MatrixTransposeMatrixMultiplyNaive_Dynamic_3x3x3       11.5 ns         11.5 ns     60070577
BM_MatrixTransposeMatrixMultiplyNaive_Dynamic_4x4x4       52.5 ns         52.5 ns     13473642
BM_MatrixTransposeMatrixMultiplyNaive_Dynamic_8x8x8        224 ns          224 ns      3124264
BM_MatrixTransposeMatrixMultiplyNaive_Dynamic_9x9x3       98.0 ns         98.0 ns      7199292
BM_MatrixTransposeMatrixMultiplyNaive_Dynamic_9x3x3       34.7 ns         34.6 ns     20203685
BM_MatrixTransposeMatrixMultiplyNaive_Dynamic_3x9x9        105 ns          105 ns      6653151

Change-Id: Iee403b4d27801d1614ecc1f78a1f8c0011514bd7
2021-08-09 21:24:17 -07:00
Alexander Karatarakis dc20db3032 [docs] Fix IterationSummary section. Add missing IterationCallback
Change-Id: I1d10201cd927003fd3d46728d13231d3fbc27f96
2021-08-09 16:29:29 -07:00
Alexander Karatarakis 90ba7d1ef4 [docs] Fix typos
Change-Id: I447bd63b58a7bfc7c1df36dbef5dcba454d28256
2021-08-09 16:29:23 -07:00
Ahmed Taei c3129c3d4a Fix tests not executing
- The operator() wasn't called and tests where not executed.
- Fill test matrices with non-constant data.

Change-Id: Iacc9e8cb47d8539aded05bb821d3ce2f08a740d6
2021-08-03 14:04:01 -07:00
Sumit Dey 7de561e8e8 Fix dependency check for building documentation
Build with documentation fails if the required 'sphinx rtd theme' is
not available. Check if dependency is installed before building with
documentation.

Add Python3 as requirement for building documentation.

Change-Id: I5edc5d7374864990e625a5efb358f5a23b3c50fe
2021-07-31 12:21:16 +02:00
Ahmed Taei 4fbe218f24 Refactor small_blas_test
- Add testMatrix{Transpose}MatrixMultiply size
  templated functions and test multiple problem
  sizes.
- Removes duplicated code for matrix{transpose}-
  matrix{naive} test cases

Change-Id: I9a5d4b0362732ea7bef58572edcaada778fb4aa0
2021-07-30 13:18:18 -07:00
Sameer Agarwal 3fdde8ede0 Remove an errant double link.
Thanks to TimonKnigge@

Change-Id: If5d77d9fe456991169ed70f12839af028755fc4f
2021-07-16 06:26:09 -07:00
Noah Snavely 20ad431f77 Fixing a typo in the version history
Change-Id: Ib0b344112373dd947cedd70808f02f573bf60bc8
2021-07-13 22:25:42 -04:00
Alexander Karatarakis 0c85c40923 Revert "Reduce copies involved in Jet operations"
This reverts commit c036c78196.

Change-Id: I736f2141d041e7a2c21491a159b48c5565df2bfa
2021-07-01 22:55:31 -07:00
Dmitriy Korchemkin 3a02d5aaf4 Fix typo in LossFunctionWrapper sample code
Change-Id: Ideb47fe8d36b023ea13cf2c23b92871bea54fe58
2021-06-24 19:04:20 +03:00
Alexander Karatarakis 7b2c223be7 Add fmax/fmin overloads for scalars
Comparison operators are defined for Jet-scalar and scalar-Jet.
Add corresponding overloads for fmax and fmix so users
don't have to convert to Jet only to access these functions,
plus it can potentially save an unnecessary conversion.

Change-Id: I20cc2d5874935e019d4ecb2d6a8c2ae631c8a4d3
2021-06-23 13:40:58 -07:00
Alexander Karatarakis c036c78196 Reduce copies involved in Jet operations
- Avoid copies in compound assignment operators (+=, -=, *=, /=)
- Add r-value overloads to +,-,*./ operators

Addition<3>/1000                                  +0.0382         +0.0382          2798          2905          2798          2905
Addition<10>/1000                                 -0.0009         -0.0009          4831          4827          4831          4827
Addition<15>/1000                                 -0.0011         -0.0010          8005          7996          8005          7996
Addition<25>/1000                                 +0.0014         +0.0014         13951         13970         13951         13970
Addition<32>/1000                                 +0.0010         +0.0009         13638         13651         13638         13651
Addition<200>/160                                 -0.1732         -0.1732         40301         33321         40300         33320
AdditionScalar<3>/1000                            +0.0016         +0.0016          2493          2497          2493          2497
AdditionScalar<10>/1000                           +0.0060         +0.0060          2701          2718          2701          2717
AdditionScalar<15>/1000                           -0.0024         -0.0024          2598          2592          2598          2592
AdditionScalar<25>/1000                           -0.0038         -0.0038          3730          3716          3730          3716
AdditionScalar<32>/1000                           +0.0062         +0.0062          4137          4162          4137          4162
AdditionScalar<200>/160                           -0.5626         -0.5626         19355          8466         19355          8466
Subtraction<3>/1000                               -0.0011         -0.0012          3162          3158          3162          3158
Subtraction<10>/1000                              -0.0027         -0.0026          4982          4969          4982          4969
Subtraction<15>/1000                              -0.0112         -0.0112          7820          7733          7820          7733
Subtraction<25>/1000                              +0.0181         +0.0181         13088         13325         13088         13325
Subtraction<32>/1000                              -0.0007         -0.0007         14514         14505         14514         14504
Subtraction<200>/160                              -0.1668         -0.1668         44586         37148         44586         37147
SubtractionScalar<3>/1000                         -0.0028         -0.0028          2540          2533          2540          2533
SubtractionScalar<10>/1000                        -0.0024         -0.0024          2682          2676          2682          2676
SubtractionScalar<15>/1000                        -0.0023         -0.0023          2603          2597          2603          2597
SubtractionScalar<25>/1000                        -0.0018         -0.0018          3570          3563          3570          3563
SubtractionScalar<32>/1000                        -0.0012         -0.0012          4223          4218          4223          4218
SubtractionScalar<200>/160                        -0.5070         -0.5070         20375         10044         20375         10044
Multiplication<3>/1000                            -0.0543         -0.0544          6171          5836          6172          5836
Multiplication<10>/1000                           -0.0617         -0.0617         11860         11128         11860         11128
Multiplication<15>/1000                           -0.0106         -0.0106         17456         17271         17456         17271
Multiplication<25>/1000                           -0.0114         -0.0114         27204         26893         27204         26893
Multiplication<32>/1000                           -0.0125         -0.0125         32704         32293         32703         32293
Multiplication<200>/160                           -0.3849         -0.3849         60557         37246         60557         37246
MultiplicationLeftScalar<3>/1000                  +0.0005         +0.0005          3086          3088          3086          3088
MultiplicationLeftScalar<10>/1000                 -0.0008         -0.0008          4486          4483          4486          4483
MultiplicationLeftScalar<15>/1000                 -0.0010         -0.0010          5840          5834          5840          5834
MultiplicationLeftScalar<25>/1000                 -0.0047         -0.0047         11350         11297         11350         11298
MultiplicationLeftScalar<32>/1000                 -0.0014         -0.0014         13892         13873         13892         13873
MultiplicationLeftScalar<200>/160                 -0.2646         -0.2646         28124         20682         28124         20682
MultiplicationRightScalar<3>/1000                 +0.0024         +0.0025          3090          3098          3090          3098
MultiplicationRightScalar<10>/1000                +0.0008         +0.0009          4596          4600          4596          4600
MultiplicationRightScalar<15>/1000                -0.0033         -0.0033          5832          5812          5832          5812
MultiplicationRightScalar<25>/1000                -0.0005         -0.0005         11353         11347         11353         11347
MultiplicationRightScalar<32>/1000                +0.0043         +0.0043         14041         14102         14041         14102
MultiplicationRightScalar<200>/160                -0.2600         -0.2600         28104         20796         28104         20796
Division<3>/1000                                  -0.0006         -0.0006          8977          8972          8977          8972
Division<10>/1000                                 -0.0095         -0.0095         14613         14474         14613         14473
Division<15>/1000                                 -0.0081         -0.0081         23109         22922         23108         22922
Division<25>/1000                                 -0.0081         -0.0081         37292         36992         37292         36992
Division<32>/1000                                 -0.0234         -0.0234         41693         40718         41692         40717
Division<200>/160                                 -0.1306         -0.1306         44486         38677         44486         38677
DivisionLeftScalar<3>/1000                        -0.0080         -0.0080          6683          6630          6683          6630
DivisionLeftScalar<10>/1000                       -0.0018         -0.0018          9255          9239          9255          9238
DivisionLeftScalar<15>/1000                       -0.0011         -0.0011         12180         12166         12180         12166
DivisionLeftScalar<25>/1000                       +0.0060         +0.0060         22381         22515         22381         22516
DivisionLeftScalar<32>/1000                       -0.0016         -0.0016         20159         20126         20159         20126
DivisionLeftScalar<200>/160                       -0.2528         -0.2528         28773         21499         28772         21499
DivisionRightScalar<3>/1000                       -0.0006         -0.0006          3784          3782          3784          3782
DivisionRightScalar<10>/1000                      -0.0014         -0.0014          5699          5691          5699          5691
DivisionRightScalar<15>/1000                      -0.0009         -0.0009          7490          7484          7490          7484
DivisionRightScalar<25>/1000                      +0.0031         +0.0031         13751         13793         13751         13793
DivisionRightScalar<32>/1000                      -0.0006         -0.0006         16712         16702         16712         16702
DivisionRightScalar<200>/160                      -0.2532         -0.2532         28412         21217         28411         21217
MultiplyAndAdd<3>/1000                            -0.0191         -0.0191          4382          4299          4382          4299
MultiplyAndAdd<10>/1000                           -0.0060         -0.0060         10238         10176         10238         10176
MultiplyAndAdd<15>/1000                           -0.0053         -0.0053         11696         11634         11696         11634
MultiplyAndAdd<25>/1000                           -0.0171         -0.0171         19185         18858         19185         18858
MultiplyAndAdd<32>/1000                           +0.0070         +0.0070         23783         23951         23783         23951
MultiplyAndAdd<200>/160                           -0.1252         -0.1252         61470         53776         61469         53776

Change-Id: Ib366d5753ed4f398667766384e05389d45e0d444
2021-06-18 15:04:17 -07:00
Alexander Karatarakis 51945e0619 Introduce benchmark for Jet operations
Run on (20 X 4300 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x10)
L1 Instruction 32 KiB (x10)
L2 Unified 1024 KiB (x10)
L3 Unified 14080 KiB (x1)
Load Average: 2.37, 3.00, 3.08
-----------------------------------------------------------------------------
Benchmark                                   Time             CPU   Iterations
-----------------------------------------------------------------------------
Addition<3>/1000                         2872 ns         2872 ns       240449
Addition<10>/1000                        5304 ns         5304 ns       100000
Addition<15>/1000                        8211 ns         8210 ns        78742
Addition<25>/1000                       14214 ns        14213 ns        46762
Addition<32>/1000                       13746 ns        13746 ns        50892
Addition<200>/160                       41228 ns        41228 ns        17183
AdditionScalar<3>/1000                   2514 ns         2514 ns       273996
AdditionScalar<10>/1000                  2733 ns         2733 ns       255508
AdditionScalar<15>/1000                  2622 ns         2622 ns       264291
AdditionScalar<25>/1000                  3753 ns         3753 ns       183508
AdditionScalar<32>/1000                  4254 ns         4254 ns       167016
AdditionScalar<200>/160                 18314 ns        18314 ns        38116
Subtraction<3>/1000                      3241 ns         3241 ns       206370
Subtraction<10>/1000                     5023 ns         5023 ns       139271
Subtraction<15>/1000                     8387 ns         8386 ns        89927
Subtraction<25>/1000                    14951 ns        14950 ns        48756
Subtraction<32>/1000                    14587 ns        14587 ns        47056
Subtraction<200>/160                    47175 ns        47175 ns        15574
SubtractionScalar<3>/1000                2572 ns         2572 ns       264468
SubtractionScalar<10>/1000               2713 ns         2713 ns       257920
SubtractionScalar<15>/1000               2621 ns         2621 ns       265289
SubtractionScalar<25>/1000               3593 ns         3593 ns       192266
SubtractionScalar<32>/1000               4255 ns         4255 ns       163738
SubtractionScalar<200>/160              19906 ns        19906 ns        35295
Multiplication<3>/1000                   6058 ns         6058 ns       114067
Multiplication<10>/1000                 11999 ns        11999 ns        58492
Multiplication<15>/1000                 17906 ns        17905 ns        39565
Multiplication<25>/1000                 27361 ns        27360 ns        25335
Multiplication<32>/1000                 33074 ns        33074 ns        20875
Multiplication<200>/160                 61364 ns        61362 ns        11542
MultiplicationLeftScalar<3>/1000         3104 ns         3104 ns       223720
MultiplicationLeftScalar<10>/1000        4549 ns         4549 ns       154366
MultiplicationLeftScalar<15>/1000        5921 ns         5921 ns       119294
MultiplicationLeftScalar<25>/1000       11429 ns        11428 ns        61685
MultiplicationLeftScalar<32>/1000       14094 ns        14094 ns        49941
MultiplicationLeftScalar<200>/160       28186 ns        28185 ns        24484
MultiplicationRightScalar<3>/1000        3110 ns         3110 ns       223333
MultiplicationRightScalar<10>/1000       4655 ns         4655 ns       150534
MultiplicationRightScalar<15>/1000       5890 ns         5890 ns       119746
MultiplicationRightScalar<25>/1000      11464 ns        11464 ns        61483
MultiplicationRightScalar<32>/1000      14243 ns        14242 ns        49492
MultiplicationRightScalar<200>/160      28282 ns        28281 ns        24604
Division<3>/1000                         9128 ns         9128 ns        77846
Division<10>/1000                       14811 ns        14811 ns        47682
Division<15>/1000                       23293 ns        23292 ns        30091
Division<25>/1000                       37313 ns        37313 ns        18608
Division<32>/1000                       41229 ns        41229 ns        16982
Division<200>/160                       44802 ns        44802 ns        15573
DivisionLeftScalar<3>/1000               6720 ns         6720 ns       104747
DivisionLeftScalar<10>/1000              9403 ns         9402 ns        75216
DivisionLeftScalar<15>/1000             12313 ns        12313 ns        57366
DivisionLeftScalar<25>/1000             22739 ns        22739 ns        30421
DivisionLeftScalar<32>/1000             20321 ns        20321 ns        34191
DivisionLeftScalar<200>/160             29018 ns        29017 ns        23908
DivisionRightScalar<3>/1000              3815 ns         3815 ns       182333
DivisionRightScalar<10>/1000             5750 ns         5750 ns       121691
DivisionRightScalar<15>/1000             7574 ns         7574 ns        92994
DivisionRightScalar<25>/1000            13953 ns        13953 ns        49250
DivisionRightScalar<32>/1000            16892 ns        16892 ns        41668
DivisionRightScalar<200>/160            28663 ns        28662 ns        24226
MultiplyAndAdd<3>/1000                   4399 ns         4399 ns       158635
MultiplyAndAdd<10>/1000                 10453 ns        10453 ns        68112
MultiplyAndAdd<15>/1000                 11830 ns        11830 ns        59598
MultiplyAndAdd<25>/1000                 19624 ns        19624 ns        36240
MultiplyAndAdd<32>/1000                 25539 ns        25538 ns        29066
MultiplyAndAdd<200>/160                 65362 ns        65358 ns        11086

Change-Id: Ie62492b3fd19ff9d3394f90bd00f0aa01522fc2a
2021-06-16 16:17:52 -07:00
Fuhao Shi ec4f2995bb Do not check MaxNumThreadsAvailable if the thread number is set to 1.
- this saves the sysfs cost in MaxNumThreadsAvailable.

Change-Id: I6b33ceae363da19346341be95abbd89d7b7b0f2f
2021-03-24 22:16:45 +00:00
Sameer Agarwal 98f639f542 Add a macro CERES_GET_FLAG.
This is needed to add a layer of indirection which will allow
us to use gflags in the public version and absl inside Google.

Change-Id: I32f3da23200a01c9b658bbf8aaa66cb8fddc2cc3
2021-03-18 11:07:57 -07:00
Daniel Henell 766f2cab55 Reduce log spam in covariance_impl.cc.
Make the rank deficiency warning in the covariance module a VLOG(1) instead of
LOG(ERROR) since this is a commonly occuring case.

Change-Id: Id46eba6dcf9afbaf0554c2d6f230b2af7a1fbdea
2021-03-17 13:55:00 +00:00
Alex Stewart 941ea13475 Fix FindTBB version detection with TBB >= 2021.1.1
- Raised as issue #669

Change-Id: Ic2fcaf31aef5e303d19a9caef7d6c679325f554a
2021-03-15 14:17:59 +00:00
Florian Berchtold 323c350a66 fix Eigen3_VERSION
Change-Id: Ida3796ec9d5732b284973dbbf0a395f9c5b19a7b
2021-03-03 19:30:08 +01:00
Sameer Agarwal 2b32b32124 Revert "Group specializations into groups of four"
This reverts commit 4ba244cdbc.

Reason for revert: This commit causes CI failures.

Change-Id: I954f2b8f093e39e3b52ca91b331591b73e646554
2021-02-17 18:38:43 +00:00
Tobias Schlüter 313caf1aec Allow Unity build.
Two parts:
- missing include guard in solver_utils.h
- exclude schur_specializations from unity build.  This
  can only be done with cmake >= 3.16, so only allow
  unity build for these versions.

Cuts build time by 5 minutes with default settings.
libceres.a shrinks from 7549968 bytes to 7009696 bytes.

Change-Id: I833ac8266623da0e725cc2f07a6415b4fa72bc18
2021-02-16 08:30:36 +09:00
Tobias Schlüter 4ba244cdbc Group specializations into groups of four
Genrerate the specialization files by grouping the specializations into
five groups, cutting build time by three minutes (roughly 20%) in my
tests.

Change-Id: Ifd6a4523a47346c5e84c1cda15b7abba60d8e953
2021-02-12 19:56:53 +09:00
Tobias Schlüter d77a8100a3 Make miniglog's InitGoogleLogging argument const.
This is in line with glog.  Also, the argument is unused.  Third try.

Change-Id: I23331ae26089956454d66ab9e93fc04d4b24ed2e
2021-02-08 00:56:02 +00:00
Tobias Schlüter 8637249945 Use portable expression for constant 2/sqrt(pi)
M_2_SQRTPI is not part of standard C++, replace it with an
equivalent expression.  gcc immediately folds this and thus
generates the same code even at -O0.

Change-Id: I5d38e67a4508c1d43a1a8e5f1639f2243cdb143e
2021-01-30 23:19:07 +09:00
Sameer Agarwal 97873ea658 Add some missing includes for glog/logging.h
Change-Id: Ia10c2809eb360bd30efddc0cd941b0de06ac09d6
2021-01-21 13:49:38 -08:00
Sameer Agarwal d15b1bcd3e Increase tolerance in small_blas_test.cc
Change-Id: I7b8460bec65e56029d01c293e83743e99a57d10c
2021-01-12 09:15:05 -08:00