[Rcpp-commits] r3578 - in pkg/RcppArmadillo: . inst inst/include/armadillo_bits
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Apr 19 16:53:39 CEST 2012
Author: edd
Date: 2012-04-19 16:53:39 +0200 (Thu, 19 Apr 2012)
New Revision: 3578
Modified:
pkg/RcppArmadillo/ChangeLog
pkg/RcppArmadillo/DESCRIPTION
pkg/RcppArmadillo/inst/NEWS
pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
pkg/RcppArmadillo/inst/include/armadillo_bits/diagmat_proxy.hpp
Log:
RcppArmadillo 0.3.0.2 with Armadillo 3.0.2
Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog 2012-04-19 01:06:41 UTC (rev 3577)
+++ pkg/RcppArmadillo/ChangeLog 2012-04-19 14:53:39 UTC (rev 3578)
@@ -1,3 +1,9 @@
+2012-04-19 Dirk Eddelbuettel <edd at debian.org>
+
+ * DESCRIPTION: Release 0.3.0.2
+
+ * inst/include/*: Upgraded to new release 3.0.2 of Armadillo
+
2012-04-17 Dirk Eddelbuettel <edd at debian.org>
* inst/include/RcppArmadilloConfig.h: Undefine NDEBUG to not suppress
Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION 2012-04-19 01:06:41 UTC (rev 3577)
+++ pkg/RcppArmadillo/DESCRIPTION 2012-04-19 14:53:39 UTC (rev 3578)
@@ -1,7 +1,7 @@
Package: RcppArmadillo
Type: Package
Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.3.0.1.1
+Version: 0.3.0.2
Date: $Date$
Author: Romain Francois, Dirk Eddelbuettel and Doug Bates
Maintainer: Romain Francois, Dirk Eddelbuettel and Doug Bates <RcppArmadillo-authors at r-enthusiasts.com>
@@ -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.0.1). Thus users do not need to
+ Armadillo library (currently version 3.0.2). 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
===================================================================
--- pkg/RcppArmadillo/inst/NEWS 2012-04-19 01:06:41 UTC (rev 3577)
+++ pkg/RcppArmadillo/inst/NEWS 2012-04-19 14:53:39 UTC (rev 3578)
@@ -1,5 +1,9 @@
-0.3.0.2 2012-xx-yy
+0.3.0.2 2012-04-19
+ o Upgraded to Armadillo release 3.0.2
+
+ * fixes for handling diagonal matrices
+
o Undefine NDEBUG if it has been set (as R does) as this prevents a
number of useful debugging checks. Users can still define it or
define ARMA_NO_DEBUG if they want a 'non-development' build
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp 2012-04-19 01:06:41 UTC (rev 3577)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp 2012-04-19 14:53:39 UTC (rev 3578)
@@ -18,7 +18,7 @@
#define ARMA_VERSION_MAJOR 3
#define ARMA_VERSION_MINOR 0
-#define ARMA_VERSION_PATCH 1
+#define ARMA_VERSION_PATCH 2
#define ARMA_VERSION_NAME "Antarctic Chilli Ranch"
Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/diagmat_proxy.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/diagmat_proxy.hpp 2012-04-19 01:06:41 UTC (rev 3577)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/diagmat_proxy.hpp 2012-04-19 14:53:39 UTC (rev 3578)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2011 Conrad Sanderson
+// Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2012 Conrad Sanderson
//
// This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness
@@ -24,9 +24,10 @@
typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
- inline diagmat_proxy(const Base<typename T1::elem_type,T1>& X)
- : P ( X.get_ref() )
+ inline diagmat_proxy(const T1& X)
+ : P ( X )
, P_is_vec( (P.get_n_rows() == 1) || (P.get_n_cols() == 1) )
+ , P_is_col( P.get_n_cols() == 1 )
, n_elem ( P_is_vec ? P.get_n_elem() : (std::min)(P.get_n_elem(), P.get_n_rows()) )
{
arma_extra_debug_sigprint();
@@ -43,13 +44,20 @@
elem_type
operator[](const uword i) const
{
- if( (Proxy<T1>::prefer_at_accessor == true) || (P_is_vec == false) )
+ if(Proxy<T1>::prefer_at_accessor == false)
{
- return P.at(i,i);
+ return P_is_vec ? P[i] : P.at(i,i);
}
else
{
- return P[i];
+ if(P_is_vec)
+ {
+ return (P_is_col) ? P.at(i,0) : P.at(0,i);
+ }
+ else
+ {
+ return P.at(i,i);
+ }
}
}
@@ -60,13 +68,20 @@
{
if(row == col)
{
- if( (Proxy<T1>::prefer_at_accessor == true) || (P_is_vec == false) )
+ if(Proxy<T1>::prefer_at_accessor == false)
{
- return P.at(row,row);
+ return (P_is_vec) ? P[row] : P.at(row,row);
}
else
{
- return P[row];
+ if(P_is_vec)
+ {
+ return (P_is_col) ? P.at(row,0) : P.at(0,row);
+ }
+ else
+ {
+ return P.at(row,row);
+ }
}
}
else
@@ -78,6 +93,7 @@
const Proxy<T1> P;
const bool P_is_vec;
+ const bool P_is_col;
const uword n_elem;
};
@@ -183,8 +199,8 @@
typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
- inline diagmat_proxy_check(const Base<typename T1::elem_type,T1>& X, const Mat<typename T1::elem_type>& out)
- : P(X.get_ref())
+ inline diagmat_proxy_check(const T1& X, const Mat<typename T1::elem_type>& out)
+ : P(X)
, P_is_vec( (P.n_rows == 1) || (P.n_cols == 1) )
, n_elem( P_is_vec ? P.n_elem : (std::min)(P.n_elem, P.n_rows) )
{
More information about the Rcpp-commits
mailing list