1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008-2009 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 EIGEN2_VECTORBLOCK_H
12 #define EIGEN2_VECTORBLOCK_H
13
14 namespace Eigen {
15
16 /** \deprecated use DenseMase::head(Index) */
17 template<typename Derived>
18 inline VectorBlock<Derived>
start(Index size)19 MatrixBase<Derived>::start(Index size)
20 {
21 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
22 return VectorBlock<Derived>(derived(), 0, size);
23 }
24
25 /** \deprecated use DenseMase::head(Index) */
26 template<typename Derived>
27 inline const VectorBlock<const Derived>
start(Index size)28 MatrixBase<Derived>::start(Index size) const
29 {
30 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
31 return VectorBlock<const Derived>(derived(), 0, size);
32 }
33
34 /** \deprecated use DenseMase::tail(Index) */
35 template<typename Derived>
36 inline VectorBlock<Derived>
end(Index size)37 MatrixBase<Derived>::end(Index size)
38 {
39 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
40 return VectorBlock<Derived>(derived(), this->size() - size, size);
41 }
42
43 /** \deprecated use DenseMase::tail(Index) */
44 template<typename Derived>
45 inline const VectorBlock<const Derived>
end(Index size)46 MatrixBase<Derived>::end(Index size) const
47 {
48 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
49 return VectorBlock<const Derived>(derived(), this->size() - size, size);
50 }
51
52 /** \deprecated use DenseMase::head() */
53 template<typename Derived>
54 template<int Size>
55 inline VectorBlock<Derived,Size>
start()56 MatrixBase<Derived>::start()
57 {
58 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
59 return VectorBlock<Derived,Size>(derived(), 0);
60 }
61
62 /** \deprecated use DenseMase::head() */
63 template<typename Derived>
64 template<int Size>
65 inline const VectorBlock<const Derived,Size>
start()66 MatrixBase<Derived>::start() const
67 {
68 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
69 return VectorBlock<const Derived,Size>(derived(), 0);
70 }
71
72 /** \deprecated use DenseMase::tail() */
73 template<typename Derived>
74 template<int Size>
75 inline VectorBlock<Derived,Size>
end()76 MatrixBase<Derived>::end()
77 {
78 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
79 return VectorBlock<Derived, Size>(derived(), size() - Size);
80 }
81
82 /** \deprecated use DenseMase::tail() */
83 template<typename Derived>
84 template<int Size>
85 inline const VectorBlock<const Derived,Size>
end()86 MatrixBase<Derived>::end() const
87 {
88 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
89 return VectorBlock<const Derived, Size>(derived(), size() - Size);
90 }
91
92 } // end namespace Eigen
93
94 #endif // EIGEN2_VECTORBLOCK_H
95