Ring.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 #pragma once
20 
21 #include <algorithm>
22 
24 struct Ring {
25  static inline double zero() { return 0.0; }
26  static inline double one() { return 1.0; }
27  static inline double add(const double& a, const double& b) { return a + b; }
28  static inline double max(const double& a, const double& b) {
29  return std::max(a, b);
30  }
31  static inline double mul(const double& a, const double& b) { return a * b; }
32  static inline double div(const double& a, const double& b) {
33  return (a == 0 || b == 0) ? 0 : (a / b);
34  }
35  static inline double id(const double& x) { return x; }
36  static inline double negate(const double& x) { return -x; }
37 };
Ring::div
static double div(const double &a, const double &b)
Definition: Ring.h:32
b
Scalar * b
Definition: benchVecAdd.cpp:17
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
Ring
Definition: Ring.h:24
Ring::mul
static double mul(const double &a, const double &b)
Definition: Ring.h:31
Ring::one
static double one()
Definition: Ring.h:26
Ring::zero
static double zero()
Definition: Ring.h:25
Ring::max
static double max(const double &a, const double &b)
Definition: Ring.h:28
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Ring::add
static double add(const double &a, const double &b)
Definition: Ring.h:27
max
#define max(a, b)
Definition: datatypes.h:20
Ring::negate
static double negate(const double &x)
Definition: Ring.h:36
Ring::id
static double id(const double &x)
Definition: Ring.h:35


gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:02:51