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;
26  MovableScalar(Scalar scalar) : Base(100, scalar) {}
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 
SCALAR Scalar
Definition: bench_gemm.cpp:46
~MovableScalar()=default
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Definition: NumTraits.h:232
MovableScalar & operator=(const MovableScalar &)=default
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
MovableScalar(Scalar scalar)
Definition: MovableScalar.h:26
mxArray * scalar(mxClassID classid)
Definition: matlab.h:82


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:56