[Rcpp-commits] r1261 - pkg/RcppArmadillo/inst/include/armadillo_bits
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon May 17 23:49:27 CEST 2010
Author: edd
Date: 2010-05-17 23:49:27 +0200 (Mon, 17 May 2010)
New Revision: 1261
Modified:
pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/operator_div.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/operator_minus.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/operator_plus.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/operator_times.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/version.hpp
Log:
upgraded to Armadillo 0.9.8
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp 2010-05-17 20:57:10 UTC (rev 1260)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp 2010-05-17 21:49:27 UTC (rev 1261)
@@ -2638,7 +2638,7 @@
template<typename eT>
inline
-Mat<eT>::const_row_iterator::const_row_iterator(const Mat<eT>::row_iterator& X)
+Mat<eT>::const_row_iterator::const_row_iterator(const typename Mat<eT>::row_iterator& X)
: M (X.M)
, row(X.row)
, col(X.col)
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp 2010-05-17 20:57:10 UTC (rev 1260)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp 2010-05-17 21:49:27 UTC (rev 1261)
@@ -821,7 +821,7 @@
template<typename oT>
inline
-field<oT>::const_iterator::const_iterator(const field<oT>::iterator& X)
+field<oT>::const_iterator::const_iterator(const typename field<oT>::iterator& X)
: M(X.M)
, i(X.i)
{
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/operator_div.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/operator_div.hpp 2010-05-17 20:57:10 UTC (rev 1260)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/operator_div.hpp 2010-05-17 21:49:27 UTC (rev 1261)
@@ -53,6 +53,70 @@
+//! non-complex Base / complex scalar (experimental)
+template<typename T1>
+arma_inline
+Mat<typename std::complex<typename T1::pod_type> >
+operator/
+ (
+ const Base<typename T1::pod_type, T1>& X,
+ const std::complex<typename T1::pod_type>& k
+ )
+ {
+ arma_extra_debug_sigprint();
+
+ typedef typename std::complex<typename T1::pod_type> eT;
+ typedef typename T1::pod_type T;
+
+ const Proxy<T1> A(X.get_ref());
+
+ Mat<eT> out(A.n_rows, A.n_cols);
+
+ const u32 n_elem = A.n_elem;
+ eT* out_mem = out.memptr();
+
+ for(u32 i=0; i<n_elem; ++i)
+ {
+ out_mem[i] = A[i] / k;
+ }
+
+ return out;
+ }
+
+
+
+//! complex scalar / non-complex Base (experimental)
+template<typename T1>
+arma_inline
+Mat<typename std::complex<typename T1::pod_type> >
+operator/
+ (
+ const std::complex<typename T1::pod_type>& k,
+ const Base<typename T1::pod_type, T1>& X
+ )
+ {
+ arma_extra_debug_sigprint();
+
+ typedef typename std::complex<typename T1::pod_type> eT;
+ typedef typename T1::pod_type T;
+
+ const Proxy<T1> A(X.get_ref());
+
+ Mat<eT> out(A.n_rows, A.n_cols);
+
+ const u32 n_elem = A.n_elem;
+ eT* out_mem = out.memptr();
+
+ for(u32 i=0; i<n_elem; ++i)
+ {
+ out_mem[i] = k / A[i];
+ }
+
+ return out;
+ }
+
+
+
//! element-wise division of Base objects with same element type
template<typename T1, typename T2>
arma_inline
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/operator_minus.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/operator_minus.hpp 2010-05-17 20:57:10 UTC (rev 1260)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/operator_minus.hpp 2010-05-17 21:49:27 UTC (rev 1261)
@@ -81,6 +81,70 @@
+//! non-complex Base - complex scalar (experimental)
+template<typename T1>
+arma_inline
+Mat<typename std::complex<typename T1::pod_type> >
+operator-
+ (
+ const Base<typename T1::pod_type, T1>& X,
+ const std::complex<typename T1::pod_type>& k
+ )
+ {
+ arma_extra_debug_sigprint();
+
+ typedef typename std::complex<typename T1::pod_type> eT;
+ typedef typename T1::pod_type T;
+
+ const Proxy<T1> A(X.get_ref());
+
+ Mat<eT> out(A.n_rows, A.n_cols);
+
+ const u32 n_elem = A.n_elem;
+ eT* out_mem = out.memptr();
+
+ for(u32 i=0; i<n_elem; ++i)
+ {
+ out_mem[i] = A[i] - k;
+ }
+
+ return out;
+ }
+
+
+
+//! complex scalar - non-complex Base (experimental)
+template<typename T1>
+arma_inline
+Mat<typename std::complex<typename T1::pod_type> >
+operator-
+ (
+ const std::complex<typename T1::pod_type>& k,
+ const Base<typename T1::pod_type, T1>& X
+ )
+ {
+ arma_extra_debug_sigprint();
+
+ typedef typename std::complex<typename T1::pod_type> eT;
+ typedef typename T1::pod_type T;
+
+ const Proxy<T1> A(X.get_ref());
+
+ Mat<eT> out(A.n_rows, A.n_cols);
+
+ const u32 n_elem = A.n_elem;
+ eT* out_mem = out.memptr();
+
+ for(u32 i=0; i<n_elem; ++i)
+ {
+ out_mem[i] = k - A[i];
+ }
+
+ return out;
+ }
+
+
+
//! subtraction of Base objects with same element type
template<typename T1, typename T2>
arma_inline
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/operator_plus.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/operator_plus.hpp 2010-05-17 20:57:10 UTC (rev 1260)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/operator_plus.hpp 2010-05-17 21:49:27 UTC (rev 1261)
@@ -61,6 +61,70 @@
+//! non-complex Base + complex scalar (experimental)
+template<typename T1>
+arma_inline
+Mat<typename std::complex<typename T1::pod_type> >
+operator+
+ (
+ const Base<typename T1::pod_type, T1>& X,
+ const std::complex<typename T1::pod_type>& k
+ )
+ {
+ arma_extra_debug_sigprint();
+
+ typedef typename std::complex<typename T1::pod_type> eT;
+ typedef typename T1::pod_type T;
+
+ const Proxy<T1> A(X.get_ref());
+
+ Mat<eT> out(A.n_rows, A.n_cols);
+
+ const u32 n_elem = A.n_elem;
+ eT* out_mem = out.memptr();
+
+ for(u32 i=0; i<n_elem; ++i)
+ {
+ out_mem[i] = A[i] + k;
+ }
+
+ return out;
+ }
+
+
+
+//! complex scalar + non-complex Base (experimental)
+template<typename T1>
+arma_inline
+Mat<typename std::complex<typename T1::pod_type> >
+operator+
+ (
+ const std::complex<typename T1::pod_type>& k,
+ const Base<typename T1::pod_type, T1>& X
+ )
+ {
+ arma_extra_debug_sigprint();
+
+ typedef typename std::complex<typename T1::pod_type> eT;
+ typedef typename T1::pod_type T;
+
+ const Proxy<T1> A(X.get_ref());
+
+ Mat<eT> out(A.n_rows, A.n_cols);
+
+ const u32 n_elem = A.n_elem;
+ eT* out_mem = out.memptr();
+
+ for(u32 i=0; i<n_elem; ++i)
+ {
+ out_mem[i] = k + A[i];
+ }
+
+ return out;
+ }
+
+
+
//! addition of Base objects with same element type
template<typename T1, typename T2>
arma_inline
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/operator_times.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/operator_times.hpp 2010-05-17 20:57:10 UTC (rev 1260)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/operator_times.hpp 2010-05-17 21:49:27 UTC (rev 1261)
@@ -48,6 +48,70 @@
+//! non-complex Base * complex scalar (experimental)
+template<typename T1>
+arma_inline
+Mat<typename std::complex<typename T1::pod_type> >
+operator*
+ (
+ const Base<typename T1::pod_type, T1>& X,
+ const std::complex<typename T1::pod_type>& k
+ )
+ {
+ arma_extra_debug_sigprint();
+
+ typedef typename std::complex<typename T1::pod_type> eT;
+ typedef typename T1::pod_type T;
+
+ const Proxy<T1> A(X.get_ref());
+
+ Mat<eT> out(A.n_rows, A.n_cols);
+
+ const u32 n_elem = A.n_elem;
+ eT* out_mem = out.memptr();
+
+ for(u32 i=0; i<n_elem; ++i)
+ {
+ out_mem[i] = A[i] * k;
+ }
+
+ return out;
+ }
+
+
+
+//! complex scalar * non-complex Base (experimental)
+template<typename T1>
+arma_inline
+Mat<typename std::complex<typename T1::pod_type> >
+operator*
+ (
+ const std::complex<typename T1::pod_type>& k,
+ const Base<typename T1::pod_type, T1>& X
+ )
+ {
+ arma_extra_debug_sigprint();
+
+ typedef typename std::complex<typename T1::pod_type> eT;
+ typedef typename T1::pod_type T;
+
+ const Proxy<T1> A(X.get_ref());
+
+ Mat<eT> out(A.n_rows, A.n_cols);
+
+ const u32 n_elem = A.n_elem;
+ eT* out_mem = out.memptr();
+
+ for(u32 i=0; i<n_elem; ++i)
+ {
+ out_mem[i] = k * A[i];
+ }
+
+ return out;
+ }
+
+
+
//! scalar * trans(T1)
template<typename T1>
arma_inline
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/version.hpp 2010-05-17 20:57:10 UTC (rev 1260)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/version.hpp 2010-05-17 21:49:27 UTC (rev 1261)
@@ -23,7 +23,18 @@
{
static const unsigned int major = 0;
static const unsigned int minor = 9;
- static const unsigned int patch = 6;
+ static const unsigned int patch = 8;
+
+ static
+ inline
+ std::string
+ as_string()
+ {
+ std::stringstream ss;
+ ss << arma_version::major << '.' << arma_version::minor << '.' << arma_version::patch;
+
+ return ss.str();
+ }
};
More information about the Rcpp-commits
mailing list