Mercurial > hg > segmenter-vamp-plugin
comparison armadillo-3.900.4/include/armadillo_bits/fn_eye.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 fn_eye | |
10 //! @{ | |
11 | |
12 | |
13 | |
14 arma_inline | |
15 const Gen<mat, gen_ones_diag> | |
16 eye(const uword n_rows, const uword n_cols) | |
17 { | |
18 arma_extra_debug_sigprint(); | |
19 | |
20 return Gen<mat, gen_ones_diag>(n_rows, n_cols); | |
21 } | |
22 | |
23 | |
24 | |
25 template<typename obj_type> | |
26 arma_inline | |
27 const Gen<obj_type, gen_ones_diag> | |
28 eye(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = 0) | |
29 { | |
30 arma_extra_debug_sigprint(); | |
31 arma_ignore(junk); | |
32 | |
33 if(is_Col<obj_type>::value == true) | |
34 { | |
35 arma_debug_check( (n_cols != 1), "eye(): incompatible size" ); | |
36 } | |
37 else | |
38 if(is_Row<obj_type>::value == true) | |
39 { | |
40 arma_debug_check( (n_rows != 1), "eye(): incompatible size" ); | |
41 } | |
42 | |
43 return Gen<obj_type, gen_ones_diag>(n_rows, n_cols); | |
44 } | |
45 | |
46 | |
47 | |
48 //! @} |