Mercurial > hg > segmenter-vamp-plugin
comparison armadillo-2.4.4/include/armadillo_bits/injector_bones.hpp @ 0:8b6102e2a9b0
Armadillo Library
author | maxzanoni76 <max.zanoni@eecs.qmul.ac.uk> |
---|---|
date | Wed, 11 Apr 2012 09:27:06 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:8b6102e2a9b0 |
---|---|
1 // Copyright (C) 2010 NICTA (www.nicta.com.au) | |
2 // Copyright (C) 2010 Conrad Sanderson | |
3 // | |
4 // This file is part of the Armadillo C++ library. | |
5 // It is provided without any warranty of fitness | |
6 // for any purpose. You can redistribute this file | |
7 // and/or modify it under the terms of the GNU | |
8 // Lesser General Public License (LGPL) as published | |
9 // by the Free Software Foundation, either version 3 | |
10 // of the License or (at your option) any later version. | |
11 // (see http://www.opensource.org/licenses for more info) | |
12 | |
13 | |
14 //! \addtogroup injector | |
15 //! @{ | |
16 | |
17 | |
18 | |
19 template<typename eT> | |
20 class mat_injector_row | |
21 { | |
22 public: | |
23 | |
24 inline mat_injector_row(); | |
25 | |
26 inline void insert(const eT val) const; | |
27 | |
28 mutable uword n_cols; | |
29 mutable podarray<eT> A; | |
30 mutable podarray<eT> B; | |
31 }; | |
32 | |
33 | |
34 | |
35 template<typename T1> | |
36 class mat_injector | |
37 { | |
38 public: | |
39 | |
40 typedef typename T1::elem_type elem_type; | |
41 | |
42 inline void insert(const elem_type val) const; | |
43 inline void end_of_row() const; | |
44 inline ~mat_injector(); | |
45 | |
46 | |
47 private: | |
48 | |
49 inline mat_injector(T1& in_X, const elem_type val); | |
50 inline mat_injector(T1& in_X, const injector_end_of_row& x); | |
51 | |
52 T1& X; | |
53 mutable uword n_rows; | |
54 | |
55 mutable podarray< mat_injector_row<elem_type>* >* AA; | |
56 mutable podarray< mat_injector_row<elem_type>* >* BB; | |
57 | |
58 friend class Mat<elem_type>; | |
59 friend class Row<elem_type>; | |
60 friend class Col<elem_type>; | |
61 }; | |
62 | |
63 | |
64 | |
65 // | |
66 | |
67 | |
68 | |
69 template<typename oT> | |
70 class field_injector_row | |
71 { | |
72 public: | |
73 | |
74 inline field_injector_row(); | |
75 inline ~field_injector_row(); | |
76 | |
77 inline void insert(const oT& val) const; | |
78 | |
79 mutable uword n_cols; | |
80 mutable field<oT>* AA; | |
81 mutable field<oT>* BB; | |
82 }; | |
83 | |
84 | |
85 | |
86 template<typename T1> | |
87 class field_injector | |
88 { | |
89 public: | |
90 | |
91 typedef typename T1::object_type object_type; | |
92 | |
93 inline void insert(const object_type& val) const; | |
94 inline void end_of_row() const; | |
95 inline ~field_injector(); | |
96 | |
97 | |
98 private: | |
99 | |
100 inline field_injector(T1& in_X, const object_type& val); | |
101 inline field_injector(T1& in_X, const injector_end_of_row& x); | |
102 | |
103 T1& X; | |
104 mutable uword n_rows; | |
105 | |
106 mutable podarray< field_injector_row<object_type>* >* AA; | |
107 mutable podarray< field_injector_row<object_type>* >* BB; | |
108 | |
109 friend class field<object_type>; | |
110 }; | |
111 | |
112 | |
113 | |
114 //! @} |