Commit Graph

542 Commits

Author SHA1 Message Date
Daniel J. Hofmann
5de8f1803c Folds mercator projections into coordinate_calculation 2016-02-12 15:46:24 -08:00
karenzshea
7398bed974 Include real coordinates in debug geojson mode 2016-02-11 17:09:20 -05:00
Dane Springmeyer
2949a52a11 remove uneeded and deprecated usage of mapbox::util::static_visitor 2016-02-10 12:58:36 -08:00
Daniel J. Hofmann
b8d20dfe99 Prevent undefined behavior from left shifting into sign bit when offset is 31 2016-02-08 11:47:44 -08:00
Daniel J. Hofmann
fa8529949b Make swap noexcept (as it has to be!) and fix swap misuses 2016-02-08 11:47:44 -08:00
Daniel J. Hofmann
7b37c847bd Fixes shared memory wrapper includes 2016-02-08 11:47:02 -08:00
Kerrick Staley
8804330d83 Add operator<< to OSRM_STRONG_TYPEDEF
Useful for debugging.
2016-02-01 12:32:30 -08:00
karenzshea
262cdd7bc0 move tribool obj into request_parser 2016-01-29 23:49:09 +01:00
Daniel J. Hofmann
a48f02e0da Takes care of proper special member generation globally, fixes #1689
Phew, a lot of classes were affected by this. The rationale for the
changes are as follows:

- When a type X declares any constructor, the default constructor is
  not declared, so there is no need for X() = delete there. In fact,
  there is brutal difference between those two: deleted members
  participate in overload resolution, but not-declared members do not!

- When a type X wants to be non-copyable (e.g. to be only movable, like
  threads, unique_ptrs, and so on), you can either do it by inheriting
  from boost::noncopyable (the old way), or better declare both (!) the
  copy constructor _and_ the copy assignment operator as deleted:

      X(X const&) = delete;
      X& operator=(X const&) = delete;

  We had tons of types with deleted copy constructors that were lacking
  a corresponding deleted copy assignment operator, making them still
  copyable and you wouldn't even notice (read: scary)!

References:

- http://accu.org/content/conf2014/Howard_Hinnant_Accu_2014.pdf
- http://www.boost.org/doc/libs/master/libs/core/doc/html/core/noncopyable.html

Note: I know, I'm quoting Hinnant's extraordinary slides a lot, but
getting the sematic right here is so incredibly important.
2016-01-27 17:25:30 +01:00
Patrick Niklaus
0802804677 Fix PR comments 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
38e8a90f4e Make HilbertCode a free standing function 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
d391df52ba Be kind to the optimizer, pass coordinates by value (just two ints) 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
46fc6f8da4 Collapse computeAngle into coordinate calculation 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
312b414d8f Adapts XORFastHashStorage to XORFastHash compile time limits 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
a6e7954128 Make XORFastHash's number of hashable elements compile time constant
Still constraint by the usage of uint32_t and subsequent splitting into
two uint16_t we use for indexing into the tables.
2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
1417d43430 Cut down memory usage for tables in XORFastHash by factor of four
`pow(2, 16)` is not `2 << 16` but rather `1 << 16`.

With this change we cut memory usage in half for the XORFastHash's two
tables. Adapts XORFastHashStorage, memory usage reduction by factor two.
2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
60ef6070b0 Simplify uint32_t splitting in XORFastHash 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
2f42196fca Explicitely type XORFastHash 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
f8b5e7e2c9 Removes XORMiniHash, unused 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
2c0547bb0e Make XORFastHash great again 2016-01-26 17:54:08 +01:00
Mortada Mehyar
b48022be22 make it possible to disable max_locations in map_matching 2016-01-25 14:53:44 -08:00
Daniel J. Hofmann
502aedb33e Provide a way to selectively enable assertions in release mode
- Throwing an assertion exception for proper stack unwinding, making
  sure destructors are called

- On in Debug mode, in Release, enable via:

      cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_ASSERTIONS=ON

Current problem that I'm seeing is that some code is not catching
exceptions or worse silently swallowing them. Would like to check the
whole pipeline before merging this in.
2016-01-21 15:37:25 +01:00
Patrick Niklaus
439eb9da3d Create public facing libraries for extractor, contractor and datastore
New libraries libosrm_extract, libosrm_contract, libosrm_store
2016-01-21 06:47:34 +01:00
Moritz Kobitzsch
1c1bfd7541 Fix routing when start and target are on the same segment
Fixes issue #1864. Given the simple set-up:

a --> b --> c
^-----------|

This would translate into an edge based graph (ab) -> (bc),
(bc) -> (ca), (ca) -> (ab).

Starting at the end of the one-way street (ab) and going to
the beginning, the query has to find a self-loop within the
graph (ab) -> (bc) -> (ca) -> (ab), as both nodes map to the
same segment (ab).
2016-01-19 23:26:19 +01:00
Daniel J. Hofmann
e20f92bbbb Anonymous namespaces in header files are bad
They duplicate the code across translation units.
2016-01-19 17:42:49 +01:00
Daniel J. Hofmann
491b1d9c96 Remove headers with no reverse dependencies
Found with

```
daniel@x1c /t/o/i/util> for header in *.hpp
                            echo -n $header:
                            ag -iQ $header ../../ --noheading | wc -l
                        end
...
fixed_point_number.hpp:0
range_algorithms.hpp:0
...
```

Only two. Surprises me to be honest.
But we're cleaning up for quite a bit now.
2016-01-18 16:05:39 +01:00
Daniel J. Hofmann
466251287f Define compile-time constants for coordinate calculation only once
Closes #1327.
2016-01-12 19:59:02 +01:00
Daniel J. Hofmann
c93ca02fb8 Rips out dead code from the container.hpp and creates for_each_pai.hpp
I added two TODOs that I would like to address in the future.
2016-01-11 20:14:35 +01:00
Daniel J. Hofmann
4813488f84 Split import_edge.hpp: node_based_edge.hpp, edge_based_edge.hpp closes #1604 2016-01-11 20:11:44 +01:00
Daniel J. Hofmann
f875e26fbf Inline mercator transformations; no need for separate translation unit 2016-01-11 20:10:45 +01:00
Daniel J. Hofmann
f68247673a Make ComputeAngle a free standing function 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
21804aecdb Prefer inline over static inline for free standing functions
When you mark free standing functions as `static inline` instead
of just `inline` they can not get merged across TUs and therefore
produce code bloat which is bad for the binaries size, the CPUs
instruction cache, and so on.

Please also see the discussion at:

- https://groups.google.com/forum/#!topic/mozilla.dev.platform/Ulw9HoZbSyQ
- http://stackoverflow.com/a/12836392

Note that non-fully specialized templates (i.e. with a kind of at
least `Template :: * -> *`) are `inline` by default.
2016-01-08 23:33:31 +01:00
Patrick Niklaus
6991a38703 Run clang-format 2016-01-08 01:31:57 +01:00
Patrick Niklaus
6b18e4f7e9 Add namespace around all files 2016-01-08 01:30:52 +01:00
Patrick Niklaus
4312013552 Fix naming in coordinate_calculation 2016-01-05 12:06:34 +01:00
Patrick Niklaus
b209952ce0 Fix naming of methodes for RouteParameters 2016-01-05 12:06:33 +01:00
Patrick Niklaus
028ca5c9d9 Apply clang-format 2016-01-05 12:04:04 +01:00
Patrick Niklaus
552cdbfe20 Apply clang-tidy 2016-01-05 11:54:31 +01:00
Daniel J. Hofmann
685d330ee2 Remove license headers from project source files; global license 2016-01-04 19:06:32 +01:00
Mortada Mehyar
93a2e66704 use double precision calculations instead of mixing double and float 2016-01-03 20:44:38 -08:00
Patrick Niklaus
97585bb26a Fix include paths 2016-01-03 18:47:50 +01:00
Patrick Niklaus
bfc6c9b89d Move files in src/ include/ 2016-01-03 16:37:38 +01:00