Commit Graph

17 Commits

Author SHA1 Message Date
Sameer Agarwal 5a30cae583 Preparing for 2.2.0rc1
1. Add a version history
2. Update copyright years across the code base
3. Run format_all.sh
4. Update version strings from 2.1.0 to 2.2.0 in the docs and
   elsewhere.

Change-Id: I46d8d479d54bd6002d532785e67342106e73c9ac
2023-09-21 11:23:38 -07:00
Sergiu Deitsch f1dfac8cd6 Reduce the number of individual PRNG instances
Use same instance of a PRNG throughout by passing it to methods and
functions as an argument to generate random numbers without breaking the
sequence.

Change-Id: Ib024bbc1ea2d14e4b9afb71857856a5fb77b1667
2022-08-13 17:14:06 +00:00
Sameer Agarwal 560ef46fbd A bunch of minor fixes.
1. Remove an unused variable from block_sparse_matrix.cc
2. Add explicit types to the distributions to get around
   -Wctad-maybe-unsupported

Change-Id: Ib7d606fbfe2b93ba4fce408f38ee4f7626b74ff0
2022-08-08 20:16:51 -07:00
Sameer Agarwal 5d0bca14dd Remove ceres/internal/random.h in favor of <random>
Fixes https://github.com/ceres-solver/ceres-solver/issues/854

Change-Id: Id30b8dc2221f9afe4eb83f3a9304b9b2bc7e05d4
2022-08-08 07:06:21 -07:00
Sameer Agarwal 37516c968c Fix a bug in InnerProductComputer.
InnerProductComputer was assuming that the input matrix had
at least one structurally non-zero block. As a result sometimes
when InnerProductComputer.SubMatrix test generated matrices
where the submatrix was structurally zero it would cause
a segmentation fault.

This changes fixes this issue and reduces the threshold for the
minimum block density so that there is a much higher chance of
such matrices occuring as part of testing.

Fixes https://github.com/ceres-solver/ceres-solver/issues/820

Change-Id: Iec3a2431e646f0c2aac9e0b994531fa72323f329
2022-08-07 12:56:42 -07:00
Sergiu Deitsch 5fe0bd45a9 Added MinGW to Windows Github workflow
Change-Id: Id2bcd92a5464ac4888295c3dbfe9b806be95a3d9
2022-08-06 23:56:51 +02:00
Sameer Agarwal c8493fc366 Convert internal enums to be class enums.
Change-Id: Ide89c7115c3b12c0f2452a2969dc5523b3a7970f
2022-05-16 12:47:15 -07:00
Sergiu Deitsch c8658c8992 Modernize more
Apply clang-tidy Google and modernize fixes without trailing return type
using:

$ clang-tidy -p <build-dir> \
  -checks='-*,google-*,modernize-*,-modernize-use-trailing-return-type' {} -fix

Change-Id: I7450cc58ea9abf928f73a467e87876083217fa26
2022-02-26 22:16:56 +00:00
Sameer Agarwal ae65219e04 ClangTidy cleanups
1. NULL -> nullptr
2. foo.reset(new Bar) -> = foo = std::make_unique<Bar>()
3. Missing std library includes & prefixes

Change-Id: I260b261b484554be681ee5a7398126fdb3b3a789
2022-02-09 10:06:49 -08:00
Sameer Agarwal 123fba61cf Eigen::MappedSparseMatrix -> Eigen::Map<Eigen::SparseMatrix>
Eigen::MappedSparseMatrix has been deprecated and removed from
Eigen at HEAD.

Thanks to rmlarsen@ for fixing this.

Change-Id: I34f3b0dda2bb91ee8cc65a20e53a3d7de6929221
2021-11-21 10:33:23 -08:00
Nikolaus Demmel 7b8f675bfd fix formatting for (non-generated) internal source files
- Change formatting standard to Cpp11. Main difference is not having
  the space between two closing >> for nested templates. We don't
  choose c++14, because older versions of clang-format (version 9
  and earlier) don't know this value yet, and it doesn't make a
  difference in the formatting.
- Apply clang-format to all (non generated) internal source files.
- Manually fix some code sections (clang-format on/off) and c-strings
- Exclude some embedded external files with very different formatting
  (gtest/gmock)
- Add script to format all source files

Change-Id: Ic6cea41575ad6e37c9e136dbce176b0d505dc44d
2020-09-21 02:52:07 +02:00
Sameer Agarwal e49507cbea More C++ification.
"> >" -> ">>"
"> > >" -> ">>>"

Change-Id: Id1ddd9dbf030fe21d57207741b4ca8403068e55b
2018-04-03 10:58:15 -07:00
Keir Mierle 7c4e8a454e Replace scoped_ptr with C++11's unique_ptr
Change-Id: Ib5a504c491e3a79af52a95accf009df473470c6b
2018-04-02 14:47:47 -07:00
Sameer Agarwal c48937e8cf Renable accidentally disabled tests in inner_product_computer_test
Change-Id: I25a73a2436c320ac5a3f84f9867258393fb2ffe9
2018-02-27 10:10:08 -08:00
Sameer Agarwal f217ccfb69 Use MatrixTransposeMatrix multiply from small_blas.h
Prior to this Cheng Wang had to work the MatrixTransposeMatrixMultiply
function in inner_product_computer because of its lagging performance.

Now that the implementation of MatrixTransposeMatrixMultiply
has been updated to match the implementation in inner_product_computer
this CL removes the redundancy.

This CL also includes a fix to MatrixTransposeMatrixMultiply
which was missed in the earlier refactoring, because the test
coverage for small_blas is broken. The tests for InnerProductComputer
caught the problem.

Change-Id: Ia8890010da058c2d9fe738dc77f0be34af5618ab
2018-02-25 20:53:10 -08:00
Sameer Agarwal f7957e29ec Build cleanup
1. Remove unused variable.
2. Make inner_product_computer compatible with older versions of Eigen,
   which don't have a named enum for Eigen::Upper/Lower.

Change-Id: I927af297f93fc74f7f4b29b39e400ef2d75edbd4
2017-06-22 00:49:11 -07:00
Sameer Agarwal b5b394c738 Add InnerProductComputer
Add a class that given a block sparse matrix m will compute
the product m'*m efficiently.

This code is refactoring and cleanup of the code in
CompressedRowSparseMatrix devoted to computing the inner product.

In that class, the code is mistakenly said to be computing
the outer product. It is also devoted to computing the inner
product of a CompressedRowSparseMatrix with itself.

This code works with BlockSparseMatrix objects instead, which
are simpler to deal with as they are better structured to handle
block sparse matrices.

Change-Id: I920fee1a396bb0fcae9e6f7e46a308c7391d21aa
2017-06-21 23:17:54 -07:00