Commit Graph

11 Commits

Author SHA1 Message Date
Sameer Agarwal caf614a6c1 Modernize code using c++17 constructs
Mostly done using

find . \( -name '*.cc' -o -name '*.h' \) -a -type f -exec clang-tidy -p \
cmake-build -checks='-*,google-*,modernize-*,-modernize-use-nodiscard,-modernize-use-trailing-return-type' {} -fix \;

Change-Id: Ifccbcabe7a1d9a32a09d28ac4f3f8466696c1a50
2022-04-22 06:11:18 -07: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 a1458f3348 More C++11ification.
1. Replace HashMap and HashSet with std::unordered_map and
   std::unordered_set respectively.
2. Extract the pair hasher into a struct pair_hash.
3. Delete collections_port.h
4. Convert explicit iterator based loops to auto based
   loops where sensible.

Change-Id: Ib88bcd13a7463d18435639d3b771abaa52080efb
2018-03-30 12:03:28 -07:00
Chris Sweeney 4df3d11397 Bug fix for reversing OrderedGroups.
Reverse() method now handles the case where no groups exist.

Change-Id: Ia1ef08aa3cde01ceb71285b605a2e1f882c3b620
2015-03-21 17:00:40 +00:00
Keir Mierle 7492b0d8de Update copyright headers with new year and URL
Since Ceres is moving to using GitHub for issues, and the Google
Code URL in the current copyright header will soon become invalid,
update all the headers.

Change-Id: I1fce70375d1bcf098591f07b4d8f01a5c1e0789c
2015-03-18 05:43:23 +00:00
Sameer Agarwal bcc865f81c Remove using namespace std;
For historical reasons we had a "using namespace std;" in port.h. This
is generally a bad idea. So removing it and along the way doing a bunch
of cpplint cleanup.

Change-Id: Ia125601a55ae62695e247fb0250df4c6f86c46c6
2015-01-07 14:26:53 -08:00
Björn Piltz 20de0a7793 Fixed Malformed regex
I got the following error with MSVC:
Syntax error at index 9 in simple regular expression "NumGroups()": '(' is unsupported.

Change-Id: Id1952831d81d3eb5d73bbed8c311914c4c8ab51f
2014-08-25 17:05:54 +02:00
Sameer Agarwal e9fcf3decb Add OrderedGroups::MinNonZeroGroup.
Change-Id: If571c2435a7c884b472c33421722208cb2d036ff
2014-06-09 13:14:05 -07:00
Sameer Agarwal ec3a3ceafc Flesh out OrderedGroups.
1. Add the ability to bulk remove elements.
2. Add accessor for elements_to_group.
3. Early exit in Remove if there are no elements.

Change-Id: I3df1f00de05338a42e9907423b674469a022d3bc
2014-05-29 14:55:26 -07:00
Sameer Agarwal ba8d967f8c Generalization of the inner iterations algorithm.
Add automatic recursive independent set decomposition.
Clean up the naming and the API for inner iterations.

Change-Id: I3d7d6babb9756842d7367e14b7279d2df98fb724
2012-10-05 08:35:53 -07:00
Sameer Agarwal b6da9c794e OrderedGroups implementation.
This generalizes the Ordering object and paves the path for a more
general inner iteration API.

Change-Id: I6efce5f999c2bfab5f90a8a18e21140581f207cd
2012-10-01 15:23:28 -07:00