[Rcpp-commits] r991 - pkg/RcppArmadillo/inst/include

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 5 18:45:59 CEST 2010


Author: romain
Date: 2010-04-05 18:45:59 +0200 (Mon, 05 Apr 2010)
New Revision: 991

Added:
   pkg/RcppArmadillo/inst/include/RcppArmadilloForward.h
Modified:
   pkg/RcppArmadillo/inst/include/RcppArmadillo.h
Log:
separate forward declarations from the implementations

Modified: pkg/RcppArmadillo/inst/include/RcppArmadillo.h
===================================================================
--- pkg/RcppArmadillo/inst/include/RcppArmadillo.h	2010-04-05 16:36:34 UTC (rev 990)
+++ pkg/RcppArmadillo/inst/include/RcppArmadillo.h	2010-04-05 16:45:59 UTC (rev 991)
@@ -22,63 +22,9 @@
 #ifndef RcppArmadillo__RcppArmadillo__h
 #define RcppArmadillo__RcppArmadillo__h
 
-#include <RcppCommon.h>
-#include <armadillo>
-
-/* forward declarations */
-namespace Rcpp {
-    /* support for wrap */
-    template <typename T> SEXP wrap ( const arma::Mat<T>& ) ;
-    template <typename T> SEXP wrap ( const arma::Row<T>& ) ;
-    template <typename T> SEXP wrap ( const arma::Col<T>& ) ;
-    template <typename T> SEXP wrap ( const arma::field<T>& ) ;
-    template <typename T> SEXP wrap ( const arma::Cube<T>& ) ;
-    
-    template <typename T1, typename T2, typename glue_type> 
-    SEXP wrap(const arma::Glue<T1, T2, glue_type>& X ) ;
-    
-    template <typename T1, typename op_type>
-    SEXP wrap(const arma::Op<T1, op_type>& X ) ;
-    
-    template <typename T1, typename T2, typename glue_type> 
-    SEXP wrap(const arma::eGlue<T1, T2, glue_type>& X ) ;
-    
-    template <typename T1, typename op_type>
-    SEXP wrap(const arma::eOp<T1, op_type>& X ) ;
-    
-    /* TODO: maybe we can move those out of if( 0.9.0 ) */
-    template <typename T1, typename op_type>
-    SEXP wrap(const arma::OpCube<T1,op_type>& X ) ;
-    
-    template <typename T1, typename T2, typename glue_type>
-    SEXP wrap(const arma::GlueCube<T1,T2,glue_type>& X ) ;
-    
-    template <typename T1, typename op_type>
-    SEXP wrap(const arma::eOpCube<T1,op_type>& X ) ;
-    
-    template <typename T1, typename T2, typename glue_type>
-    SEXP wrap(const arma::eGlueCube<T1,T2,glue_type>& X ) ;
-    
-    namespace traits {
-
-	/* support for as */
-	template <typename T> class Exporter< arma::Mat<T> > ;
-	template <typename T> class Exporter< arma::Row<T> > ;
-	template <typename T> class Exporter< arma::Col<T> > ;
-// template <typename T> class Exporter< arma::field<T> > ;
-// template <typename T> class Exporter< arma::Cube<T> > ;
-
-    } // namespace traits 
-
-}
-
+#include <RcppArmadilloForward.h>
 #include <Rcpp.h>
 
-RcppExport SEXP RcppArmadilloExample() ;
-RcppExport SEXP RcppArmadilloExample_as_Mat( SEXP );
-RcppExport SEXP RcppArmadilloExample_as_Col( SEXP );
-RcppExport SEXP RcppArmadilloExample_as_Row( SEXP );
-
 namespace Rcpp{
 
     namespace RcppArmadillo{

Added: pkg/RcppArmadillo/inst/include/RcppArmadilloForward.h
===================================================================
--- pkg/RcppArmadillo/inst/include/RcppArmadilloForward.h	                        (rev 0)
+++ pkg/RcppArmadillo/inst/include/RcppArmadilloForward.h	2010-04-05 16:45:59 UTC (rev 991)
@@ -0,0 +1,74 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// RcppArmadilloForward.h: Rcpp/Armadillo glue
+//
+// Copyright (C)  2010 Dirk Eddelbuettel, Romain Francois and Douglas Bates
+//
+// This file is part of RcppArmadillo.
+//
+// RcppArmadillo is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// RcppArmadillo is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RcppArmadillo.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef RcppArmadillo__RcppArmadilloForward__h
+#define RcppArmadillo__RcppArmadilloForward__h
+
+#include <RcppCommon.h>
+#include <armadillo>
+
+/* forward declarations */
+namespace Rcpp {
+    /* support for wrap */
+    template <typename T> SEXP wrap ( const arma::Mat<T>& ) ;
+    template <typename T> SEXP wrap ( const arma::Row<T>& ) ;
+    template <typename T> SEXP wrap ( const arma::Col<T>& ) ;
+    template <typename T> SEXP wrap ( const arma::field<T>& ) ;
+    template <typename T> SEXP wrap ( const arma::Cube<T>& ) ;
+    
+    template <typename T1, typename T2, typename glue_type> 
+    SEXP wrap(const arma::Glue<T1, T2, glue_type>& X ) ;
+    
+    template <typename T1, typename op_type>
+    SEXP wrap(const arma::Op<T1, op_type>& X ) ;
+    
+    template <typename T1, typename T2, typename glue_type> 
+    SEXP wrap(const arma::eGlue<T1, T2, glue_type>& X ) ;
+    
+    template <typename T1, typename op_type>
+    SEXP wrap(const arma::eOp<T1, op_type>& X ) ;
+    
+    template <typename T1, typename op_type>
+    SEXP wrap(const arma::OpCube<T1,op_type>& X ) ;
+    
+    template <typename T1, typename T2, typename glue_type>
+    SEXP wrap(const arma::GlueCube<T1,T2,glue_type>& X ) ;
+    
+    template <typename T1, typename op_type>
+    SEXP wrap(const arma::eOpCube<T1,op_type>& X ) ;
+    
+    template <typename T1, typename T2, typename glue_type>
+    SEXP wrap(const arma::eGlueCube<T1,T2,glue_type>& X ) ;
+    
+    namespace traits {
+
+	/* support for as */
+	template <typename T> class Exporter< arma::Mat<T> > ;
+	template <typename T> class Exporter< arma::Row<T> > ;
+	template <typename T> class Exporter< arma::Col<T> > ;
+// template <typename T> class Exporter< arma::field<T> > ;
+// template <typename T> class Exporter< arma::Cube<T> > ;
+
+    } // namespace traits 
+
+}
+
+#endif



More information about the Rcpp-commits mailing list