farm-ng-core
jet_helpers.h
Go to the documentation of this file.
1 // Copyright (c) 2011, Hauke Strasdat
2 // Copyright (c) 2012, Steven Lovegrove
3 // Copyright (c) 2021, farm-ng, inc.
4 //
5 // Use of this source code is governed by an MIT-style
6 // license that can be found in the LICENSE file or at
7 // https://opensource.org/licenses/MIT.
8 
9 #pragma once
10 
11 // Forward declare ceres::Jet, so we don't have to include <ceres/jet.h> here,
12 // and core does not have to depend on ceres.
13 namespace ceres {
14 template <class TScalar, int kN>
15 struct Jet;
16 } // namespace ceres
17 
18 namespace sophus {
19 
20 namespace jet_helpers {
21 
22 template <class TScalar>
23 struct GetValue {
24  static auto impl(TScalar const& t) -> TScalar { return t; }
25 };
26 
27 template <class TScalar, int kN>
28 struct GetValue<::ceres::Jet<TScalar, kN>> {
29  static auto impl(TScalar const& t) -> TScalar { return t.a; }
30 };
31 
32 } // namespace jet_helpers
33 } // namespace sophus
sophus::jet_helpers::GetValue::impl
static auto impl(TScalar const &t) -> TScalar
Definition: jet_helpers.h:24
sophus
Image MutImage, owning images types.
Definition: num_diff.h:20
ceres::Jet
Definition: jet_helpers.h:15
sophus::jet_helpers::GetValue
Definition: jet_helpers.h:23
sophus::jet_helpers::GetValue<::ceres::Jet< TScalar, kN > >::impl
static auto impl(TScalar const &t) -> TScalar
Definition: jet_helpers.h:29
ceres
Definition: jet_helpers.h:13