Chris@49: // Copyright (C) 2011-2012 NICTA (www.nicta.com.au) Chris@49: // Copyright (C) 2011-2012 Conrad Sanderson Chris@49: // Chris@49: // This Source Code Form is subject to the terms of the Mozilla Public Chris@49: // License, v. 2.0. If a copy of the MPL was not distributed with this Chris@49: // file, You can obtain one at http://mozilla.org/MPL/2.0/. Chris@49: Chris@49: Chris@49: //! \addtogroup op_symmat Chris@49: //! @{ Chris@49: Chris@49: Chris@49: Chris@49: template Chris@49: inline Chris@49: void Chris@49: op_symmat::apply Chris@49: ( Chris@49: Mat& out, Chris@49: const Op& in, Chris@49: const typename arma_not_cx::result* junk Chris@49: ) Chris@49: { Chris@49: arma_extra_debug_sigprint(); Chris@49: arma_ignore(junk); Chris@49: Chris@49: typedef typename T1::elem_type eT; Chris@49: Chris@49: const unwrap tmp(in.m); Chris@49: const Mat& A = tmp.M; Chris@49: Chris@49: arma_debug_check( (A.is_square() == false), "symmatu()/symmatl(): given matrix must be square" ); Chris@49: Chris@49: const uword N = A.n_rows; Chris@49: const bool upper = (in.aux_uword_a == 0); Chris@49: Chris@49: if(&out != &A) Chris@49: { Chris@49: out.copy_size(A); Chris@49: Chris@49: if(upper) Chris@49: { Chris@49: // upper triangular: copy the diagonal and the elements above the diagonal Chris@49: Chris@49: for(uword i=0; i Chris@49: inline Chris@49: void Chris@49: op_symmat::apply Chris@49: ( Chris@49: Mat& out, Chris@49: const Op& in, Chris@49: const typename arma_cx_only::result* junk Chris@49: ) Chris@49: { Chris@49: arma_extra_debug_sigprint(); Chris@49: arma_ignore(junk); Chris@49: Chris@49: typedef typename T1::elem_type eT; Chris@49: Chris@49: const unwrap tmp(in.m); Chris@49: const Mat& A = tmp.M; Chris@49: Chris@49: arma_debug_check( (A.is_square() == false), "symmatu()/symmatl(): given matrix must be square" ); Chris@49: Chris@49: const uword N = A.n_rows; Chris@49: const bool upper = (in.aux_uword_a == 0); Chris@49: Chris@49: if(&out != &A) Chris@49: { Chris@49: out.copy_size(A); Chris@49: Chris@49: if(upper) Chris@49: { Chris@49: // upper triangular: copy the diagonal and the elements above the diagonal Chris@49: Chris@49: for(uword i=0; i