[Rcpp-commits] r4315 - in pkg/RcppArmadillo: . debian inst inst/include/armadillo_bits
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon May 13 16:52:58 CEST 2013
Author: edd
Date: 2013-05-13 16:52:58 +0200 (Mon, 13 May 2013)
New Revision: 4315
Modified:
pkg/RcppArmadillo/ChangeLog
pkg/RcppArmadillo/DESCRIPTION
pkg/RcppArmadillo/cleanup
pkg/RcppArmadillo/debian/changelog
pkg/RcppArmadillo/inst/NEWS.Rd
pkg/RcppArmadillo/inst/include/armadillo_bits/Col_bones.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_bones.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/Row_bones.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/Row_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/config.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/debug.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/eGlueCube_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/eglue_core_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/eop_core_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/field_bones.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/fn_as_scalar.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/fn_trace.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/gemm.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/gemv.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/glue_mixed_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/glue_times_bones.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/glue_times_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/op_dot_bones.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/op_dot_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/op_strans_bones.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/op_strans_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/op_sum_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/operator_times.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/traits.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/unwrap.hpp
Log:
Release 0.3.820 using Armadillo 3.820
Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/ChangeLog 2013-05-13 14:52:58 UTC (rev 4315)
@@ -1,3 +1,10 @@
+2013-05-13 Dirk Eddelbuettel <edd at debian.org>
+
+ * DESCRIPTION: Release 0.3.820
+ * inst/NEWS: Release 0.3.820
+ * inst/include/*: Upgraded to new release 3.820 of Armadillo
+ * debian/*: Similarly updated for new release to Debian
+
2013-04-30 Dirk Eddelbuettel <edd at debian.org>
* DESCRIPTION: Release 0.3.810.2
Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/DESCRIPTION 2013-05-13 14:52:58 UTC (rev 4315)
@@ -1,7 +1,7 @@
Package: RcppArmadillo
Type: Package
Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.3.810.2
+Version: 0.3.820
Date: $Date$
Author: Romain Francois, Dirk Eddelbuettel and Doug Bates
Maintainer: Dirk Eddelbuettel <edd at debian.org>
@@ -21,7 +21,7 @@
(due to speed and/or integration capabilities), rather than another language.
.
The RcppArmadillo package includes the header files from the templated
- Armadillo library (currently version 3.810.2). Thus users do not need to
+ Armadillo library (currently version 3.820). Thus users do not need to
install Armadillo itself in order to use RcppArmadillo.
.
This Armadillo integration provides a nice illustration of the
Modified: pkg/RcppArmadillo/cleanup
===================================================================
--- pkg/RcppArmadillo/cleanup 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/cleanup 2013-05-13 14:52:58 UTC (rev 4315)
@@ -5,5 +5,6 @@
inst/doc/RcppArmadillo-unitTests.out \
inst/doc/RcppArmadillo-unitTests.aux \
inst/doc/RcppArmadillo-unitTests.log \
+ inst/doc/RcppArmadillo-intro.out \
*/*~ *~
rm -rf autom4te.cache
Modified: pkg/RcppArmadillo/debian/changelog
===================================================================
--- pkg/RcppArmadillo/debian/changelog 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/debian/changelog 2013-05-13 14:52:58 UTC (rev 4315)
@@ -1,3 +1,9 @@
+r-cran-rcpparmadillo (0.3.820-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Dirk Eddelbuettel <edd at debian.org> Mon, 13 May 2013 09:20:13 -0500
+
r-cran-rcpparmadillo (0.3.810.2-1) unstable; urgency=low
* New upstream release
Modified: pkg/RcppArmadillo/inst/NEWS.Rd
===================================================================
--- pkg/RcppArmadillo/inst/NEWS.Rd 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/NEWS.Rd 2013-05-13 14:52:58 UTC (rev 4315)
@@ -2,6 +2,18 @@
\title{News for Package 'RcppArmadillo'}
\newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
+\section{Changes in RcppArmadillo version 0.3.820 (2013-05-12)}{
+ \itemize{
+ \item Upgraded to Armadillo release Version 3.820 (Mt Cootha)
+ \itemize{
+ \item faster \code{as_scalar()} for compound expressions
+ \item faster transpose of small vectors
+ \item faster matrix-vector product for small vectors
+ \item faster multiplication of small fixed size matrices
+ }
+ }
+}
+
\section{Changes in RcppArmadillo version 0.3.810.2 (2013-04-30)}{
\itemize{
\item Upgraded to Armadillo release Version 3.810.2
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Col_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Col_bones.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Col_bones.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2012 Conrad Sanderson
+// Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2013 Conrad Sanderson
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -171,17 +171,16 @@
inline const Col& operator=(const std::string& text);
inline const Col& operator=(const subview_cube<eT>& X);
+ using Col<eT>::operator();
- #if !defined(ARMA_GCC47_BUG)
- using Col<eT>::operator();
- #endif
-
-
#if defined(ARMA_USE_CXX11)
inline fixed(const std::initializer_list<eT>& list);
inline const Col& operator=(const std::initializer_list<eT>& list);
#endif
+ arma_inline const Op< Col_fixed_type, op_htrans > t() const;
+ arma_inline const Op< Col_fixed_type, op_htrans > ht() const;
+ arma_inline const Op< Col_fixed_type, op_strans > st() const;
arma_inline arma_warn_unused eT& operator[] (const uword i);
arma_inline arma_warn_unused eT operator[] (const uword i) const;
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -1026,6 +1026,39 @@
template<typename eT>
template<uword fixed_n_elem>
arma_inline
+const Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type, op_htrans >
+Col<eT>::fixed<fixed_n_elem>::t() const
+ {
+ return Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type, op_htrans >(*this);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_elem>
+arma_inline
+const Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type, op_htrans >
+Col<eT>::fixed<fixed_n_elem>::ht() const
+ {
+ return Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type, op_htrans >(*this);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_elem>
+arma_inline
+const Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type, op_strans >
+Col<eT>::fixed<fixed_n_elem>::st() const
+ {
+ return Op< typename Col<eT>::template fixed<fixed_n_elem>::Col_fixed_type, op_strans >(*this);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_elem>
+arma_inline
arma_warn_unused
eT&
Col<eT>::fixed<fixed_n_elem>::operator[] (const uword ii)
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_bones.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_bones.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -270,11 +270,13 @@
typedef eT* slice_iterator;
typedef const eT* const_slice_iterator;
- inline iterator begin();
- inline const_iterator begin() const;
+ inline iterator begin();
+ inline const_iterator begin() const;
+ inline const_iterator cbegin() const;
- inline iterator end();
- inline const_iterator end() const;
+ inline iterator end();
+ inline const_iterator end() const;
+ inline const_iterator cend() const;
inline slice_iterator begin_slice(const uword slice_num);
inline const_slice_iterator begin_slice(const uword slice_num) const;
@@ -324,10 +326,13 @@
{
private:
- static const uword fixed_n_elem = fixed_n_rows * fixed_n_cols * fixed_n_slices;
+ static const uword fixed_n_elem = fixed_n_rows * fixed_n_cols * fixed_n_slices;
+ static const uword fixed_n_elem_slice = fixed_n_rows * fixed_n_cols;
+ static const bool use_extra = (fixed_n_elem > Cube_prealloc::mem_n_elem);
+
arma_aligned Mat<eT>* mat_ptrs_local_extra[ (fixed_n_slices > Cube_prealloc::mat_ptrs_size) ? fixed_n_slices : 1 ];
- arma_aligned eT mem_local_extra [ (fixed_n_elem > Cube_prealloc::mem_n_elem) ? fixed_n_elem : 1 ];
+ arma_aligned eT mem_local_extra [ use_extra ? fixed_n_elem : 1 ];
arma_inline void mem_setup();
@@ -348,8 +353,23 @@
inline explicit fixed(const BaseCube<pod_type,T1>& A, const BaseCube<pod_type,T2>& B) { mem_setup(); Cube<eT>::init(A,B); }
- // using Cube<eT>::operator();
- // TODO: overload operator(), operator[] and .at() to allow faster element access
+ using Cube<eT>::operator();
+
+
+ arma_inline arma_warn_unused eT& operator[] (const uword i);
+ arma_inline arma_warn_unused eT operator[] (const uword i) const;
+
+ arma_inline arma_warn_unused eT& at (const uword i);
+ arma_inline arma_warn_unused eT at (const uword i) const;
+
+ arma_inline arma_warn_unused eT& operator() (const uword i);
+ arma_inline arma_warn_unused eT operator() (const uword i) const;
+
+ arma_inline arma_warn_unused eT& at (const uword in_row, const uword in_col, const uword in_slice);
+ arma_inline arma_warn_unused eT at (const uword in_row, const uword in_col, const uword in_slice) const;
+
+ arma_inline arma_warn_unused eT& operator() (const uword in_row, const uword in_col, const uword in_slice);
+ arma_inline arma_warn_unused eT operator() (const uword in_row, const uword in_col, const uword in_slice) const;
};
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -248,7 +248,7 @@
{
arma_extra_debug_sigprint();
- typedef typename T1::elem_type T;
+ typedef typename T1::elem_type T;
arma_type_check(( is_complex<eT>::value == false )); //!< compile-time abort if eT isn't std::complex
arma_type_check(( is_complex< T>::value == true )); //!< compile-time abort if T is std::complex
@@ -258,7 +258,7 @@
const ProxyCube<T1> PX(X.get_ref());
const ProxyCube<T2> PY(Y.get_ref());
- arma_assert_same_size(PX, PY, "Cube()");
+ arma_debug_assert_same_size(PX, PY, "Cube()");
const uword local_n_rows = PX.get_n_rows();
const uword local_n_cols = PX.get_n_cols();
@@ -535,7 +535,7 @@
{
arma_extra_debug_sigprint();
- arma_debug_assert_same_size(*this, m, "cube addition");
+ arma_debug_assert_same_size(*this, m, "addition");
arrayops::inplace_plus( memptr(), m.memptr(), n_elem );
@@ -552,7 +552,7 @@
{
arma_extra_debug_sigprint();
- arma_debug_assert_same_size(*this, m, "cube subtraction");
+ arma_debug_assert_same_size(*this, m, "subtraction");
arrayops::inplace_minus( memptr(), m.memptr(), n_elem );
@@ -569,7 +569,7 @@
{
arma_extra_debug_sigprint();
- arma_debug_assert_same_size(*this, m, "element-wise cube multiplication");
+ arma_debug_assert_same_size(*this, m, "element-wise multiplication");
arrayops::inplace_mul( memptr(), m.memptr(), n_elem );
@@ -586,7 +586,7 @@
{
arma_extra_debug_sigprint();
- arma_debug_assert_same_size(*this, m, "element-wise cube division");
+ arma_debug_assert_same_size(*this, m, "element-wise division");
arrayops::inplace_div( memptr(), m.memptr(), n_elem );
@@ -3038,6 +3038,18 @@
template<typename eT>
inline
+typename Cube<eT>::const_iterator
+Cube<eT>::cbegin() const
+ {
+ arma_extra_debug_sigprint();
+
+ return memptr();
+ }
+
+
+
+template<typename eT>
+inline
typename Cube<eT>::iterator
Cube<eT>::end()
{
@@ -3057,9 +3069,21 @@
return memptr() + n_elem;
}
+
+
+
+template<typename eT>
+inline
+typename Cube<eT>::const_iterator
+Cube<eT>::cend() const
+ {
+ arma_extra_debug_sigprint();
+ return memptr() + n_elem;
+ }
+
template<typename eT>
inline
typename Cube<eT>::slice_iterator
@@ -3116,43 +3140,6 @@
-template<typename eT>
-template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
-arma_inline
-void
-Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::mem_setup()
- {
- arma_extra_debug_sigprint_this(this);
-
- if(fixed_n_elem > 0)
- {
- access::rw(Cube<eT>::n_rows) = fixed_n_rows;
- access::rw(Cube<eT>::n_cols) = fixed_n_cols;
- access::rw(Cube<eT>::n_elem_slice) = fixed_n_rows * fixed_n_cols;
- access::rw(Cube<eT>::n_slices) = fixed_n_slices;
- access::rw(Cube<eT>::n_elem) = fixed_n_elem;
- access::rw(Cube<eT>::mem_state) = 3;
- access::rw(Cube<eT>::mat_ptrs) = const_cast< const Mat<eT>** >( \
- (fixed_n_slices > Cube_prealloc::mat_ptrs_size) ? mat_ptrs_local_extra : mat_ptrs_local );
- access::rw(Cube<eT>::mem) = (fixed_n_elem > Cube_prealloc::mem_n_elem) ? mem_local_extra : mem_local;
-
- create_mat();
- }
- else
- {
- access::rw(Cube<eT>::n_rows) = 0;
- access::rw(Cube<eT>::n_cols) = 0;
- access::rw(Cube<eT>::n_elem_slice) = 0;
- access::rw(Cube<eT>::n_slices) = 0;
- access::rw(Cube<eT>::n_elem) = 0;
- access::rw(Cube<eT>::mem_state) = 3;
- access::rw(Cube<eT>::mat_ptrs) = 0;
- access::rw(Cube<eT>::mem) = 0;
- }
- }
-
-
-
//! resets this cube to an empty matrix
template<typename eT>
inline
@@ -3252,6 +3239,193 @@
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+void
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::mem_setup()
+ {
+ arma_extra_debug_sigprint_this(this);
+
+ if(fixed_n_elem > 0)
+ {
+ access::rw(Cube<eT>::n_rows) = fixed_n_rows;
+ access::rw(Cube<eT>::n_cols) = fixed_n_cols;
+ access::rw(Cube<eT>::n_elem_slice) = fixed_n_rows * fixed_n_cols;
+ access::rw(Cube<eT>::n_slices) = fixed_n_slices;
+ access::rw(Cube<eT>::n_elem) = fixed_n_elem;
+ access::rw(Cube<eT>::mem_state) = 3;
+ access::rw(Cube<eT>::mat_ptrs) = const_cast< const Mat<eT>** >( \
+ (fixed_n_slices > Cube_prealloc::mat_ptrs_size) ? mat_ptrs_local_extra : mat_ptrs_local );
+ access::rw(Cube<eT>::mem) = (fixed_n_elem > Cube_prealloc::mem_n_elem) ? mem_local_extra : mem_local;
+
+ create_mat();
+ }
+ else
+ {
+ access::rw(Cube<eT>::n_rows) = 0;
+ access::rw(Cube<eT>::n_cols) = 0;
+ access::rw(Cube<eT>::n_elem_slice) = 0;
+ access::rw(Cube<eT>::n_slices) = 0;
+ access::rw(Cube<eT>::n_elem) = 0;
+ access::rw(Cube<eT>::mem_state) = 3;
+ access::rw(Cube<eT>::mat_ptrs) = 0;
+ access::rw(Cube<eT>::mem) = 0;
+ }
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT&
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator[] (const uword i)
+ {
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator[] (const uword i) const
+ {
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT&
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword i)
+ {
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword i) const
+ {
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT&
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (const uword i)
+ {
+ arma_debug_check( (i >= fixed_n_elem), "Cube::operator(): out of bounds");
+
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (const uword i) const
+ {
+ arma_debug_check( (i >= fixed_n_elem), "Cube::operator(): out of bounds");
+
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT&
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword in_row, const uword in_col, const uword in_slice)
+ {
+ const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_row;
+
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::at(const uword in_row, const uword in_col, const uword in_slice) const
+ {
+ const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_row;
+
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT&
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (const uword in_row, const uword in_col, const uword in_slice)
+ {
+ arma_debug_check
+ (
+ (in_row >= fixed_n_rows ) ||
+ (in_col >= fixed_n_cols ) ||
+ (in_slice >= fixed_n_slices)
+ ,
+ "Cube::operator(): index out of bounds"
+ );
+
+ const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_row;
+
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols, uword fixed_n_slices>
+arma_inline
+arma_warn_unused
+eT
+Cube<eT>::fixed<fixed_n_rows, fixed_n_cols, fixed_n_slices>::operator() (const uword in_row, const uword in_col, const uword in_slice) const
+ {
+ arma_debug_check
+ (
+ (in_row >= fixed_n_rows ) ||
+ (in_col >= fixed_n_cols ) ||
+ (in_slice >= fixed_n_slices)
+ ,
+ "Cube::operator(): index out of bounds"
+ );
+
+ const uword i = in_slice*fixed_n_elem_slice + in_col*fixed_n_rows + in_row;
+
+ return (use_extra) ? mem_local_extra[i] : mem_local[i];
+ }
+
+
+
//! prefix ++
template<typename eT>
arma_inline
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -464,11 +464,13 @@
arma_aligned uword col;
};
- inline iterator begin();
- inline const_iterator begin() const;
+ inline iterator begin();
+ inline const_iterator begin() const;
+ inline const_iterator cbegin() const;
- inline iterator end();
- inline const_iterator end() const;
+ inline iterator end();
+ inline const_iterator end() const;
+ inline const_iterator cend() const;
inline col_iterator begin_col(const uword col_num);
inline const_col_iterator begin_col(const uword col_num) const;
@@ -567,25 +569,17 @@
inline fixed(const char* text);
inline fixed(const std::string& text);
+ using Mat<eT>::operator=;
+ using Mat<eT>::operator();
- #if !defined(ARMA_GCC47_BUG)
- using Mat<eT>::operator=;
- using Mat<eT>::operator();
- #else
- template<typename T1> inline const Mat& operator=(const Base<eT,T1>& A);
-
- inline const Mat& operator=(const eT val);
-
- inline const Mat& operator=(const char* text);
- inline const Mat& operator=(const std::string& text);
- #endif
-
-
#if defined(ARMA_USE_CXX11)
inline fixed(const std::initializer_list<eT>& list);
inline const Mat& operator=(const std::initializer_list<eT>& list);
#endif
+ arma_inline const Op< Mat_fixed_type, op_htrans > t() const;
+ arma_inline const Op< Mat_fixed_type, op_htrans > ht() const;
+ arma_inline const Op< Mat_fixed_type, op_strans > st() const;
arma_inline arma_warn_unused eT& operator[] (const uword i);
arma_inline arma_warn_unused eT operator[] (const uword i) const;
@@ -599,9 +593,14 @@
arma_inline arma_warn_unused eT& operator() (const uword in_row, const uword in_col);
arma_inline arma_warn_unused eT operator() (const uword in_row, const uword in_col) const;
+ arma_inline arma_warn_unused eT* colptr(const uword in_col);
+ arma_inline arma_warn_unused const eT* colptr(const uword in_col) const;
+
arma_inline arma_warn_unused eT* memptr();
arma_inline arma_warn_unused const eT* memptr() const;
+ arma_inline arma_warn_unused bool is_vec() const;
+
arma_hot inline const Mat<eT>& fill(const eT val);
arma_hot inline const Mat<eT>& zeros();
arma_hot inline const Mat<eT>& ones();
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -672,7 +672,7 @@
const Proxy<T1> PX(X.get_ref());
const Proxy<T2> PY(Y.get_ref());
- arma_assert_same_size(PX, PY, "Mat()");
+ arma_debug_assert_same_size(PX, PY, "Mat()");
const uword local_n_rows = PX.get_n_rows();
const uword local_n_cols = PX.get_n_cols();
@@ -5922,6 +5922,18 @@
template<typename eT>
inline
+typename Mat<eT>::const_iterator
+Mat<eT>::cbegin() const
+ {
+ arma_extra_debug_sigprint();
+
+ return memptr();
+ }
+
+
+
+template<typename eT>
+inline
typename Mat<eT>::iterator
Mat<eT>::end()
{
@@ -5941,9 +5953,21 @@
return memptr() + n_elem;
}
+
+
+
+template<typename eT>
+inline
+typename Mat<eT>::const_iterator
+Mat<eT>::cend() const
+ {
+ arma_extra_debug_sigprint();
+ return memptr() + n_elem;
+ }
+
template<typename eT>
inline
typename Mat<eT>::col_iterator
@@ -6184,69 +6208,6 @@
-#if defined(ARMA_GCC47_BUG)
-
- template<typename eT>
- template<uword fixed_n_rows, uword fixed_n_cols>
- template<typename T1>
- inline
- const Mat<eT>&
- Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator=(const Base<eT,T1>& A)
- {
- Mat<eT>::operator=(A.get_ref());
-
- return *this;
- }
-
-
-
- template<typename eT>
- template<uword fixed_n_rows, uword fixed_n_cols>
- inline
- const Mat<eT>&
- Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator=(const eT val)
- {
- arma_extra_debug_sigprint();
-
- Mat<eT>::operator=(val);
-
- return *this;
- }
-
-
-
- template<typename eT>
- template<uword fixed_n_rows, uword fixed_n_cols>
- inline
- const Mat<eT>&
- Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator=(const char* text)
- {
- arma_extra_debug_sigprint();
-
- Mat<eT>::operator=(text);
-
- return *this;
- }
-
-
-
- template<typename eT>
- template<uword fixed_n_rows, uword fixed_n_cols>
- inline
- const Mat<eT>&
- Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator=(const std::string& text)
- {
- arma_extra_debug_sigprint();
-
- Mat<eT>::operator=(text);
-
- return *this;
- }
-
-#endif
-
-
-
#if defined(ARMA_USE_CXX11)
template<typename eT>
@@ -6284,12 +6245,45 @@
}
#endif
-
+
template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols>
arma_inline
+const Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>::Mat_fixed_type, op_htrans >
+Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::t() const
+ {
+ return Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>::Mat_fixed_type, op_htrans >(*this);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols>
+arma_inline
+const Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>::Mat_fixed_type, op_htrans >
+Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::ht() const
+ {
+ return Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>::Mat_fixed_type, op_htrans >(*this);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols>
+arma_inline
+const Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>::Mat_fixed_type, op_strans >
+Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::st() const
+ {
+ return Op< typename Mat<eT>::template fixed<fixed_n_rows, fixed_n_cols>::Mat_fixed_type, op_strans >(*this);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols>
+arma_inline
arma_warn_unused
eT&
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::operator[] (const uword ii)
@@ -6428,6 +6422,34 @@
arma_inline
arma_warn_unused
eT*
+Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::colptr(const uword in_col)
+ {
+ eT* mem_actual = (use_extra) ? mem_local_extra : mem_local;
+
+ return & access::rw(mem_actual[in_col*fixed_n_rows]);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols>
+arma_inline
+arma_warn_unused
+const eT*
+Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::colptr(const uword in_col) const
+ {
+ const eT* mem_actual = (use_extra) ? mem_local_extra : mem_local;
+
+ return & mem_actual[in_col*fixed_n_rows];
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols>
+arma_inline
+arma_warn_unused
+eT*
Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::memptr()
{
return (use_extra) ? mem_local_extra : mem_local;
@@ -6449,6 +6471,18 @@
template<typename eT>
template<uword fixed_n_rows, uword fixed_n_cols>
+arma_inline
+arma_warn_unused
+bool
+Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::is_vec() const
+ {
+ return ( (fixed_n_rows == 1) || (fixed_n_cols == 1) );
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_rows, uword fixed_n_cols>
arma_hot
inline
const Mat<eT>&
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Row_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Row_bones.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Row_bones.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -169,17 +169,16 @@
inline const Row& operator=(const std::string& text);
inline const Row& operator=(const subview_cube<eT>& X);
+ using Row<eT>::operator();
- #if !defined(ARMA_GCC47_BUG)
- using Row<eT>::operator();
- #endif
-
-
#if defined(ARMA_USE_CXX11)
inline fixed(const std::initializer_list<eT>& list);
inline const Row& operator=(const std::initializer_list<eT>& list);
#endif
+ arma_inline const Op< Row_fixed_type, op_htrans > t() const;
+ arma_inline const Op< Row_fixed_type, op_htrans > ht() const;
+ arma_inline const Op< Row_fixed_type, op_strans > st() const;
arma_inline arma_warn_unused eT& operator[] (const uword i);
arma_inline arma_warn_unused eT operator[] (const uword i) const;
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Row_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Row_meat.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Row_meat.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -964,6 +964,39 @@
template<typename eT>
template<uword fixed_n_elem>
arma_inline
+const Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type, op_htrans >
+Row<eT>::fixed<fixed_n_elem>::t() const
+ {
+ return Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type, op_htrans >(*this);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_elem>
+arma_inline
+const Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type, op_htrans >
+Row<eT>::fixed<fixed_n_elem>::ht() const
+ {
+ return Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type, op_htrans >(*this);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_elem>
+arma_inline
+const Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type, op_strans >
+Row<eT>::fixed<fixed_n_elem>::st() const
+ {
+ return Op< typename Row<eT>::template fixed<fixed_n_elem>::Row_fixed_type, op_strans >(*this);
+ }
+
+
+
+template<typename eT>
+template<uword fixed_n_elem>
+arma_inline
arma_warn_unused
eT&
Row<eT>::fixed<fixed_n_elem>::operator[] (const uword ii)
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -626,43 +626,48 @@
, col_ptrs(NULL)
{
arma_extra_debug_sigprint();
-
+
typedef typename T1::elem_type T;
-
+
// Make sure eT is complex and T is not (compile-time check).
arma_type_check(( is_complex<eT>::value == false ));
arma_type_check(( is_complex< T>::value == true ));
-
+
// Compile-time abort if types are not compatible.
arma_type_check(( is_same_type< std::complex<T>, eT >::value == false ));
-
- // Hack until Proxy supports sparse matrices: assume get_ref() is SpMat<> (at
- // the moment it must be).
- const SpMat<T>& X = A.get_ref();
- const SpMat<T>& Y = B.get_ref();
-
- arma_assert_same_size(X.n_rows, X.n_cols, Y.n_rows, Y.n_cols, "SpMat()");
-
+
+ const unwrap_spmat<T1> tmp1(A.get_ref());
+ const unwrap_spmat<T2> tmp2(B.get_ref());
+
+ const SpMat<T>& X = tmp1.M;
+ const SpMat<T>& Y = tmp2.M;
+
+ arma_debug_assert_same_size(X.n_rows, X.n_cols, Y.n_rows, Y.n_cols, "SpMat()");
+
const uword l_n_rows = X.n_rows;
const uword l_n_cols = X.n_cols;
-
+
// Set size of matrix correctly.
init(l_n_rows, l_n_cols);
mem_resize(n_unique(X, Y, op_n_unique_count()));
-
+
// Now on a second iteration, fill it.
- typename SpMat<T>::const_iterator x_it = X.begin();
- typename SpMat<T>::const_iterator y_it = Y.begin();
+ typename SpMat<T>::const_iterator x_it = X.begin();
+ typename SpMat<T>::const_iterator x_end = X.end();
+
+ typename SpMat<T>::const_iterator y_it = Y.begin();
+ typename SpMat<T>::const_iterator y_end = Y.end();
+
uword cur_pos = 0;
-
- while ((x_it != X.end()) || (y_it != Y.end()))
+
+ while ((x_it != x_end) || (y_it != y_end))
{
if(x_it == y_it) // if we are at the same place
{
access::rw(values[cur_pos]) = std::complex<T>((T) *x_it, (T) *y_it);
access::rw(row_indices[cur_pos]) = x_it.row();
++access::rw(col_ptrs[x_it.col() + 1]);
-
+
++x_it;
++y_it;
}
@@ -673,7 +678,7 @@
access::rw(values[cur_pos]) = std::complex<T>((T) *x_it, T(0));
access::rw(row_indices[cur_pos]) = x_it.row();
++access::rw(col_ptrs[x_it.col() + 1]);
-
+
++x_it;
}
else // x is closer to the end
@@ -681,20 +686,20 @@
access::rw(values[cur_pos]) = std::complex<T>(T(0), (T) *y_it);
access::rw(row_indices[cur_pos]) = y_it.row();
++access::rw(col_ptrs[y_it.col() + 1]);
-
+
++y_it;
}
}
-
+
++cur_pos;
}
-
+
// Now fix the column pointers; they are supposed to be a sum.
for (uword c = 1; c <= n_cols; ++c)
{
access::rw(col_ptrs[c]) += col_ptrs[c - 1];
}
-
+
}
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -12,9 +12,9 @@
#define ARMA_VERSION_MAJOR 3
-#define ARMA_VERSION_MINOR 810
-#define ARMA_VERSION_PATCH 2
-#define ARMA_VERSION_NAME "Newell Highway"
+#define ARMA_VERSION_MINOR 820
+#define ARMA_VERSION_PATCH 0
+#define ARMA_VERSION_NAME "Mt Cootha"
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp 2013-04-30 12:11:22 UTC (rev 4314)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp 2013-05-13 14:52:58 UTC (rev 4315)
@@ -134,12 +134,8 @@
#endif
#if ( (ARMA_GCC_VERSION >= 40700) && (ARMA_GCC_VERSION <= 40701) )
- #define ARMA_GCC47_BUG
-
- #warning "*** Detected GCC 4.7.0 / 4.7.1, which has a regression (bug)"
- #warning "*** See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53549 "
- #warning "*** A partial workaround for the bug has been activated, "
- #warning "*** which reduces some functionality in fixed-size matrices "
+ #error "gcc versions 4.7.0 and 4.7.1 are unsupported; use 4.7.2 or later"
+ // due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53549
#endif
#undef ARMA_GCC_VERSION
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/rcpp -r 4315
More information about the Rcpp-commits
mailing list