g2o
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
g2o::ceres Namespace Reference

Namespaces

namespace  internal
 

Classes

struct  EigenTypes
 
struct  Jet
 

Typedefs

using Vector = Eigen::Matrix< double, Eigen::Dynamic, 1 >
 
using Matrix = Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >
 
using VectorRef = Eigen::Map< Vector >
 
using MatrixRef = Eigen::Map< Matrix >
 
using ConstVectorRef = Eigen::Map< const Vector >
 
using ConstMatrixRef = Eigen::Map< const Matrix >
 
using ColMajorMatrix = Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >
 
using ColMajorMatrixRef = Eigen::Map< ColMajorMatrix, 0, Eigen::Stride< Eigen::Dynamic, 1 > >
 
using ConstColMajorMatrixRef = Eigen::Map< const ColMajorMatrix, 0, Eigen::Stride< Eigen::Dynamic, 1 > >
 

Enumerations

enum  DimensionType { kDynamic = -1 }
 

Functions

template<typename T , int N>
Jet< T, N > const & operator+ (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > operator- (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > operator+ (const Jet< T, N > &f, const Jet< T, N > &g)
 
template<typename T , int N>
Jet< T, N > operator+ (const Jet< T, N > &f, T s)
 
template<typename T , int N>
Jet< T, N > operator+ (T s, const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > operator- (const Jet< T, N > &f, const Jet< T, N > &g)
 
template<typename T , int N>
Jet< T, N > operator- (const Jet< T, N > &f, T s)
 
template<typename T , int N>
Jet< T, N > operator- (T s, const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > operator* (const Jet< T, N > &f, const Jet< T, N > &g)
 
template<typename T , int N>
Jet< T, N > operator* (const Jet< T, N > &f, T s)
 
template<typename T , int N>
Jet< T, N > operator* (T s, const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > operator/ (const Jet< T, N > &f, const Jet< T, N > &g)
 
template<typename T , int N>
Jet< T, N > operator/ (T s, const Jet< T, N > &g)
 
template<typename T , int N>
Jet< T, N > operator/ (const Jet< T, N > &f, T s)
 
bool IsFinite (double x)
 
bool IsInfinite (double x)
 
bool IsNaN (double x)
 
bool IsNormal (double x)
 
template<typename T , int N>
Jet< T, N > abs (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > log (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > exp (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > sqrt (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > cos (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > acos (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > sin (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > asin (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > tan (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > atan (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > sinh (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > cosh (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > tanh (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > floor (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > ceil (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > cbrt (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > exp2 (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > log2 (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > hypot (const Jet< T, N > &x, const Jet< T, N > &y)
 
template<typename T , int N>
Jet< T, N > fmax (const Jet< T, N > &x, const Jet< T, N > &y)
 
template<typename T , int N>
Jet< T, N > fmin (const Jet< T, N > &x, const Jet< T, N > &y)
 
template<typename T , int N>
Jet< T, N > erf (const Jet< T, N > &x)
 
template<typename T , int N>
Jet< T, N > erfc (const Jet< T, N > &x)
 
double BesselJ0 (double x)
 
double BesselJ1 (double x)
 
double BesselJn (int n, double x)
 
template<typename T , int N>
Jet< T, N > BesselJ0 (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > BesselJ1 (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > BesselJn (int n, const Jet< T, N > &f)
 
template<typename T , int N>
bool isfinite (const Jet< T, N > &f)
 
template<typename T , int N>
bool isinf (const Jet< T, N > &f)
 
template<typename T , int N>
bool isnan (const Jet< T, N > &f)
 
template<typename T , int N>
bool isnormal (const Jet< T, N > &f)
 
template<typename T , int N>
bool IsFinite (const Jet< T, N > &f)
 
template<typename T , int N>
bool IsNaN (const Jet< T, N > &f)
 
template<typename T , int N>
bool IsNormal (const Jet< T, N > &f)
 
template<typename T , int N>
bool IsInfinite (const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > atan2 (const Jet< T, N > &g, const Jet< T, N > &f)
 
template<typename T , int N>
Jet< T, N > pow (const Jet< T, N > &f, double g)
 
template<typename T , int N>
Jet< T, N > pow (T f, const Jet< T, N > &g)
 
template<typename T , int N>
Jet< T, N > pow (const Jet< T, N > &f, const Jet< T, N > &g)
 
template<typename T , int N>
std::ostream & operator<< (std::ostream &s, const Jet< T, N > &z)
 

Variables

const double kImpossibleValue = 1e302
 

Typedef Documentation

◆ ColMajorMatrix

using g2o::ceres::ColMajorMatrix = typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>

Definition at line 48 of file eigen.h.

◆ ColMajorMatrixRef

using g2o::ceres::ColMajorMatrixRef = typedef Eigen::Map<ColMajorMatrix, 0, Eigen::Stride<Eigen::Dynamic, 1> >

Definition at line 51 of file eigen.h.

◆ ConstColMajorMatrixRef

using g2o::ceres::ConstColMajorMatrixRef = typedef Eigen::Map<const ColMajorMatrix, 0, Eigen::Stride<Eigen::Dynamic, 1> >

Definition at line 54 of file eigen.h.

◆ ConstMatrixRef

using g2o::ceres::ConstMatrixRef = typedef Eigen::Map<const Matrix>

Definition at line 45 of file eigen.h.

◆ ConstVectorRef

using g2o::ceres::ConstVectorRef = typedef Eigen::Map<const Vector>

Definition at line 44 of file eigen.h.

◆ Matrix

using g2o::ceres::Matrix = typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>

Definition at line 40 of file eigen.h.

◆ MatrixRef

using g2o::ceres::MatrixRef = typedef Eigen::Map<Matrix>

Definition at line 43 of file eigen.h.

◆ Vector

using g2o::ceres::Vector = typedef Eigen::Matrix<double, Eigen::Dynamic, 1>

Definition at line 39 of file eigen.h.

◆ VectorRef

using g2o::ceres::VectorRef = typedef Eigen::Map<Vector>

Definition at line 42 of file eigen.h.

Enumeration Type Documentation

◆ DimensionType

Enumerator
kDynamic 

Definition at line 50 of file types.h.

50 {
51 kDynamic = -1,
52};
@ kDynamic
Definition types.h:51

Function Documentation

◆ abs()

template<typename T , int N>
Jet< T, N > g2o::ceres::abs ( const Jet< T, N > &  f)
inline

Definition at line 424 of file jet.h.

424 {
425 return (f.a < T(0.0) ? -f : f);
426}

References g2o::ceres::Jet< T, N >::a, and abs().

Referenced by abs().

◆ acos()

template<typename T , int N>
Jet< T, N > g2o::ceres::acos ( const Jet< T, N > &  f)
inline

Definition at line 458 of file jet.h.

458 {
459 const T tmp = -T(1.0) / sqrt(T(1.0) - f.a * f.a);
460 return Jet<T, N>(acos(f.a), tmp * f.v);
461}
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition jet.h:444
Jet< T, N > acos(const Jet< T, N > &f)
Definition jet.h:458
Eigen::Matrix< T, N, 1 > v
Definition jet.h:250

References g2o::ceres::Jet< T, N >::a, acos(), sqrt(), and g2o::ceres::Jet< T, N >::v.

Referenced by acos().

◆ asin()

template<typename T , int N>
Jet< T, N > g2o::ceres::asin ( const Jet< T, N > &  f)
inline

Definition at line 471 of file jet.h.

471 {
472 const T tmp = T(1.0) / sqrt(T(1.0) - f.a * f.a);
473 return Jet<T, N>(asin(f.a), tmp * f.v);
474}
Jet< T, N > asin(const Jet< T, N > &f)
Definition jet.h:471

References g2o::ceres::Jet< T, N >::a, asin(), sqrt(), and g2o::ceres::Jet< T, N >::v.

Referenced by asin().

◆ atan()

template<typename T , int N>
Jet< T, N > g2o::ceres::atan ( const Jet< T, N > &  f)
inline

Definition at line 486 of file jet.h.

486 {
487 const T tmp = T(1.0) / (T(1.0) + f.a * f.a);
488 return Jet<T, N>(atan(f.a), tmp * f.v);
489}
Jet< T, N > atan(const Jet< T, N > &f)
Definition jet.h:486

References g2o::ceres::Jet< T, N >::a, atan(), and g2o::ceres::Jet< T, N >::v.

Referenced by atan().

◆ atan2()

template<typename T , int N>
Jet< T, N > g2o::ceres::atan2 ( const Jet< T, N > &  g,
const Jet< T, N > &  f 
)
inline

Definition at line 730 of file jet.h.

730 {
731 // Note order of arguments:
732 //
733 // f = a + da
734 // g = b + db
735
736 T const tmp = T(1.0) / (f.a * f.a + g.a * g.a);
737 return Jet<T, N>(atan2(g.a, f.a), tmp * (-g.a * f.v + f.a * g.v));
738}
Jet< T, N > atan2(const Jet< T, N > &g, const Jet< T, N > &f)
Definition jet.h:730

References g2o::ceres::Jet< T, N >::a, atan2(), and g2o::ceres::Jet< T, N >::v.

Referenced by atan2().

◆ BesselJ0() [1/2]

template<typename T , int N>
Jet< T, N > g2o::ceres::BesselJ0 ( const Jet< T, N > &  f)
inline

Definition at line 630 of file jet.h.

630 {
631 return Jet<T, N>(BesselJ0(f.a), -BesselJ1(f.a) * f.v);
632}
double BesselJ1(double x)
Definition jet.h:606
double BesselJ0(double x)
Definition jet.h:599

References g2o::ceres::Jet< T, N >::a, BesselJ0(), BesselJ1(), and g2o::ceres::Jet< T, N >::v.

◆ BesselJ0() [2/2]

double g2o::ceres::BesselJ0 ( double  x)
inline

Definition at line 599 of file jet.h.

599 {
600#if defined(G2O_CERES_MSVC_USE_UNDERSCORE_PREFIXED_BESSEL_FUNCTIONS)
601 return _j0(x);
602#else
603 return j0(x);
604#endif
605}

Referenced by BesselJ0(), and BesselJ1().

◆ BesselJ1() [1/2]

template<typename T , int N>
Jet< T, N > g2o::ceres::BesselJ1 ( const Jet< T, N > &  f)
inline

Definition at line 637 of file jet.h.

637 {
638 return Jet<T, N>(BesselJ1(f.a),
639 T(0.5) * (BesselJ0(f.a) - BesselJn(2, f.a)) * f.v);
640}
double BesselJn(int n, double x)
Definition jet.h:613

References g2o::ceres::Jet< T, N >::a, BesselJ0(), BesselJ1(), BesselJn(), and g2o::ceres::Jet< T, N >::v.

◆ BesselJ1() [2/2]

double g2o::ceres::BesselJ1 ( double  x)
inline

Definition at line 606 of file jet.h.

606 {
607#if defined(G2O_CERES_MSVC_USE_UNDERSCORE_PREFIXED_BESSEL_FUNCTIONS)
608 return _j1(x);
609#else
610 return j1(x);
611#endif
612}

Referenced by BesselJ0(), and BesselJ1().

◆ BesselJn() [1/2]

template<typename T , int N>
Jet< T, N > g2o::ceres::BesselJn ( int  n,
const Jet< T, N > &  f 
)
inline

Definition at line 645 of file jet.h.

645 {
646 return Jet<T, N>(
647 BesselJn(n, f.a),
648 T(0.5) * (BesselJn(n - 1, f.a) - BesselJn(n + 1, f.a)) * f.v);
649}

References g2o::ceres::Jet< T, N >::a, BesselJn(), and g2o::ceres::Jet< T, N >::v.

◆ BesselJn() [2/2]

double g2o::ceres::BesselJn ( int  n,
double  x 
)
inline

Definition at line 613 of file jet.h.

613 {
614#if defined(G2O_CERES_MSVC_USE_UNDERSCORE_PREFIXED_BESSEL_FUNCTIONS)
615 return _jn(n, x);
616#else
617 return jn(n, x);
618#endif
619}

Referenced by BesselJ1(), and BesselJn().

◆ cbrt()

template<typename T , int N>
Jet< T, N > g2o::ceres::cbrt ( const Jet< T, N > &  f)
inline

Definition at line 533 of file jet.h.

533 {
534 const T derivative = T(1.0) / (T(3.0) * cbrt(f.a * f.a));
535 return Jet<T, N>(cbrt(f.a), f.v * derivative);
536}
Jet< T, N > cbrt(const Jet< T, N > &f)
Definition jet.h:533

References g2o::ceres::Jet< T, N >::a, cbrt(), and g2o::ceres::Jet< T, N >::v.

Referenced by cbrt().

◆ ceil()

template<typename T , int N>
Jet< T, N > g2o::ceres::ceil ( const Jet< T, N > &  f)
inline

Definition at line 525 of file jet.h.

525 {
526 return Jet<T, N>(ceil(f.a));
527}
Jet< T, N > ceil(const Jet< T, N > &f)
Definition jet.h:525

References g2o::ceres::Jet< T, N >::a, and ceil().

Referenced by ceil().

◆ cos()

template<typename T , int N>
Jet< T, N > g2o::ceres::cos ( const Jet< T, N > &  f)
inline

Definition at line 452 of file jet.h.

452 {
453 return Jet<T, N>(cos(f.a), -sin(f.a) * f.v);
454}
Jet< T, N > cos(const Jet< T, N > &f)
Definition jet.h:452
Jet< T, N > sin(const Jet< T, N > &f)
Definition jet.h:465

References g2o::ceres::Jet< T, N >::a, cos(), sin(), and g2o::ceres::Jet< T, N >::v.

Referenced by cos(), and sin().

◆ cosh()

template<typename T , int N>
Jet< T, N > g2o::ceres::cosh ( const Jet< T, N > &  f)
inline

Definition at line 499 of file jet.h.

499 {
500 return Jet<T, N>(cosh(f.a), sinh(f.a) * f.v);
501}
Jet< T, N > cosh(const Jet< T, N > &f)
Definition jet.h:499
Jet< T, N > sinh(const Jet< T, N > &f)
Definition jet.h:493

References g2o::ceres::Jet< T, N >::a, cosh(), sinh(), and g2o::ceres::Jet< T, N >::v.

Referenced by cosh(), and sinh().

◆ erf()

template<typename T , int N>
Jet< T, N > g2o::ceres::erf ( const Jet< T, N > &  x)
inline

Definition at line 582 of file jet.h.

582 {
583 return Jet<T, N>(erf(x.a), x.v * M_2_SQRTPI * exp(-x.a * x.a));
584}
Jet< T, N > erf(const Jet< T, N > &x)
Definition jet.h:582
Jet< T, N > exp(const Jet< T, N > &f)
Definition jet.h:437

References g2o::ceres::Jet< T, N >::a, erf(), exp(), and g2o::ceres::Jet< T, N >::v.

Referenced by erf().

◆ erfc()

template<typename T , int N>
Jet< T, N > g2o::ceres::erfc ( const Jet< T, N > &  x)
inline

Definition at line 589 of file jet.h.

589 {
590 return Jet<T, N>(erfc(x.a), -x.v * M_2_SQRTPI * exp(-x.a * x.a));
591}
Jet< T, N > erfc(const Jet< T, N > &x)
Definition jet.h:589

References g2o::ceres::Jet< T, N >::a, erfc(), exp(), and g2o::ceres::Jet< T, N >::v.

Referenced by erfc().

◆ exp()

template<typename T , int N>
Jet< T, N > g2o::ceres::exp ( const Jet< T, N > &  f)
inline

Definition at line 437 of file jet.h.

437 {
438 const T tmp = exp(f.a);
439 return Jet<T, N>(tmp, tmp * f.v);
440}

References g2o::ceres::Jet< T, N >::a, exp(), and g2o::ceres::Jet< T, N >::v.

Referenced by erf(), erfc(), and exp().

◆ exp2()

template<typename T , int N>
Jet< T, N > g2o::ceres::exp2 ( const Jet< T, N > &  f)
inline

Definition at line 540 of file jet.h.

540 {
541 const T tmp = exp2(f.a);
542 const T derivative = tmp * log(T(2));
543 return Jet<T, N>(tmp, f.v * derivative);
544}
Jet< T, N > log(const Jet< T, N > &f)
Definition jet.h:430
Jet< T, N > exp2(const Jet< T, N > &f)
Definition jet.h:540

References g2o::ceres::Jet< T, N >::a, exp2(), log(), and g2o::ceres::Jet< T, N >::v.

Referenced by exp2().

◆ floor()

template<typename T , int N>
Jet< T, N > g2o::ceres::floor ( const Jet< T, N > &  f)
inline

Definition at line 516 of file jet.h.

516 {
517 return Jet<T, N>(floor(f.a));
518}
Jet< T, N > floor(const Jet< T, N > &f)
Definition jet.h:516

References g2o::ceres::Jet< T, N >::a, and floor().

Referenced by floor(), pow(), and pow().

◆ fmax()

template<typename T , int N>
Jet< T, N > g2o::ceres::fmax ( const Jet< T, N > &  x,
const Jet< T, N > &  y 
)
inline

Definition at line 569 of file jet.h.

569 {
570 return x < y ? y : x;
571}

References fmax().

Referenced by fmax().

◆ fmin()

template<typename T , int N>
Jet< T, N > g2o::ceres::fmin ( const Jet< T, N > &  x,
const Jet< T, N > &  y 
)
inline

Definition at line 574 of file jet.h.

574 {
575 return y < x ? y : x;
576}

References fmin().

Referenced by fmin().

◆ hypot()

template<typename T , int N>
Jet< T, N > g2o::ceres::hypot ( const Jet< T, N > &  x,
const Jet< T, N > &  y 
)
inline

Definition at line 558 of file jet.h.

558 {
559 // d/da sqrt(a) = 0.5 / sqrt(a)
560 // d/dx x^2 + y^2 = 2x
561 // So by the chain rule:
562 // d/dx sqrt(x^2 + y^2) = 0.5 / sqrt(x^2 + y^2) * 2x = x / sqrt(x^2 + y^2)
563 // d/dy sqrt(x^2 + y^2) = y / sqrt(x^2 + y^2)
564 const T tmp = hypot(x.a, y.a);
565 return Jet<T, N>(tmp, x.a / tmp * x.v + y.a / tmp * y.v);
566}
Jet< T, N > hypot(const Jet< T, N > &x, const Jet< T, N > &y)
Definition jet.h:558

References g2o::ceres::Jet< T, N >::a, hypot(), and g2o::ceres::Jet< T, N >::v.

Referenced by hypot().

◆ isfinite()

template<typename T , int N>
bool g2o::ceres::isfinite ( const Jet< T, N > &  f)
inline

Definition at line 663 of file jet.h.

663 {
664 // Branchless implementation. This is more efficient for the false-case and
665 // works with the codegen system.
666 auto result = isfinite(f.a);
667 for (int i = 0; i < N; ++i) {
668 result = result & isfinite(f.v[i]);
669 }
670 return result;
671}
bool isfinite(const Jet< T, N > &f)
Definition jet.h:663

References g2o::ceres::Jet< T, N >::a, isfinite(), and g2o::ceres::Jet< T, N >::v.

Referenced by isfinite(), and IsFinite().

◆ IsFinite() [1/2]

template<typename T , int N>
bool g2o::ceres::IsFinite ( const Jet< T, N > &  f)
inline

Definition at line 705 of file jet.h.

705 {
706 return isfinite(f);
707}

References isfinite().

◆ IsFinite() [2/2]

bool g2o::ceres::IsFinite ( double  x)
inline

Definition at line 414 of file jet.h.

414{ return std::isfinite(x); }

◆ isinf()

template<typename T , int N>
bool g2o::ceres::isinf ( const Jet< T, N > &  f)
inline

Definition at line 675 of file jet.h.

675 {
676 auto result = isinf(f.a);
677 for (int i = 0; i < N; ++i) {
678 result = result | isinf(f.v[i]);
679 }
680 return result;
681}
bool isinf(const Jet< T, N > &f)
Definition jet.h:675

References g2o::ceres::Jet< T, N >::a, isinf(), and g2o::ceres::Jet< T, N >::v.

Referenced by isinf(), and IsInfinite().

◆ IsInfinite() [1/2]

template<typename T , int N>
bool g2o::ceres::IsInfinite ( const Jet< T, N > &  f)
inline

Definition at line 721 of file jet.h.

721 {
722 return isinf(f);
723}

References isinf().

◆ IsInfinite() [2/2]

bool g2o::ceres::IsInfinite ( double  x)
inline

Definition at line 415 of file jet.h.

415{ return std::isinf(x); }

◆ isnan()

template<typename T , int N>
bool g2o::ceres::isnan ( const Jet< T, N > &  f)
inline

Definition at line 685 of file jet.h.

685 {
686 auto result = isnan(f.a);
687 for (int i = 0; i < N; ++i) {
688 result = result | isnan(f.v[i]);
689 }
690 return result;
691}
bool isnan(const Jet< T, N > &f)
Definition jet.h:685

References g2o::ceres::Jet< T, N >::a, isnan(), and g2o::ceres::Jet< T, N >::v.

Referenced by isnan(), and IsNaN().

◆ IsNaN() [1/2]

template<typename T , int N>
bool g2o::ceres::IsNaN ( const Jet< T, N > &  f)
inline

Definition at line 710 of file jet.h.

710 {
711 return isnan(f);
712}

References isnan().

◆ IsNaN() [2/2]

bool g2o::ceres::IsNaN ( double  x)
inline

Definition at line 416 of file jet.h.

416{ return std::isnan(x); }

◆ isnormal()

template<typename T , int N>
bool g2o::ceres::isnormal ( const Jet< T, N > &  f)
inline

Definition at line 695 of file jet.h.

695 {
696 auto result = isnormal(f.a);
697 for (int i = 0; i < N; ++i) {
698 result = result & isnormal(f.v[i]);
699 }
700 return result;
701}
bool isnormal(const Jet< T, N > &f)
Definition jet.h:695

References g2o::ceres::Jet< T, N >::a, isnormal(), and g2o::ceres::Jet< T, N >::v.

Referenced by isnormal(), and IsNormal().

◆ IsNormal() [1/2]

template<typename T , int N>
bool g2o::ceres::IsNormal ( const Jet< T, N > &  f)
inline

Definition at line 715 of file jet.h.

715 {
716 return isnormal(f);
717}

References isnormal().

◆ IsNormal() [2/2]

bool g2o::ceres::IsNormal ( double  x)
inline

Definition at line 417 of file jet.h.

417{ return std::isnormal(x); }

◆ log()

template<typename T , int N>
Jet< T, N > g2o::ceres::log ( const Jet< T, N > &  f)
inline

Definition at line 430 of file jet.h.

430 {
431 const T a_inverse = T(1.0) / f.a;
432 return Jet<T, N>(log(f.a), f.v * a_inverse);
433}

References g2o::ceres::Jet< T, N >::a, log(), and g2o::ceres::Jet< T, N >::v.

Referenced by exp2(), log(), log2(), pow(), and pow().

◆ log2()

template<typename T , int N>
Jet< T, N > g2o::ceres::log2 ( const Jet< T, N > &  f)
inline

Definition at line 548 of file jet.h.

548 {
549 const T derivative = T(1.0) / (f.a * log(T(2)));
550 return Jet<T, N>(log2(f.a), f.v * derivative);
551}
Jet< T, N > log2(const Jet< T, N > &f)
Definition jet.h:548

References g2o::ceres::Jet< T, N >::a, log(), log2(), and g2o::ceres::Jet< T, N >::v.

Referenced by log2().

◆ operator*() [1/3]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator* ( const Jet< T, N > &  f,
const Jet< T, N > &  g 
)
inline

Definition at line 310 of file jet.h.

310 {
311 return Jet<T, N>(f.a * g.a, f.a * g.v + f.v * g.a);
312}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator*() [2/3]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator* ( const Jet< T, N > &  f,
s 
)
inline

Definition at line 316 of file jet.h.

316 {
317 return Jet<T, N>(f.a * s, f.v * s);
318}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator*() [3/3]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator* ( s,
const Jet< T, N > &  f 
)
inline

Definition at line 322 of file jet.h.

322 {
323 return Jet<T, N>(f.a * s, f.v * s);
324}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator+() [1/4]

template<typename T , int N>
Jet< T, N > const & g2o::ceres::operator+ ( const Jet< T, N > &  f)
inline

Definition at line 259 of file jet.h.

259 {
260 return f;
261}

◆ operator+() [2/4]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator+ ( const Jet< T, N > &  f,
const Jet< T, N > &  g 
)
inline

Definition at line 274 of file jet.h.

274 {
275 return Jet<T, N>(f.a + g.a, f.v + g.v);
276}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator+() [3/4]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator+ ( const Jet< T, N > &  f,
s 
)
inline

Definition at line 280 of file jet.h.

280 {
281 return Jet<T, N>(f.a + s, f.v);
282}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator+() [4/4]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator+ ( s,
const Jet< T, N > &  f 
)
inline

Definition at line 286 of file jet.h.

286 {
287 return Jet<T, N>(f.a + s, f.v);
288}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator-() [1/4]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator- ( const Jet< T, N > &  f)
inline

Definition at line 268 of file jet.h.

268 {
269 return Jet<T, N>(-f.a, -f.v);
270}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator-() [2/4]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator- ( const Jet< T, N > &  f,
const Jet< T, N > &  g 
)
inline

Definition at line 292 of file jet.h.

292 {
293 return Jet<T, N>(f.a - g.a, f.v - g.v);
294}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator-() [3/4]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator- ( const Jet< T, N > &  f,
s 
)
inline

Definition at line 298 of file jet.h.

298 {
299 return Jet<T, N>(f.a - s, f.v);
300}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator-() [4/4]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator- ( s,
const Jet< T, N > &  f 
)
inline

Definition at line 304 of file jet.h.

304 {
305 return Jet<T, N>(s - f.a, -f.v);
306}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator/() [1/3]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator/ ( const Jet< T, N > &  f,
const Jet< T, N > &  g 
)
inline

Definition at line 328 of file jet.h.

328 {
329 // This uses:
330 //
331 // a + u (a + u)(b - v) (a + u)(b - v)
332 // ----- = -------------- = --------------
333 // b + v (b + v)(b - v) b^2
334 //
335 // which holds because v*v = 0.
336 const T g_a_inverse = T(1.0) / g.a;
337 const T f_a_by_g_a = f.a * g_a_inverse;
338 return Jet<T, N>(f_a_by_g_a, (f.v - f_a_by_g_a * g.v) * g_a_inverse);
339}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator/() [2/3]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator/ ( const Jet< T, N > &  f,
s 
)
inline

Definition at line 350 of file jet.h.

350 {
351 const T s_inverse = T(1.0) / s;
352 return Jet<T, N>(f.a * s_inverse, f.v * s_inverse);
353}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator/() [3/3]

template<typename T , int N>
Jet< T, N > g2o::ceres::operator/ ( s,
const Jet< T, N > &  g 
)
inline

Definition at line 343 of file jet.h.

343 {
344 const T minus_s_g_a_inverse2 = -s / (g.a * g.a);
345 return Jet<T, N>(s / g.a, g.v * minus_s_g_a_inverse2);
346}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ operator<<()

template<typename T , int N>
std::ostream & g2o::ceres::operator<< ( std::ostream &  s,
const Jet< T, N > &  z 
)
inline

Definition at line 862 of file jet.h.

862 {
863 s << "[" << z.a << " ; ";
864 for (int i = 0; i < N; ++i) {
865 s << z.v[i];
866 if (i != N - 1) {
867 s << ", ";
868 }
869 }
870 s << "]";
871 return s;
872}

References g2o::ceres::Jet< T, N >::a, and g2o::ceres::Jet< T, N >::v.

◆ pow() [1/3]

template<typename T , int N>
Jet< T, N > g2o::ceres::pow ( const Jet< T, N > &  f,
const Jet< T, N > &  g 
)
inline

Definition at line 822 of file jet.h.

822 {
823 Jet<T, N> result;
824
825 if (f.a == T(0) && g.a >= T(1)) {
826 // Handle cases 2 and 3.
827 if (g.a > T(1)) {
828 result = Jet<T, N>(T(0.0));
829 } else {
830 result = f;
831 }
832
833 } else {
834 if (f.a < T(0) && g.a == floor(g.a)) {
835 // Handle cases 7 and 8.
836 T const tmp = g.a * pow(f.a, g.a - T(1.0));
837 result = Jet<T, N>(pow(f.a, g.a), tmp * f.v);
838 for (int i = 0; i < N; i++) {
839 if (g.v[i] != T(0.0)) {
840 // Return a NaN when g.v != 0.
841 result.v[i] = T(std::numeric_limits<double>::quiet_NaN());
842 }
843 }
844 } else {
845 // Handle the remaining cases. For cases 4,5,6,9 we allow the log()
846 // function to generate -HUGE_VAL or NaN, since those cases result in a
847 // nonfinite derivative.
848 T const tmp1 = pow(f.a, g.a);
849 T const tmp2 = g.a * pow(f.a, g.a - T(1.0));
850 T const tmp3 = tmp1 * log(f.a);
851 result = Jet<T, N>(tmp1, tmp2 * f.v + tmp3 * g.v);
852 }
853 }
854
855 return result;
856}
Jet< T, N > pow(const Jet< T, N > &f, double g)
Definition jet.h:743

References g2o::ceres::Jet< T, N >::a, floor(), log(), pow(), and g2o::ceres::Jet< T, N >::v.

◆ pow() [2/3]

template<typename T , int N>
Jet< T, N > g2o::ceres::pow ( const Jet< T, N > &  f,
double  g 
)
inline

Definition at line 743 of file jet.h.

743 {
744 T const tmp = g * pow(f.a, g - T(1.0));
745 return Jet<T, N>(pow(f.a, g), tmp * f.v);
746}

References g2o::ceres::Jet< T, N >::a, pow(), and g2o::ceres::Jet< T, N >::v.

Referenced by pow(), pow(), and pow().

◆ pow() [3/3]

template<typename T , int N>
Jet< T, N > g2o::ceres::pow ( f,
const Jet< T, N > &  g 
)
inline

Definition at line 760 of file jet.h.

760 {
761 Jet<T, N> result;
762
763 if (f == T(0) && g.a > T(0)) {
764 // Handle case 2.
765 result = Jet<T, N>(T(0.0));
766 } else {
767 if (f < 0 && g.a == floor(g.a)) { // Handle case 3.
768 result = Jet<T, N>(pow(f, g.a));
769 for (int i = 0; i < N; i++) {
770 if (g.v[i] != T(0.0)) {
771 // Return a NaN when g.v != 0.
772 result.v[i] = std::numeric_limits<T>::quiet_NaN();
773 }
774 }
775 } else {
776 // Handle case 1.
777 T const tmp = pow(f, g.a);
778 result = Jet<T, N>(tmp, log(f) * tmp * g.v);
779 }
780 }
781
782 return result;
783}

References g2o::ceres::Jet< T, N >::a, floor(), log(), pow(), and g2o::ceres::Jet< T, N >::v.

◆ sin()

template<typename T , int N>
Jet< T, N > g2o::ceres::sin ( const Jet< T, N > &  f)
inline

Definition at line 465 of file jet.h.

465 {
466 return Jet<T, N>(sin(f.a), cos(f.a) * f.v);
467}

References g2o::ceres::Jet< T, N >::a, cos(), sin(), and g2o::ceres::Jet< T, N >::v.

Referenced by cos(), and sin().

◆ sinh()

template<typename T , int N>
Jet< T, N > g2o::ceres::sinh ( const Jet< T, N > &  f)
inline

Definition at line 493 of file jet.h.

493 {
494 return Jet<T, N>(sinh(f.a), cosh(f.a) * f.v);
495}

References g2o::ceres::Jet< T, N >::a, cosh(), sinh(), and g2o::ceres::Jet< T, N >::v.

Referenced by cosh(), and sinh().

◆ sqrt()

template<typename T , int N>
Jet< T, N > g2o::ceres::sqrt ( const Jet< T, N > &  f)
inline

Definition at line 444 of file jet.h.

444 {
445 const T tmp = sqrt(f.a);
446 const T two_a_inverse = T(1.0) / (T(2.0) * tmp);
447 return Jet<T, N>(tmp, f.v * two_a_inverse);
448}

References g2o::ceres::Jet< T, N >::a, sqrt(), and g2o::ceres::Jet< T, N >::v.

Referenced by acos(), asin(), and sqrt().

◆ tan()

template<typename T , int N>
Jet< T, N > g2o::ceres::tan ( const Jet< T, N > &  f)
inline

Definition at line 478 of file jet.h.

478 {
479 const T tan_a = tan(f.a);
480 const T tmp = T(1.0) + tan_a * tan_a;
481 return Jet<T, N>(tan_a, tmp * f.v);
482}
Jet< T, N > tan(const Jet< T, N > &f)
Definition jet.h:478

References g2o::ceres::Jet< T, N >::a, tan(), and g2o::ceres::Jet< T, N >::v.

Referenced by tan().

◆ tanh()

template<typename T , int N>
Jet< T, N > g2o::ceres::tanh ( const Jet< T, N > &  f)
inline

Definition at line 505 of file jet.h.

505 {
506 const T tanh_a = tanh(f.a);
507 const T tmp = T(1.0) - tanh_a * tanh_a;
508 return Jet<T, N>(tanh_a, tmp * f.v);
509}
Jet< T, N > tanh(const Jet< T, N > &f)
Definition jet.h:505

References g2o::ceres::Jet< T, N >::a, tanh(), and g2o::ceres::Jet< T, N >::v.

Referenced by tanh().

Variable Documentation

◆ kImpossibleValue

const double g2o::ceres::kImpossibleValue = 1e302

Definition at line 59 of file types.h.

Referenced by g2o::ceres::internal::AutoDifferentiate().