VectorBlock.h
Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
00005 // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
00006 //
00007 // This Source Code Form is subject to the terms of the Mozilla
00008 // Public License v. 2.0. If a copy of the MPL was not distributed
00009 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
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 } // end namespace Eigen
00094 
00095 #endif // EIGEN_VECTORBLOCK_H


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:17