Commit Graph

12 Commits

Author SHA1 Message Date
Alex Stewart 11e6376675 Fix #ifdef guards around METIS usage in EigenSparse backend and tests
Change-Id: Idd1e0b7b1b2df2d402431b107dee0fa8e0fd58f5
2022-06-22 19:05:30 +01:00
Sameer Agarwal 2335b5b4b7 Remove support for CXSparse
Eigen provides all the functionality that we need from CXSparse
with a more liberal license.

I will update the documentation in a follow up CL.

Change-Id: I0b9fd8be3c27754cc2986cc0e06595c8b3fdec0b
2022-05-27 09:20:21 -07:00
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
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
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 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
Johannes Beck 939253c208 Fix Eigen alignment issues.
For proper alignment on the heap Eigen needs to have a custom
allocator. There are two forms, new and in-place new. To make sure
that memory is aligned using new, one needs to overload new by
adding EIGEN_MAKE_ALIGNED_OPERATOR_NEW to any struct which contains a
fixed size Eigen type either through inheritance or as a direct or
indirect member. For the in-place new one need to use the
Eigen::aligned_allocator (e.g. for std::vector, std::list,
FixedArray, etc.). For more details see:
https://eigen.tuxfamily.org/dox/group__DenseMatrixManipulation__Alignement.html

This CL adds EIGEN_MAKE_ALIGNED_OPERATOR_NEW to all structs, which
contain fixed-size Eigen types and uses the Eigen::aligned_allocator
for containers which stores structs of fixed-size Eigen types.

Change-Id: I06c6c4fc74a6835918d5d1c571b7814a14c029d8
2019-04-15 22:09:24 +02:00
Sameer Agarwal 87f823617e Fix dynamic_sparsity_test.
Skip the test in dynamic_sparsity_test when there are no sparse
linear algebra libraries available.

Also fix a minor typo in version_history.rst

Change-Id: Ie7cc14e655c58b6bd9625ce9f9025f94d0624d2d
2017-07-10 11:32:27 -07:00
Sameer Agarwal 366f4cbb03 More lint changes from William Rucklidge
Change-Id: Ica72b02f9509f1eb1961b531072826519df3fddb
2017-06-01 20:03:43 -07:00
Sameer Agarwal f93ad78f23 Lint changes from William Rucklidge
Change-Id: I54ee9d7b90232bb0139398a78a09cf4035d23ea6
2017-05-31 19:44:23 -07:00
Sameer Agarwal 88dad7e41d Fix the build for dynamic_sparsity.
The addition of crsb_rows and crsb_cols to CompressedRowSparseMatrix
broke the build for problems with dynamic sparsity.

The fix is to remove unnecessarily filling of row_blocks and col_blocks,
which was triggering a check inside CompressedRowSparseMatrix around
block handling, since block structure makes no sense for matrices with
dynamic sparsity anyways.

Also added a test "dynamic_sparsity_test" based on i
examples/ellipse_approximation.cc

Thanks to Richard Stebbing for reporting this.

Change-Id: Ic1d49e97690ac17e0ea2949772271bd915277d68
2017-05-29 19:47:34 -07:00