~ubuntu-branches/ubuntu/utopic/r-cran-rcpparmadillo/utopic

« back to all changes in this revision

Viewing changes to inst/include/armadillo_bits/Gen_meat.hpp

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2014-07-03 08:50:31 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20140703085031-b9w69d883j36gx8q
Tags: 0.4.320.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (C) 2011-2013 Conrad Sanderson
2
 
// Copyright (C) 2011-2013 NICTA (www.nicta.com.au)
 
1
// Copyright (C) 2011-2014 Conrad Sanderson
 
2
// Copyright (C) 2011-2014 NICTA (www.nicta.com.au)
3
3
// 
4
4
// This Source Code Form is subject to the terms of the Mozilla Public
5
5
// License, v. 2.0. If a copy of the MPL was not distributed with this
306
306
 
307
307
 
308
308
 
 
309
template<typename T1, typename gen_type>
 
310
inline
 
311
void
 
312
Gen<T1, gen_type>::apply(subview<typename T1::elem_type>& out) const
 
313
  {
 
314
  arma_extra_debug_sigprint();
 
315
  
 
316
  // NOTE: we're assuming that the submatrix has the same dimensions as the Gen object
 
317
  // this is checked by subview::operator=()
 
318
  
 
319
       if(is_same_type<gen_type, gen_ones_diag>::yes) { out.eye();   }
 
320
  else if(is_same_type<gen_type, gen_ones_full>::yes) { out.ones();  }
 
321
  else if(is_same_type<gen_type, gen_zeros    >::yes) { out.zeros(); }
 
322
  else if(is_same_type<gen_type, gen_randu    >::yes) { out.randu(); }
 
323
  else if(is_same_type<gen_type, gen_randn    >::yes) { out.randn(); }
 
324
  }
 
325
 
 
326
 
 
327
 
309
328
//! @}
310
329