Path Tracer
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 <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:
68  EIGEN_DENSE_PUBLIC_INTERFACE(VectorBlock)
69 
70  using Base::operator=;
71 
74  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
75  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  {
80  EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock);
81  }
82 
85  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
86  VectorBlock(VectorType& vector, Index start)
87  : Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start)
88  {
89  EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock);
90  }
91 };
92 
93 
94 } // end namespace Eigen
95 
96 #endif // EIGEN_VECTORBLOCK_H
Eigen
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
Eigen::Block
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:105
Eigen::RowMajorBit
const unsigned int RowMajorBit
Definition: Constants.h:65
Eigen::VectorBlock::VectorBlock
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE VectorBlock(VectorType &vector, Index start, Index size)
Definition: VectorBlock.h:75
Eigen::VectorBlock::VectorBlock
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE VectorBlock(VectorType &vector, Index start)
Definition: VectorBlock.h:86
vector3.h
3D vector structure, including operators when compiling in C++
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::VectorBlock
Expression of a fixed-size or dynamic-size sub-vector.
Definition: VectorBlock.h:60
Eigen::UniformScaling::operator*
operator*(const MatrixBase< Derived > &matrix, const UniformScaling< Scalar > &s)
Definition: Scaling.h:135
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:42