Commit Graph

13 Commits

Author SHA1 Message Date
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
Sergiu Deitsch c14f360e63 Drop trivial special members
Do not define trivial constructors or destructors unless necessary
(e.g., for implementing pimpl) following the rule of zero. Define
virtual base class destructors out-of-line to avoid emitting vtables in
every translation unit.

Change-Id: Iea2d8978e62a8ee5a97b86cbb4e858d56e0fb274
2022-02-09 21:30:14 +01:00
Sergiu Deitsch a35bd1bf90 Use = default for trivial special members
Applied changes correspond to clang-tidy fixes
stemming from the modernize-use-equals-default check.

Change-Id: I254b0908a76d464131564b637cd0e42a6b03fb5a
2022-02-09 18:38:52 +01:00
Sergiu Deitsch 484d3414e4 Replace virtual keyword by override
virtual can be ambiguous. Applied changes correspond to clang-tidy fixes
stemming from the modernize-use-override check.

Change-Id: I973afd4680a5df587419777504aeb94467196b89
2022-02-09 00:34:05 +01:00
Sameer Agarwal 095c9197fe Fix iterative_refiner_test.cc
Change-Id: I5f578ec1f7dc003c8da96ad410e95cacd2527076
2022-01-23 12:23:54 -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 ea4d66e7e5 clang-tidy fixes.
1. Mismatched variable names in local_parameterization.h/cc
2. Add missing final directives in iterative_refiner_test.cc

Change-Id: I954ef00d74c3b5d99f3659cc5c6ee2293fa9ff92
2019-08-06 16:58:21 -07:00
Sameer Agarwal 2ffddaccfe Use override & final instead of just using virtual.
This is safer than using virtual and this lead to a minor
bug fixes.

Change-Id: Id69cb1cc569bf6bf245f22f029c7871b6c712568
2019-07-25 16:29:14 -07:00
Sameer Agarwal 58c5edae2f Relax an overly strict tolerance in iterative_refiner_test
Change-Id: I01afef985c0d248a50df2cadb97e4be9cd8d7889
2018-04-16 12:54:18 -07:00
Sameer Agarwal 93ba16fefc Simplify IterativeRefiner
Change the loop structure of IterativeRefiner to
unconditionally refine for max_num_iterations.

This is done for two reasons.

1. We expect to use this refinement for a small number of iterations
   where the convergence test is useless.
2. Eliminating the convergence test means we can restructure the loop
   and save on a sparse matrix-vector multiply, saving precious
   compute.

Change-Id: I6347f453a5d19d234af2a2eb1bce811048963e06
2018-04-11 21:15:02 -07:00
Sameer Agarwal f973e107d2 Enable mixed precision solves.
1. Add Solver::Options::use_mixed_precision_solves,
   and Solver::Options::max_num_refinement_iterations.
2. Make SparseCholesky::Create return a unique_ptr.
3. SparseCholesky::Create now takes LinearSolver::Options
   as an argument.
4. IterativeRefiner's constructor does not require num_cols
   as an argument.
5. SparseNormalCholeskySolver now uses a separate rhs vector.

This basic implementation results in a 10% reduction in solver time
and 30% reduction in linear solver memory usage.

Change-Id: I6830f32cae2febf082d2733262eb2c9f0482b0ea
2018-04-10 11:01:38 -07:00
Sameer Agarwal 865ac62d38 Change a rather strict tolerance in the iterative_refiner_test
Change-Id: I924ab56e24b18502797202167703e4e9bf555550
2018-04-08 10:42:10 -07:00
Sameer Agarwal 86814ab193 Add Iterative Refinement
Add a class IterativeRefiner which implements iterative refinement
for SPD linear systems.

Change-Id: I705d4e96cb7de9226ee35e2a9c11d98ffc0ee239
2018-04-06 16:51:14 -07:00