MovableScalar.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2020 Sebastien Boisvert <seb@boisvert.info>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_MISC_MOVABLE_SCALAR_H
11 #define EIGEN_MISC_MOVABLE_SCALAR_H
12 
13 #include <vector>
14 
15 namespace Eigen
16 {
17 template <typename Scalar, typename Base = std::vector<Scalar>>
18 struct MovableScalar : public Base
19 {
20  MovableScalar() = default;
21  ~MovableScalar() = default;
22  MovableScalar(const MovableScalar&) = default;
23  MovableScalar(MovableScalar&& other) = default;
24  MovableScalar& operator=(const MovableScalar&) = default;
27 
28  operator Scalar() const { return this->size() > 0 ? this->back() : Scalar(); }
29 };
30 
31 template<> struct NumTraits<MovableScalar<float>> : GenericNumTraits<float> {};
32 }
33 
34 #endif
35 
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::MovableScalar::MovableScalar
MovableScalar(Scalar scalar)
Definition: MovableScalar.h:26
size
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Eigen::GenericNumTraits
Definition: NumTraits.h:152
scalar
mxArray * scalar(mxClassID classid)
Definition: matlab.h:82
Eigen::MovableScalar::operator=
MovableScalar & operator=(const MovableScalar &)=default
Eigen::MovableScalar
Definition: MovableScalar.h:18
gtsam.examples.DogLegOptimizerExample.float
float
Definition: DogLegOptimizerExample.py:113
Base
Definition: test_virtual_functions.cpp:156
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
Eigen::MovableScalar::MovableScalar
MovableScalar()=default
Eigen::MovableScalar::~MovableScalar
~MovableScalar()=default
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:49