fn_zeros.hpp
Go to the documentation of this file.
00001 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
00002 // Copyright (C) 2008-2011 Conrad Sanderson
00003 // 
00004 // This file is part of the Armadillo C++ library.
00005 // It is provided without any warranty of fitness
00006 // for any purpose. You can redistribute this file
00007 // and/or modify it under the terms of the GNU
00008 // Lesser General Public License (LGPL) as published
00009 // by the Free Software Foundation, either version 3
00010 // of the License or (at your option) any later version.
00011 // (see http://www.opensource.org/licenses for more info)
00012 
00013 
00016 
00017 
00019 arma_inline
00020 const Gen<vec::elem_type, gen_zeros>
00021 zeros(const uword n_elem)
00022   {
00023   arma_extra_debug_sigprint();
00024   
00025   return Gen<vec::elem_type, gen_zeros>(n_elem, 1);
00026   }
00027 
00028 
00029 
00030 template<typename vec_type>
00031 arma_inline
00032 const Gen<typename vec_type::elem_type, gen_zeros>
00033 zeros(const uword n_elem, const arma_empty_class junk1 = arma_empty_class(), const typename arma_Mat_Col_Row_only<vec_type>::result* junk2 = 0)
00034   {
00035   arma_extra_debug_sigprint();
00036   arma_ignore(junk1);
00037   arma_ignore(junk2);
00038   
00039   if(is_Row<vec_type>::value == true)
00040     {
00041     return Gen<typename vec_type::elem_type, gen_zeros>(1, n_elem);
00042     }
00043   else
00044     {
00045     return Gen<typename vec_type::elem_type, gen_zeros>(n_elem, 1);
00046     }
00047   }
00048 
00049 
00050 
00052 arma_inline
00053 const Gen<mat::elem_type, gen_zeros>
00054 zeros(const uword n_rows, const uword n_cols)
00055   {
00056   arma_extra_debug_sigprint();
00057   
00058   return Gen<mat::elem_type, gen_zeros>(n_rows, n_cols);
00059   }
00060 
00061 
00062 
00063 template<typename mat_type>
00064 arma_inline
00065 const Gen<typename mat_type::elem_type, gen_zeros>
00066 zeros(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only<mat_type>::result* junk = 0)
00067   {
00068   arma_extra_debug_sigprint();
00069   arma_ignore(junk);
00070   
00071   return Gen<typename mat_type::elem_type, gen_zeros>(n_rows, n_cols);
00072   }
00073 
00074 
00075 
00076 arma_inline
00077 const GenCube<cube::elem_type, gen_zeros>
00078 zeros(const uword n_rows, const uword n_cols, const uword n_slices)
00079   {
00080   arma_extra_debug_sigprint();
00081   
00082   return GenCube<cube::elem_type, gen_zeros>(n_rows, n_cols, n_slices);
00083   }
00084 
00085 
00086 
00087 template<typename cube_type>
00088 arma_inline
00089 const GenCube<typename cube_type::elem_type, gen_zeros>
00090 zeros(const uword n_rows, const uword n_cols, const uword n_slices, const typename arma_Cube_only<cube_type>::result* junk = 0)
00091   {
00092   arma_extra_debug_sigprint();
00093   arma_ignore(junk);
00094   
00095   return GenCube<typename cube_type::elem_type, gen_zeros>(n_rows, n_cols, n_slices);
00096   }
00097 
00098 
00099 


armadillo_matrix
Author(s): Conrad Sanderson - NICTA (www.nicta.com.au), (Wrapper by Sjoerd van den Dries)
autogenerated on Tue Jan 7 2014 11:42:04