comparison armadillo-3.900.4/include/armadillo_bits/Base_meat.hpp @ 49:1ec0e2823891

Switch to using subrepo copies of qm-dsp, nnls-chroma, vamp-plugin-sdk; update Armadillo version; assume build without external BLAS/LAPACK
author Chris Cannam
date Thu, 13 Jun 2013 10:25:24 +0100
parents
children
comparison
equal deleted inserted replaced
48:69251e11a913 49:1ec0e2823891
1 // Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2012 Conrad Sanderson
3 //
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
8
9 //! \addtogroup Base
10 //! @{
11
12
13
14 template<typename elem_type, typename derived>
15 arma_inline
16 const derived&
17 Base<elem_type,derived>::get_ref() const
18 {
19 return static_cast<const derived&>(*this);
20 }
21
22
23
24 template<typename elem_type, typename derived>
25 arma_inline
26 const Op<derived,op_htrans>
27 Base<elem_type,derived>::t() const
28 {
29 return Op<derived,op_htrans>( (*this).get_ref() );
30 }
31
32
33
34 template<typename elem_type, typename derived>
35 arma_inline
36 const Op<derived,op_htrans>
37 Base<elem_type,derived>::ht() const
38 {
39 return Op<derived,op_htrans>( (*this).get_ref() );
40 }
41
42
43
44 template<typename elem_type, typename derived>
45 arma_inline
46 const Op<derived,op_strans>
47 Base<elem_type,derived>::st() const
48 {
49 return Op<derived,op_strans>( (*this).get_ref() );
50 }
51
52
53
54
55 template<typename elem_type, typename derived>
56 inline
57 void
58 Base<elem_type,derived>::print(const std::string extra_text) const
59 {
60 const Proxy<derived> P( (*this).get_ref() );
61
62 const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q);
63
64 tmp.M.impl_print(extra_text);
65 }
66
67
68
69 template<typename elem_type, typename derived>
70 inline
71 void
72 Base<elem_type,derived>::print(std::ostream& user_stream, const std::string extra_text) const
73 {
74 const Proxy<derived> P( (*this).get_ref() );
75
76 const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q);
77
78 tmp.M.impl_print(user_stream, extra_text);
79 }
80
81
82
83 template<typename elem_type, typename derived>
84 inline
85 void
86 Base<elem_type,derived>::raw_print(const std::string extra_text) const
87 {
88 const Proxy<derived> P( (*this).get_ref() );
89
90 const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q);
91
92 tmp.M.impl_raw_print(extra_text);
93 }
94
95
96
97 template<typename elem_type, typename derived>
98 inline
99 void
100 Base<elem_type,derived>::raw_print(std::ostream& user_stream, const std::string extra_text) const
101 {
102 const Proxy<derived> P( (*this).get_ref() );
103
104 const quasi_unwrap< typename Proxy<derived>::stored_type > tmp(P.Q);
105
106 tmp.M.impl_raw_print(user_stream, extra_text);
107 }
108
109
110
111 //
112 // extra functions defined in Base_blas_elem_type
113
114 template<typename derived>
115 arma_inline
116 const Op<derived,op_inv>
117 Base_blas_elem_type<derived>::i(const bool slow) const
118 {
119 return Op<derived,op_inv>( static_cast<const derived&>(*this), ((slow == false) ? 0 : 1), 0 );
120 }
121
122
123
124 //
125 // extra functions defined in Base_eval_Mat
126
127 template<typename elem_type, typename derived>
128 arma_inline
129 const derived&
130 Base_eval_Mat<elem_type, derived>::eval() const
131 {
132 arma_extra_debug_sigprint();
133
134 return static_cast<const derived&>(*this);
135 }
136
137
138
139 //
140 // extra functions defined in Base_eval_expr
141
142 template<typename elem_type, typename derived>
143 arma_inline
144 Mat<elem_type>
145 Base_eval_expr<elem_type, derived>::eval() const
146 {
147 arma_extra_debug_sigprint();
148
149 return Mat<elem_type>( static_cast<const derived&>(*this) );
150 }
151
152
153
154 //! @}