1 | // Copyright (C) 2014 Conrad Sanderson |
---|
2 | // Copyright (C) 2014 NICTA (www.nicta.com.au) |
---|
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 fn_normalise |
---|
10 | //! @{ |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | template<typename T1> |
---|
15 | inline |
---|
16 | typename |
---|
17 | enable_if2 |
---|
18 | < |
---|
19 | (is_arma_type<T1>::value && resolves_to_colvector<T1>::value), |
---|
20 | const Op<T1, op_normalise_colvec> |
---|
21 | >::result |
---|
22 | normalise |
---|
23 | ( |
---|
24 | const T1& X, |
---|
25 | const uword p = uword(2), |
---|
26 | const arma_empty_class junk1 = arma_empty_class(), |
---|
27 | const typename arma_real_or_cx_only<typename T1::elem_type>::result* junk2 = 0 |
---|
28 | ) |
---|
29 | { |
---|
30 | arma_extra_debug_sigprint(); |
---|
31 | arma_ignore(junk1); |
---|
32 | arma_ignore(junk2); |
---|
33 | |
---|
34 | return Op<T1, op_normalise_colvec>(X, p, 0); |
---|
35 | } |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | template<typename T1> |
---|
40 | inline |
---|
41 | typename |
---|
42 | enable_if2 |
---|
43 | < |
---|
44 | (is_arma_type<T1>::value && resolves_to_rowvector<T1>::value), |
---|
45 | const Op<T1, op_normalise_rowvec> |
---|
46 | >::result |
---|
47 | normalise |
---|
48 | ( |
---|
49 | const T1& X, |
---|
50 | const uword p = uword(2), |
---|
51 | const arma_empty_class junk1 = arma_empty_class(), |
---|
52 | const typename arma_real_or_cx_only<typename T1::elem_type>::result* junk2 = 0 |
---|
53 | ) |
---|
54 | { |
---|
55 | arma_extra_debug_sigprint(); |
---|
56 | arma_ignore(junk1); |
---|
57 | arma_ignore(junk2); |
---|
58 | |
---|
59 | return Op<T1, op_normalise_rowvec>(X, p, 0); |
---|
60 | } |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | template<typename T1> |
---|
65 | inline |
---|
66 | typename |
---|
67 | enable_if2 |
---|
68 | < |
---|
69 | (is_arma_type<T1>::value && (resolves_to_vector<T1>::value == false)), |
---|
70 | const Op<T1, op_normalise_mat> |
---|
71 | >::result |
---|
72 | normalise |
---|
73 | ( |
---|
74 | const T1& X, |
---|
75 | const uword p = uword(2), |
---|
76 | const uword dim = 0, |
---|
77 | const typename arma_real_or_cx_only<typename T1::elem_type>::result* junk = 0 |
---|
78 | ) |
---|
79 | { |
---|
80 | arma_extra_debug_sigprint(); |
---|
81 | arma_ignore(junk); |
---|
82 | |
---|
83 | return Op<T1, op_normalise_mat>(X, p, dim); |
---|
84 | } |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | //! @} |
---|