Eigen  3.4.90 (git rev 5a9f66fb35d03a4da9ef8976e67a61b30aa16dcf)
 
Loading...
Searching...
No Matches
VectorBlock.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2008-2010 Gael Guennebaud <[email protected]>
5// Copyright (C) 2006-2008 Benoit Jacob <[email protected]>
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// IWYU pragma: private
15#include "./InternalHeaderCheck.h"
16
17namespace Eigen {
18
19namespace internal {
20template <typename VectorType, int Size>
21struct traits<VectorBlock<VectorType, Size> >
22 : public traits<Block<VectorType, traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
23 traits<VectorType>::Flags & RowMajorBit ? Size : 1> > {};
24} // namespace internal
25
56template <typename VectorType, int Size>
57class VectorBlock : public Block<VectorType, internal::traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
58 internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1> {
60 internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1>
61 Base;
62 enum { IsColVector = !(internal::traits<VectorType>::Flags & RowMajorBit) };
63
64 public:
65 EIGEN_DENSE_PUBLIC_INTERFACE(VectorBlock)
66 EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock)
67 EIGEN_INHERIT_ASSIGNMENT_OPERATORS(VectorBlock)
68
69
71 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE VectorBlock(VectorType& vector, Index start, Index size)
72 : Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start, IsColVector ? size : 1, IsColVector ? 1 : size) {
73 }
74
77 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE VectorBlock(VectorType& vector, Index start)
78 : Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start) {}
79};
80
81} // end namespace Eigen
82
83#endif // EIGEN_VECTORBLOCK_H
Expression of a fixed-size or dynamic-size block.
Definition Block.h:110
Expression of a fixed-size or dynamic-size sub-vector.
Definition VectorBlock.h:58
VectorBlock(VectorType &vector, Index start)
Definition VectorBlock.h:77
const unsigned int RowMajorBit
Definition Constants.h:70
Namespace containing all symbols from the Eigen library.
Definition Core:137
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:83