Commit Graph

14 Commits

Author SHA1 Message Date
Sergiu Deitsch f90833f5fa Simplify symbol export
Currently, the logic for exporting symbols is rather complicated: when
tests are enabled internal symbols are exported in addition to the
public symbols. Such logic causes several problems. (1) Test binaries
link against a Ceres build that is different from the final release
since fewer optimizations are applied if more symbols are exported. (2)
Also, some toolchains hide symbols by default breaking the existing
logic eventually causing linker errors.

Since internal symbols are not intended to be used outside of the
project, we can compile them into object files and use exactly the same
binary code both for the final build and the tests without relying on
conditionals.

By default, all symbols are now hidden unless annotated as public.
Internal symbols are explicitly marked as not being exported in case
users chose not to hide symbols by default.

Change-Id: I589dd10be2f6f438508783cf99d141af0120057b
2022-02-14 20:19:08 +01: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
Darius Rueckert 8e962f37d7 Add Autodiff Codegen Tests
This patch adds end-to-end tests for the autodiff codegen system.
First, code is generated for various functors. This code is then
executed with different arguments and the result is compared
to traditional autodiff.

Change-Id: Icba9996ece26384a795d5b50480ec8194cab572f
2020-02-25 08:57:22 +01:00
Sameer Agarwal 4556eb9810 Simplify integration tests.
1. Remove SolverConfig, this was a wrapper
   around Solver::Options. As we experiment
   with more Solver::Options, it became a hurdle.

2. Updated generate_bundle_adjustment_tests.py to use
   Solver::Options directly.
3. Update system_test to use Solver::Options.

NOTE: generate_bundle_adjustment_tests.py changes are a bit
gunky, but I tried to minimize the changes in this CL
as I am going to introduce new test cases and that
is going to significantly change this file.

Change-Id: I34a2f51824b04ef368a5bbe54fbd7b281381909e
2018-04-18 17:37:20 -07:00
Sameer Agarwal 8c4623c63a Update ExpectArraysClose to use ExpectClose instead of EXPECT_NEAR
The documentation for ExpectArraysClose and its implementation
did not match.

This change makes the polynomial_test not fail on 64bit AMD builds.

Thanks to Phillip Huebner for reporting this.

Change-Id: I503f2d3317a28d5885a34f8bdbccd49d20ae9ba2
2016-09-03 02:01:10 +00:00
Sameer Agarwal 5f2f05c726 Refactor system_test
1. Move common test infrastructure into test_util.
2. system_test now only contains powells function.
3. Add bundle_adjustment_test.

Instead of a single function which computes everything,
there is now a test for each solver configuration which
uses the reference solution computed by the fixture.

Change-Id: I16a9a9a83a845a7aaf28762bcecf1a8ff5aee805
2015-09-12 15:41:05 -07: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 05a07ecc77 Remove using std::string from port.h
Change-Id: I7376f5e7eace22ec1fc05a61eaa858594f08682d
2015-01-07 15:10:46 -08: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
Petter Strandmark 88a703f44f Fix compilation in Visual C++ 2013.
I had to fix the following things to make Ceres compile in 2013:
 * Not link to 'm' (GNU math library).
 * Excplicitly convert an std::ostream to bool.
 * Include <algorithm> for std::max.

Change-Id: I3ff65413baf8711364360d46dd71fd553fa63e72
2013-10-31 20:59:20 +00:00
Petter Strandmark a5353acd85 Adding gflags include to test_util.cc
test_util seems to need gflags.

Change-Id: I0c4757960f8ac69ad599c138aea58e3c88a4ea28
2012-08-28 20:40:50 -07:00
Sameer Agarwal c6bbecf26d Consolidate path handling for test data files.
Added CERES_TEST_SRCDIR_POSTFIX macro.
Added TestFileAbsolutePath function.

Change-Id: I223b74af027bfb775447e062edab897395b21514
2012-08-14 11:35:13 -07:00
Sameer Agarwal 0beab86dfa Fix glog includes and include sorting order.
Change-Id: I0ec85218e82d1714279d41f7635104d480fb91c3
2012-08-13 15:47:24 -07:00
Keir Mierle 8ebb073038 Initial commit of Ceres Solver. 2012-04-30 23:09:08 -07:00