1 // SPDX-License-Identifier: Apache-2.0
2 //
3 // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
4 // Copyright 2008-2016 National ICT Australia (NICTA)
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 // ------------------------------------------------------------------------
17 
18 
19 //! \addtogroup fn_symmat
20 //! @{
21 
22 
23 template<typename T1>
24 arma_warn_unused
25 arma_inline
26 typename enable_if2< is_cx<typename T1::elem_type>::no, const Op<T1, op_symmatu> >::result
symmatu(const Base<typename T1::elem_type,T1> & X,const bool do_conj=false)27 symmatu(const Base<typename T1::elem_type,T1>& X, const bool do_conj = false)
28   {
29   arma_extra_debug_sigprint();
30   arma_ignore(do_conj);
31 
32   return Op<T1, op_symmatu>(X.get_ref());
33   }
34 
35 
36 
37 template<typename T1>
38 arma_warn_unused
39 arma_inline
40 typename enable_if2< is_cx<typename T1::elem_type>::no, const Op<T1, op_symmatl> >::result
symmatl(const Base<typename T1::elem_type,T1> & X,const bool do_conj=false)41 symmatl(const Base<typename T1::elem_type,T1>& X, const bool do_conj = false)
42   {
43   arma_extra_debug_sigprint();
44   arma_ignore(do_conj);
45 
46   return Op<T1, op_symmatl>(X.get_ref());
47   }
48 
49 
50 
51 template<typename T1>
52 arma_warn_unused
53 arma_inline
54 typename enable_if2< is_cx<typename T1::elem_type>::yes, const Op<T1, op_symmatu_cx> >::result
symmatu(const Base<typename T1::elem_type,T1> & X,const bool do_conj=true)55 symmatu(const Base<typename T1::elem_type,T1>& X, const bool do_conj = true)
56   {
57   arma_extra_debug_sigprint();
58 
59   return Op<T1, op_symmatu_cx>(X.get_ref(), 0, (do_conj ? 1 : 0));
60   }
61 
62 
63 
64 template<typename T1>
65 arma_warn_unused
66 arma_inline
67 typename enable_if2< is_cx<typename T1::elem_type>::yes, const Op<T1, op_symmatl_cx> >::result
symmatl(const Base<typename T1::elem_type,T1> & X,const bool do_conj=true)68 symmatl(const Base<typename T1::elem_type,T1>& X, const bool do_conj = true)
69   {
70   arma_extra_debug_sigprint();
71 
72   return Op<T1, op_symmatl_cx>(X.get_ref(), 0, (do_conj ? 1 : 0));
73   }
74 
75 
76 
77 //
78 
79 
80 
81 template<typename T1>
82 arma_warn_unused
83 arma_inline
84 typename enable_if2< is_cx<typename T1::elem_type>::no, const SpOp<T1, spop_symmat> >::result
symmatu(const SpBase<typename T1::elem_type,T1> & X,const bool do_conj=false)85 symmatu(const SpBase<typename T1::elem_type,T1>& X, const bool do_conj = false)
86   {
87   arma_extra_debug_sigprint();
88   arma_ignore(do_conj);
89 
90   return SpOp<T1, spop_symmat>(X.get_ref(), 0, 0);
91   }
92 
93 
94 
95 template<typename T1>
96 arma_warn_unused
97 arma_inline
98 typename enable_if2< is_cx<typename T1::elem_type>::no, const SpOp<T1, spop_symmat> >::result
symmatl(const SpBase<typename T1::elem_type,T1> & X,const bool do_conj=false)99 symmatl(const SpBase<typename T1::elem_type,T1>& X, const bool do_conj = false)
100   {
101   arma_extra_debug_sigprint();
102   arma_ignore(do_conj);
103 
104   return SpOp<T1, spop_symmat>(X.get_ref(), 1, 0);
105   }
106 
107 
108 
109 template<typename T1>
110 arma_warn_unused
111 arma_inline
112 typename enable_if2< is_cx<typename T1::elem_type>::yes, const SpOp<T1, spop_symmat_cx> >::result
symmatu(const SpBase<typename T1::elem_type,T1> & X,const bool do_conj=true)113 symmatu(const SpBase<typename T1::elem_type,T1>& X, const bool do_conj = true)
114   {
115   arma_extra_debug_sigprint();
116 
117   return SpOp<T1, spop_symmat_cx>(X.get_ref(), 0, (do_conj ? 1 : 0));
118   }
119 
120 
121 
122 template<typename T1>
123 arma_warn_unused
124 arma_inline
125 typename enable_if2< is_cx<typename T1::elem_type>::yes, const SpOp<T1, spop_symmat_cx> >::result
symmatl(const SpBase<typename T1::elem_type,T1> & X,const bool do_conj=true)126 symmatl(const SpBase<typename T1::elem_type,T1>& X, const bool do_conj = true)
127   {
128   arma_extra_debug_sigprint();
129 
130   return SpOp<T1, spop_symmat_cx>(X.get_ref(), 1, (do_conj ? 1 : 0));
131   }
132 
133 
134 
135 //! @}
136