op_zeros_meat.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2009 NICTA
00002 // 
00003 // Authors:
00004 // - Conrad Sanderson (conradsand at ieee dot org)
00005 // 
00006 // This file is part of the Armadillo C++ library.
00007 // It is provided without any warranty of fitness
00008 // for any purpose. You can redistribute this file
00009 // and/or modify it under the terms of the GNU
00010 // Lesser General Public License (LGPL) as published
00011 // by the Free Software Foundation, either version 3
00012 // of the License or (at your option) any later version.
00013 // (see http://www.opensource.org/licenses for more info)
00014 
00015 
00016 //! \addtogroup op_zeros
00017 //! @{
00018 
00019 
00020 template<typename eT>
00021 inline
00022 void
00023 op_zeros::apply(Mat<eT>& out, const Op<Mat<eT>,op_zeros>& in)
00024   {
00025   arma_extra_debug_sigprint();
00026   
00027   const u32 n_rows = in.aux_u32_a;
00028   const u32 n_cols = (in.aux_u32_b > 0) ? in.aux_u32_b : 1;
00029   
00030   out.zeros(n_rows, n_cols);
00031   }
00032 
00033 
00034 
00035 template<typename eT>
00036 inline
00037 void
00038 op_zeros::apply(Mat<eT>& out, const Op<Col<eT>,op_zeros>& in)
00039   {
00040   arma_extra_debug_sigprint();
00041   
00042   out.zeros(in.aux_u32_a, 1);
00043   }
00044 
00045 
00046 
00047 template<typename eT>
00048 inline
00049 void
00050 op_zeros::apply(Mat<eT>& out, const Op<Row<eT>,op_zeros>& in)
00051   {
00052   arma_extra_debug_sigprint();
00053   
00054   out.zeros(1, in.aux_u32_a);
00055   }
00056 
00057 
00058 
00059 template<typename eT>
00060 inline
00061 void
00062 op_zeros::apply(Col<eT>& out, const Op<Col<eT>,op_zeros>& in)
00063   {
00064   arma_extra_debug_sigprint();
00065   
00066   out.zeros(in.aux_u32_a);
00067   }
00068 
00069 
00070 
00071 template<typename eT>
00072 inline
00073 void
00074 op_zeros::apply(Row<eT>& out, const Op<Row<eT>,op_zeros>& in)
00075   {
00076   arma_extra_debug_sigprint();
00077   
00078   out.zeros(in.aux_u32_a);
00079   }
00080 
00081 
00082 
00083 
00084 //! @}