Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef EIGEN_VECTORBLOCK_H
00012 #define EIGEN_VECTORBLOCK_H
00013
00014 namespace Eigen {
00015
00047 namespace internal {
00048 template<typename VectorType, int Size>
00049 struct traits<VectorBlock<VectorType, Size> >
00050 : public traits<Block<VectorType,
00051 traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
00052 traits<VectorType>::Flags & RowMajorBit ? Size : 1> >
00053 {
00054 };
00055 }
00056
00057 template<typename VectorType, int Size> class VectorBlock
00058 : public Block<VectorType,
00059 internal::traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
00060 internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1>
00061 {
00062 typedef Block<VectorType,
00063 internal::traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
00064 internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1> Base;
00065 enum {
00066 IsColVector = !(internal::traits<VectorType>::Flags & RowMajorBit)
00067 };
00068 public:
00069 EIGEN_DENSE_PUBLIC_INTERFACE(VectorBlock)
00070
00071 using Base::operator=;
00072
00075 inline VectorBlock(VectorType& vector, Index start, Index size)
00076 : Base(vector,
00077 IsColVector ? start : 0, IsColVector ? 0 : start,
00078 IsColVector ? size : 1, IsColVector ? 1 : size)
00079 {
00080 EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock);
00081 }
00082
00085 inline VectorBlock(VectorType& vector, Index start)
00086 : Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start)
00087 {
00088 EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock);
00089 }
00090 };
00091
00092
00093 }
00094
00095 #endif // EIGEN_VECTORBLOCK_H