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

« back to all changes in this revision

Viewing changes to inst/include/armadillo_bits/subview_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) 2008-2013 Conrad Sanderson
2
 
// Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
 
1
// Copyright (C) 2008-2014 Conrad Sanderson
 
2
// Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
3
3
// Copyright (C) 2011 James Sanders
4
4
// Copyright (C) 2013 Ryan Curtin
5
5
// 
1197
1197
 
1198
1198
 
1199
1199
 
 
1200
template<typename eT>
 
1201
template<typename T1, typename gen_type>
 
1202
inline
 
1203
typename enable_if2< is_same_type<typename T1::elem_type, eT>::value, void>::result
 
1204
subview<eT>::operator= (const Gen<T1,gen_type>& in)
 
1205
  {
 
1206
  arma_extra_debug_sigprint();
 
1207
  
 
1208
  arma_debug_assert_same_size(n_rows, n_cols, in.n_rows, in.n_cols, "copy into submatrix");
 
1209
  
 
1210
  in.apply(*this);
 
1211
  }
 
1212
 
 
1213
 
 
1214
 
1200
1215
//! transform each element in the subview using a functor
1201
1216
template<typename eT>
1202
1217
template<typename functor>
2672
2687
 
2673
2688
 
2674
2689
template<typename eT>
 
2690
template<typename T1, typename gen_type>
 
2691
inline
 
2692
typename enable_if2< is_same_type<typename T1::elem_type, eT>::value, void>::result
 
2693
subview_col<eT>::operator= (const Gen<T1,gen_type>& in)
 
2694
  {
 
2695
  arma_extra_debug_sigprint();
 
2696
  
 
2697
  arma_debug_assert_same_size(subview<eT>::n_rows, uword(1), in.n_rows, (in.is_col ? uword(1) : in.n_cols), "copy into submatrix");
 
2698
  
 
2699
  in.apply(*this);
 
2700
  }
 
2701
 
 
2702
 
 
2703
 
 
2704
template<typename eT>
2675
2705
arma_inline
2676
2706
const Op<subview_col<eT>,op_htrans>
2677
2707
subview_col<eT>::t() const
3004
3034
 
3005
3035
 
3006
3036
template<typename eT>
 
3037
template<typename T1, typename gen_type>
 
3038
inline
 
3039
typename enable_if2< is_same_type<typename T1::elem_type, eT>::value, void>::result
 
3040
subview_row<eT>::operator= (const Gen<T1,gen_type>& in)
 
3041
  {
 
3042
  arma_extra_debug_sigprint();
 
3043
  
 
3044
  arma_debug_assert_same_size(uword(1), subview<eT>::n_cols, (in.is_row ? uword(1) : in.n_rows), in.n_cols, "copy into submatrix");
 
3045
  
 
3046
  in.apply(*this);
 
3047
  }
 
3048
 
 
3049
 
 
3050
 
 
3051
template<typename eT>
3007
3052
arma_inline
3008
3053
const Op<subview_row<eT>,op_htrans>
3009
3054
subview_row<eT>::t() const