[Rcpp-commits] r3978 - in pkg/RcppArmadillo: . inst inst/include/armadillo_bits man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Nov 16 03:44:33 CET 2012
Author: edd
Date: 2012-11-16 03:44:32 +0100 (Fri, 16 Nov 2012)
New Revision: 3978
Modified:
pkg/RcppArmadillo/ChangeLog
pkg/RcppArmadillo/DESCRIPTION
pkg/RcppArmadillo/inst/NEWS.Rd
pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/SpSubview_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_bones.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/fn_n_unique.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/operator_div.hpp
pkg/RcppArmadillo/man/RcppArmadillo-package.Rd
Log:
release 0.3.4.4 with Armadillo 3.4.4
Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/ChangeLog 2012-11-16 02:44:32 UTC (rev 3978)
@@ -1,3 +1,9 @@
+2012-11-15 Dirk Eddelbuettel <edd at debian.org>
+
+ * DESCRIPTION: Release 0.3.4.4
+
+ * inst/include/*: Upgraded to new release 3.4.4 of Armadillo
+
2012-10-04 Dirk Eddelbuettel <edd at debian.org>
* DESCRIPTION: Release 0.3.4.3
Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/DESCRIPTION 2012-11-16 02:44:32 UTC (rev 3978)
@@ -1,7 +1,7 @@
Package: RcppArmadillo
Type: Package
Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.3.4.3
+Version: 0.3.4.4
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.4.3). Thus users do not need to
+ Armadillo library (currently version 3.4.4). 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/inst/NEWS.Rd
===================================================================
--- pkg/RcppArmadillo/inst/NEWS.Rd 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/inst/NEWS.Rd 2012-11-16 02:44:32 UTC (rev 3978)
@@ -2,6 +2,16 @@
\title{News for Package 'RcppArmadillo'}
\newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
+\section{Changes in RcppArmadillo version 0.3.4.4 (2012-11-15)}{
+ \itemize{
+ \item Upgraded to Armadillo release 3.4.4
+ \itemize{
+ \item fix for handling complex numbers by sparse matrices
+ \item fix for minor memory leak by sparse matrices
+ }
+ }
+}
+
\section{Changes in RcppArmadillo version 0.3.4.3 (2012-10-04)}{
\itemize{
\item Upgraded to Armadillo release 3.4.3
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp 2012-11-16 02:44:32 UTC (rev 3978)
@@ -46,7 +46,7 @@
inline
SpMat<eT>::~SpMat()
{
- arma_extra_debug_sigprint();
+ arma_extra_debug_sigprint_this(this);
// If necessary, release the memory.
if (values)
@@ -1418,6 +1418,8 @@
{
arma_extra_debug_sigprint();
+ arma_debug_check(row_num >= n_rows, "SpMat::row(): out of bounds");
+
return SpSubview<eT>(*this, row_num, 0, 1, n_cols);
}
@@ -1430,6 +1432,8 @@
{
arma_extra_debug_sigprint();
+ arma_debug_check(row_num >= n_rows, "SpMat::row(): out of bounds");
+
return SpSubview<eT>(*this, row_num, 0, 1, n_cols);
}
@@ -1500,6 +1504,8 @@
{
arma_extra_debug_sigprint();
+ arma_debug_check(col_num >= n_cols, "SpMat::col(): out of bounds");
+
return SpSubview<eT>(*this, 0, col_num, n_rows, 1);
}
@@ -1512,6 +1518,8 @@
{
arma_extra_debug_sigprint();
+ arma_debug_check(col_num >= n_cols, "SpMat::col(): out of bounds");
+
return SpSubview<eT>(*this, 0, col_num, n_rows, 1);
}
@@ -3470,10 +3478,10 @@
arrayops::copy(new_values, values, copy_size);
arrayops::copy(new_row_indices, row_indices, copy_size);
+ }
- memory::release(values);
- memory::release(row_indices);
- }
+ memory::release(values);
+ memory::release(row_indices);
access::rw(values) = new_values;
access::rw(row_indices) = new_row_indices;
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/SpSubview_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/SpSubview_meat.hpp 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/SpSubview_meat.hpp 2012-11-16 02:44:32 UTC (rev 3978)
@@ -711,6 +711,8 @@
const uword end_row = aux_row1 + n_rows;
const uword start_col = aux_col1;
const uword end_col = aux_col1 + n_cols;
+
+ const uword orig_nonzero = m.n_nonzero;
// iterate over our part of the sparse matrix
for(uword col = start_col; col < end_col; ++col)
@@ -718,6 +720,9 @@
{
access::rw(m).at(row, col) = val;
}
+
+ access::rw(n_nonzero) += (m.n_nonzero - orig_nonzero);
+
}
else
{
@@ -765,17 +770,21 @@
SpSubview<eT>::eye()
{
arma_extra_debug_sigprint();
-
+
// clear other things
(*this).zeros();
-
+
+ const uword orig_nonzero = m.n_nonzero;
+
// now the diagonal ones
const uword end_index = std::min(n_rows, n_cols);
-
+
for(uword ind = 0; ind < end_index; ++ind)
{
- m.at(ind + aux_row1, ind + aux_col1) = eT(1);
+ access::rw(m).at(ind + aux_row1, ind + aux_col1) = eT(1);
}
+
+ access::rw(n_nonzero) += (m.n_nonzero - orig_nonzero);
}
@@ -817,7 +826,7 @@
arma_debug_check( (i >= n_elem), "SpSubview::operator(): index out of bounds");
const uword row = i % n_rows;
- const uword col = i / n_cols;
+ const uword col = i / n_rows;
return (*this).at(row, col);
}
@@ -833,7 +842,7 @@
arma_debug_check( (i >= n_elem), "SpSubview::operator(): index out of bounds");
const uword row = i % n_rows;
- const uword col = i / n_cols;
+ const uword col = i / n_rows;
return (*this).at(row, col);
}
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_bones.hpp 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_bones.hpp 2012-11-16 02:44:32 UTC (rev 3978)
@@ -47,12 +47,6 @@
arma_inline SpValProxy& operator-=(const eT rhs);
arma_inline SpValProxy& operator*=(const eT rhs);
arma_inline SpValProxy& operator/=(const eT rhs);
- arma_inline SpValProxy& operator%=(const eT rhs);
- arma_inline SpValProxy& operator<<=(const eT rhs);
- arma_inline SpValProxy& operator>>=(const eT rhs);
- arma_inline SpValProxy& operator&=(const eT rhs);
- arma_inline SpValProxy& operator|=(const eT rhs);
- arma_inline SpValProxy& operator^=(const eT rhs);
arma_inline SpValProxy& operator++();
arma_inline SpValProxy& operator--();
@@ -77,4 +71,5 @@
};
+
//! @}
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_meat.hpp 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_meat.hpp 2012-11-16 02:44:32 UTC (rev 3978)
@@ -143,7 +143,7 @@
SpValProxy<T1>&
SpValProxy<T1>::operator*=(const eT rhs)
{
- if (rhs != 0)
+ if (rhs != eT(0))
{
if (val_ptr)
@@ -221,145 +221,17 @@
template<typename T1>
arma_inline
SpValProxy<T1>&
-SpValProxy<T1>::operator%=(const eT rhs)
- {
- if (val_ptr)
- {
- *val_ptr %= rhs;
- check_zero();
- }
-
- return *this;
- }
-
-
-
-template<typename T1>
-arma_inline
-SpValProxy<T1>&
-SpValProxy<T1>::operator<<=(const eT rhs)
- {
- // Shifting 0 by any amount should do nothing.
- if (val_ptr)
- {
- *val_ptr <<= rhs;
- check_zero();
- }
-
- return *this;
- }
-
-
-
-template<typename T1>
-arma_inline
-SpValProxy<T1>&
-SpValProxy<T1>::operator>>=(const eT rhs)
- {
- // Shifting 0 by any amount should do nothing.
- if (val_ptr)
- {
- *val_ptr <<= rhs;
- check_zero();
- }
-
- return *this;
- }
-
-
-
-template<typename T1>
-arma_inline
-SpValProxy<T1>&
-SpValProxy<T1>::operator&=(const eT rhs)
- {
- // Anding with 0 should do nothing.
- if (val_ptr)
- {
- *val_ptr &= rhs;
- check_zero();
- }
-
- return *this;
- }
-
-
-
-template<typename T1>
-arma_inline
-SpValProxy<T1>&
-SpValProxy<T1>::operator|=(const eT rhs)
- {
- // Oring with 0 means we assign rhs.
- if (rhs != eT(0))
- {
-
- if (val_ptr)
- {
- *val_ptr |= rhs;
- }
- else
- {
- val_ptr = &parent.add_element(row, col, rhs);
- }
-
- }
-
- return *this;
- }
-
-
-
-template<typename T1>
-arma_inline
-SpValProxy<T1>&
-SpValProxy<T1>::operator^=(const eT rhs)
- {
- // Xoring 0 with 0 is still 0.
- if (rhs != eT(0))
- {
-
- if (val_ptr)
- {
- *val_ptr ^= rhs;
- check_zero();
- }
- else
- {
- val_ptr = &parent.add_element(row, col, rhs ^ 0);
- }
-
- }
- else
- {
-
- if (val_ptr)
- {
- *val_ptr ^= rhs;
- check_zero();
- }
-
- }
-
- return *this;
- }
-
-
-
-template<typename T1>
-arma_inline
-SpValProxy<T1>&
SpValProxy<T1>::operator++()
{
if (val_ptr)
{
- ++(*val_ptr);
+ (*val_ptr) += eT(1);
check_zero();
}
else
{
- val_ptr = &parent.add_element(row, col, 1);
+ val_ptr = &parent.add_element(row, col, eT(1));
}
return *this;
@@ -374,13 +246,13 @@
{
if (val_ptr)
{
- --(*val_ptr);
+ (*val_ptr) -= eT(1);
check_zero();
}
else
{
- val_ptr = &parent.add_element(row, col, -1);
+ val_ptr = &parent.add_element(row, col, eT(-1));
}
return *this;
@@ -395,18 +267,18 @@
{
if (val_ptr)
{
- ++(*val_ptr);
+ (*val_ptr) += eT(1);
check_zero();
}
else
{
- val_ptr = &parent.add_element(row, col, 1);
+ val_ptr = &parent.add_element(row, col, eT(1));
}
if (val_ptr) // It may have changed to now be 0.
{
- return *(val_ptr - 1);
+ return *(val_ptr) - eT(1);
}
else
{
@@ -423,7 +295,7 @@
{
if (val_ptr)
{
- --(*val_ptr);
+ (*val_ptr) -= eT(1);
check_zero();
}
@@ -434,7 +306,7 @@
if (val_ptr) // It may have changed to now be 0.
{
- return *(val_ptr + 1);
+ return *(val_ptr) + eT(1);
}
else
{
@@ -472,3 +344,7 @@
val_ptr = NULL;
}
}
+
+
+
+//! @}
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp 2012-11-16 02:44:32 UTC (rev 3978)
@@ -18,7 +18,7 @@
#define ARMA_VERSION_MAJOR 3
#define ARMA_VERSION_MINOR 4
-#define ARMA_VERSION_PATCH 3
+#define ARMA_VERSION_PATCH 4
#define ARMA_VERSION_NAME "Ku De Ta"
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp 2012-11-16 02:44:32 UTC (rev 3978)
@@ -1559,7 +1559,7 @@
while(line_stream.good() == true)
{
- getline(line_stream, token, ',');
+ std::getline(line_stream, token, ',');
++line_n_cols;
}
@@ -1593,7 +1593,7 @@
while(line_stream.good() == true)
{
- getline(line_stream, token, ',');
+ std::getline(line_stream, token, ',');
eT val;
@@ -2946,7 +2946,7 @@
//
// while(line_stream.good() == true)
// {
-// getline(line_stream, token, ',');
+// std::getline(line_stream, token, ',');
// ++line_n_cols;
// }
//
@@ -2979,7 +2979,7 @@
//
// while(line_stream.good() == true)
// {
-// getline(line_stream, token, ',');
+// std::getline(line_stream, token, ',');
//
// eT val;
//
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_n_unique.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_n_unique.hpp 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_n_unique.hpp 2012-11-16 02:44:32 UTC (rev 3978)
@@ -64,7 +64,7 @@
{
if(x_it == y_it)
{
- if(op_n_unique_type::eval((*x_it), (*y_it)) != 0)
+ if(op_n_unique_type::eval((*x_it), (*y_it)) != typename T1::elem_type(0))
{
++total_n_nonzero;
}
@@ -76,7 +76,7 @@
{
if((x_it.col() < y_it.col()) || ((x_it.col() == y_it.col()) && (x_it.row() < y_it.row()))) // if y is closer to the end
{
- if(op_n_unique_type::eval((*x_it), typename T1::elem_type(0)) != 0)
+ if(op_n_unique_type::eval((*x_it), typename T1::elem_type(0)) != typename T1::elem_type(0))
{
++total_n_nonzero;
}
@@ -85,7 +85,7 @@
}
else // x is closer to the end
{
- if(op_n_unique_type::eval(typename T1::elem_type(0), (*y_it)) != 0)
+ if(op_n_unique_type::eval(typename T1::elem_type(0), (*y_it)) != typename T1::elem_type(0))
{
++total_n_nonzero;
}
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/operator_div.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/operator_div.hpp 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/operator_div.hpp 2012-11-16 02:44:32 UTC (rev 3978)
@@ -237,7 +237,7 @@
// The compiler should be smart enough to optimize out the inner if/else statement entirely
typename SpProxy<T1>::const_iterator_type it = pa.begin();
- uword new_n_nonzero;
+ uword new_n_nonzero = 0;
while(it != pa.end())
{
if(Proxy<T2>::prefer_at_accessor == false)
Modified: pkg/RcppArmadillo/man/RcppArmadillo-package.Rd
===================================================================
--- pkg/RcppArmadillo/man/RcppArmadillo-package.Rd 2012-11-15 18:18:37 UTC (rev 3977)
+++ pkg/RcppArmadillo/man/RcppArmadillo-package.Rd 2012-11-16 02:44:32 UTC (rev 3978)
@@ -13,7 +13,7 @@
\tabular{ll}{
Package: \tab RcppArmadillo\cr
Type: \tab Package\cr
- Version: \tab 0.3.4.3\cr
+ Version: \tab 0.3.4.4\cr
Date: \tab 2012-10-04\cr
License: \tab GPL (>= 2)\cr
LazyLoad: \tab yes\cr
More information about the Rcpp-commits
mailing list