GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Errors.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 
18 // \callgraph
19 
20 #pragma once
21 
22 #include <gtsam/base/FastList.h>
23 #include <gtsam/base/Testable.h>
24 #include <gtsam/base/Vector.h>
25 
26 #include <string>
27 
28 namespace gtsam {
29 
30 // Forward declarations
31 class VectorValues;
32 
35 
37 GTSAM_EXPORT Errors createErrors(const VectorValues& V);
38 
40 GTSAM_EXPORT void print(const Errors& e, const std::string& s = "Errors");
41 
42 // Check equality for unit testing.
43 GTSAM_EXPORT bool equality(const Errors& actual, const Errors& expected,
44  double tol = 1e-9);
45 
47 GTSAM_EXPORT Errors operator+(const Errors& a, const Errors& b);
48 
50 GTSAM_EXPORT Errors operator-(const Errors& a, const Errors& b);
51 
53 GTSAM_EXPORT Errors operator-(const Errors& a);
54 
56 GTSAM_EXPORT double dot(const Errors& a, const Errors& b);
57 
59 GTSAM_EXPORT void axpy(double alpha, const Errors& x, Errors& y);
60 
62 template <>
63 struct traits<Errors> {
64  static void Print(const Errors& e, const std::string& str = "") {
65  print(e, str);
66  }
67  static bool Equals(const Errors& actual, const Errors& expected,
68  double tol = 1e-8) {
69  return equality(actual, expected, tol);
70  }
71 };
72 
73 } // namespace gtsam
GTSAM_EXPORT Errors createErrors(const VectorValues &V)
Break V into pieces according to its start indices.
A thin wrapper around std::list that uses boost&#39;s fast_pool_allocator.
Concept check for values that can be used in unit tests.
double dot(const V1 &a, const V2 &b)
Definition: Vector.h:195
Definition: Group.h:43
Definition: VectorValues.h:74
GTSAM_EXPORT void print(const Matrix &A, const std::string &s, std::ostream &stream)
Definition: chartTesting.h:28
typedef and functions to augment Eigen&#39;s VectorXd
GTSAM_EXPORT Errors operator-(const Errors &a, const Errors &b)
Subtraction.
GTSAM_EXPORT void axpy(double alpha, const Errors &x, Errors &y)
BLAS level 2 style AXPY, y := alpha*x + y
GTSAM_EXPORT Errors operator+(const Errors &a, const Errors &b)
Addition.