~ubuntu-branches/ubuntu/saucy/r-cran-rcpparmadillo/saucy-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2013-06-04 19:01:58 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130604190158-py0qfn57hozwl4x5
Tags: 0.3.900.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (C) 2010-2012 NICTA (www.nicta.com.au)
2
 
// Copyright (C) 2010-2012 Conrad Sanderson
 
1
// Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
 
2
// Copyright (C) 2010-2013 Conrad Sanderson
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
98
98
 
99
99
 
100
100
 
 
101
template<typename T1, typename T2, typename eglue_type>
 
102
arma_inline
 
103
typename T1::elem_type
 
104
eGlue<T1,T2,eglue_type>::at_alt(const uword ii) const
 
105
  {
 
106
  // the optimiser will keep only one return statement
 
107
  
 
108
       if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1.at_alt(ii) + P2.at_alt(ii); }
 
109
  else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1.at_alt(ii) - P2.at_alt(ii); }
 
110
  else if(is_same_type<eglue_type, eglue_div  >::value == true) { return P1.at_alt(ii) / P2.at_alt(ii); }
 
111
  else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1.at_alt(ii) * P2.at_alt(ii); }
 
112
  }
 
113
 
 
114
 
 
115
 
101
116
//! @}