comparison armadillo-2.4.4/include/armadillo_bits/fn_dot.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) 2008-2010 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-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 fn_dot
15 //! @{
16
17
18 template<typename T1, typename T2>
19 arma_inline
20 arma_warn_unused
21 typename T1::elem_type
22 dot
23 (
24 const Base<typename T1::elem_type,T1>& A,
25 const Base<typename T1::elem_type,T2>& B
26 )
27 {
28 arma_extra_debug_sigprint();
29
30 return op_dot::apply(A,B);
31 }
32
33
34
35 template<typename T1, typename T2>
36 arma_inline
37 arma_warn_unused
38 typename T1::elem_type
39 norm_dot
40 (
41 const Base<typename T1::elem_type,T1>& A,
42 const Base<typename T1::elem_type,T2>& B,
43 const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
44 )
45 {
46 arma_extra_debug_sigprint();
47
48 return op_norm_dot::apply(A,B);
49 }
50
51
52
53 //
54 // cdot
55
56
57
58 template<typename T1, typename T2>
59 arma_inline
60 arma_warn_unused
61 typename T1::elem_type
62 cdot
63 (
64 const Base<typename T1::elem_type,T1>& A,
65 const Base<typename T1::elem_type,T2>& B,
66 const typename arma_cx_only<typename T1::elem_type>::result* junk = 0
67 )
68 {
69 arma_extra_debug_sigprint();
70 arma_ignore(junk);
71
72 return op_cdot::apply(A,B);
73 }
74
75
76
77 template<typename T1, typename T2>
78 arma_inline
79 arma_warn_unused
80 typename T1::elem_type
81 cdot
82 (
83 const Base<typename T1::elem_type,T1>& A,
84 const Base<typename T1::elem_type,T2>& B,
85 const typename arma_not_cx<typename T1::elem_type>::result* junk = 0
86 )
87 {
88 arma_extra_debug_sigprint();
89 arma_ignore(junk);
90
91 return op_dot::apply(A,B);
92 }
93
94
95
96
97 // convert dot(htrans(x), y) to cdot(x,y)
98
99 template<typename T1, typename T2>
100 arma_inline
101 arma_warn_unused
102 typename T1::elem_type
103 dot
104 (
105 const Op<T1, op_htrans>& A,
106 const Base<typename T1::elem_type,T2>& B,
107 const typename arma_cx_only<typename T1::elem_type>::result* junk = 0
108 )
109 {
110 arma_extra_debug_sigprint();
111 arma_ignore(junk);
112
113 return cdot(A.m, B);
114 }
115
116
117
118 //! @}