source: mmcs/armadillo_bits/fn_normalise.hpp @ 8daa049

matrices
Last change on this file since 8daa049 was 9dd61b1, checked in by rboet <rboet@…>, 9 years ago

Avance del proyecto 60%

  • Property mode set to 100644
File size: 1.7 KB
Line 
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
14template<typename T1>
15inline
16typename
17enable_if2
18  <
19  (is_arma_type<T1>::value && resolves_to_colvector<T1>::value),
20  const Op<T1, op_normalise_colvec>
21  >::result
22normalise
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
39template<typename T1>
40inline
41typename
42enable_if2
43  <
44  (is_arma_type<T1>::value && resolves_to_rowvector<T1>::value),
45  const Op<T1, op_normalise_rowvec>
46  >::result
47normalise
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
64template<typename T1>
65inline
66typename
67enable_if2
68  <
69  (is_arma_type<T1>::value && (resolves_to_vector<T1>::value == false)),
70  const Op<T1, op_normalise_mat>
71  >::result
72normalise
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//! @}
Note: See TracBrowser for help on using the repository browser.