VectorBlock.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) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_VECTORBLOCK_H
12 #define EIGEN_VECTORBLOCK_H
13 
14 namespace Eigen {
15 
16 namespace internal {
17 template<typename VectorType, int Size>
18 struct traits<VectorBlock<VectorType, Size> >
19  : public traits<Block<VectorType,
20  traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
21  traits<VectorType>::Flags & RowMajorBit ? Size : 1> >
22 {
23 };
24 }
25 
56 template<typename VectorType, int Size> class VectorBlock
57  : public Block<VectorType,
58  internal::traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
59  internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1>
60 {
61  typedef Block<VectorType,
64  enum {
66  };
67  public:
69 
70  using Base::operator=;
71 
74  EIGEN_DEVICE_FUNC
75  inline VectorBlock(VectorType& vector, Index start, Index size)
76  : Base(vector,
77  IsColVector ? start : 0, IsColVector ? 0 : start,
78  IsColVector ? size : 1, IsColVector ? 1 : size)
79  {
81  }
82 
85  EIGEN_DEVICE_FUNC
86  inline VectorBlock(VectorType& vector, Index start)
87  : Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start)
88  {
90  }
91 };
92 
93 
94 } // end namespace Eigen
95 
96 #endif // EIGEN_VECTORBLOCK_H
Block< VectorType, internal::traits< VectorType >::Flags &RowMajorBit?1:Size, internal::traits< VectorType >::Flags &RowMajorBit?Size:1 > Base
Definition: VectorBlock.h:63
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
EIGEN_DEVICE_FUNC VectorBlock(VectorType &vector, Index start)
Definition: VectorBlock.h:86
const unsigned int RowMajorBit
Definition: Constants.h:61
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Expression of a fixed-size or dynamic-size sub-vector.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:870
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition: StaticAssert.h:139


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:23