max@0: // Copyright (C) 2010-2011 NICTA (www.nicta.com.au) max@0: // Copyright (C) 2010-2011 Conrad Sanderson max@0: // Copyright (C) 2011 Alcatel Lucent max@0: // Copyright (C) 2011 Gerhard Schreiber max@0: // max@0: // This file is part of the Armadillo C++ library. max@0: // It is provided without any warranty of fitness max@0: // for any purpose. You can redistribute this file max@0: // and/or modify it under the terms of the GNU max@0: // Lesser General Public License (LGPL) as published max@0: // by the Free Software Foundation, either version 3 max@0: // of the License or (at your option) any later version. max@0: // (see http://www.opensource.org/licenses for more info) max@0: max@0: max@0: max@0: //! \addtogroup glue_toeplitz max@0: //! @{ max@0: max@0: max@0: max@0: template max@0: inline max@0: void max@0: glue_toeplitz::apply(Mat& out, const Glue& in) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: typedef typename T1::elem_type eT; max@0: max@0: if( ((void*)(&in.A)) == ((void*)(&in.B)) ) max@0: { max@0: arma_extra_debug_print("glue_toeplitz::apply(): one argument version"); max@0: max@0: const unwrap_check tmp(in.A, out); max@0: const Mat& A = tmp.M; max@0: max@0: arma_debug_check( (A.is_vec() == false), "toeplitz(): input argument must be a vector" ); max@0: max@0: const uword N = A.n_elem; max@0: const eT* A_mem = A.memptr(); max@0: max@0: out.set_size(N,N); max@0: max@0: for(uword col=0; col tmp1(in.A, out); max@0: const unwrap_check tmp2(in.B, out); max@0: max@0: const Mat& A = tmp1.M; max@0: const Mat& B = tmp2.M; max@0: max@0: arma_debug_check( ( (A.is_vec() == false) || (B.is_vec() == false) ), "toeplitz(): input arguments must be vectors" ); max@0: max@0: const uword A_N = A.n_elem; max@0: const uword B_N = B.n_elem; max@0: max@0: const eT* A_mem = A.memptr(); max@0: const eT* B_mem = B.memptr(); max@0: max@0: out.set_size(A_N, B_N); max@0: max@0: if( out.is_empty() ) max@0: { max@0: return; max@0: } max@0: max@0: for(uword col=0; col max@0: inline max@0: void max@0: glue_toeplitz_circ::apply(Mat& out, const Glue& in) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: typedef typename T1::elem_type eT; max@0: max@0: if( ((void*)(&in.A)) == ((void*)(&in.B)) ) max@0: { max@0: arma_extra_debug_print("glue_toeplitz_circ::apply(): one argument version"); max@0: max@0: const unwrap_check tmp(in.A, out); max@0: const Mat& A = tmp.M; max@0: max@0: arma_debug_check( (A.is_vec() == false), "toeplitz(): input argument must be a vector" ); max@0: max@0: const uword N = A.n_elem; max@0: const eT* A_mem = A.memptr(); max@0: max@0: out.set_size(N,N); max@0: max@0: max@0: if(A.is_colvec()) max@0: { max@0: // A is interpreted as colvec max@0: max@0: for(uword col=0; col