[Rcpp-commits] r1015 - in pkg/RcppGSL: inst/include inst/unitTests src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 6 13:59:49 CEST 2010


Author: romain
Date: 2010-04-06 13:59:49 +0200 (Tue, 06 Apr 2010)
New Revision: 1015

Modified:
   pkg/RcppGSL/inst/include/RcppGSL.h
   pkg/RcppGSL/inst/include/RcppGSLForward.h
   pkg/RcppGSL/inst/unitTests/runit.gsl.R
   pkg/RcppGSL/src/RcppGSL.cpp
Log:
all gsl_vector_* covered

Modified: pkg/RcppGSL/inst/include/RcppGSL.h
===================================================================
--- pkg/RcppGSL/inst/include/RcppGSL.h	2010-04-06 11:52:29 UTC (rev 1014)
+++ pkg/RcppGSL/inst/include/RcppGSL.h	2010-04-06 11:59:49 UTC (rev 1015)
@@ -110,6 +110,26 @@
 	return wrap( x.data, x.data + x.size ) ;
 }
 
+template <> SEXP wrap( const gsl_vector_short& x){
+	return wrap( x.data, x.data + x.size ) ;
+}
+
+template <> SEXP wrap( const gsl_vector_uchar& x){
+	return wrap( x.data, x.data + x.size ) ;
+}
+
+template <> SEXP wrap( const gsl_vector_uint& x){
+	return wrap( x.data, x.data + x.size ) ;
+}
+
+template <> SEXP wrap( const gsl_vector_ushort& x){
+	return wrap( x.data, x.data + x.size ) ;
+}
+
+template <> SEXP wrap( const gsl_vector_ulong& x){
+	return wrap( x.data, x.data + x.size ) ;
+}
+
 } 
 
 #endif

Modified: pkg/RcppGSL/inst/include/RcppGSLForward.h
===================================================================
--- pkg/RcppGSL/inst/include/RcppGSLForward.h	2010-04-06 11:52:29 UTC (rev 1014)
+++ pkg/RcppGSL/inst/include/RcppGSLForward.h	2010-04-06 11:59:49 UTC (rev 1015)
@@ -68,6 +68,11 @@
 	template <> SEXP wrap( const gsl_vector_complex_float& ) ;
 	template <> SEXP wrap( const gsl_vector_complex_long_double& ) ;
 	template <> SEXP wrap( const gsl_vector_long_double& ) ;
+	template <> SEXP wrap( const gsl_vector_short& ) ;
+	template <> SEXP wrap( const gsl_vector_uchar& ) ;
+	template <> SEXP wrap( const gsl_vector_uint& ) ;
+	template <> SEXP wrap( const gsl_vector_ushort& ) ;
+	template <> SEXP wrap( const gsl_vector_ulong& ) ;
 	
 }
 

Modified: pkg/RcppGSL/inst/unitTests/runit.gsl.R
===================================================================
--- pkg/RcppGSL/inst/unitTests/runit.gsl.R	2010-04-06 11:52:29 UTC (rev 1014)
+++ pkg/RcppGSL/inst/unitTests/runit.gsl.R	2010-04-06 11:59:49 UTC (rev 1015)
@@ -28,7 +28,13 @@
 			"gsl_vector_char" = raw(10), 
 			"gsl_vector_complex" = complex(10), 
 			"gsl_vector_complex_float" = complex(10), 
-			"gsl_vector_complex_long_double" = complex(10)
+			"gsl_vector_complex_long_double" = complex(10), 
+			"gsl_vector_long_double" = numeric(10), 
+			"gsl_vector_short" = integer(10), 
+			"gsl_vector_uchar" = raw(10), 
+			"gsl_vector_uint" = integer(10), 
+			"gsl_vector_ushort" = integer(10), 
+			"gsl_vector_ulong" = numeric(10)
 		), 
 		msg = "wrap( gsl_vector )" )
 }

Modified: pkg/RcppGSL/src/RcppGSL.cpp
===================================================================
--- pkg/RcppGSL/src/RcppGSL.cpp	2010-04-06 11:52:29 UTC (rev 1014)
+++ pkg/RcppGSL/src/RcppGSL.cpp	2010-04-06 11:59:49 UTC (rev 1015)
@@ -11,6 +11,12 @@
 	gsl_vector_complex * x_complex  = gsl_vector_complex_calloc(10) ;
 	gsl_vector_complex_float * x_complex_float  = gsl_vector_complex_float_calloc(10) ;
 	gsl_vector_complex_long_double * x_complex_long_double  = gsl_vector_complex_long_double_calloc(10) ;
+	gsl_vector_long_double * x_long_double  = gsl_vector_long_double_calloc(10) ;
+	gsl_vector_short * x_short  = gsl_vector_short_calloc(10) ;
+	gsl_vector_uchar * x_uchar  = gsl_vector_uchar_calloc(10) ;
+	gsl_vector_uint * x_uint  = gsl_vector_uint_calloc(10) ;
+	gsl_vector_ushort * x_ushort  = gsl_vector_ushort_calloc(10) ;
+	gsl_vector_ulong * x_ulong  = gsl_vector_ulong_calloc(10) ;
 	
 	/* create an R list containing copies of gsl data */
 	List res = List::create( 
@@ -21,7 +27,13 @@
 		_["gsl_vector_char"] = *x_char, 
 		_["gsl_vector_complex"] = *x_complex,
 		_["gsl_vector_complex_float"] = *x_complex_float, 
-		_["gsl_vector_complex_long_double"] = *x_complex_long_double
+		_["gsl_vector_complex_long_double"] = *x_complex_long_double, 
+		_["gsl_vector_long_double"] = *x_long_double, 
+		_["gsl_vector_short"] = *x_short, 
+		_["gsl_vector_uchar"] = *x_uchar, 
+		_["gsl_vector_uint"] = *x_uint, 
+		_["gsl_vector_ushort"] = *x_ushort, 
+		_["gsl_vector_ulong"] = *x_ulong
 		) ;
 	
 	/* cleanup gsl data */
@@ -33,6 +45,12 @@
 	gsl_vector_complex_free( x_complex );
 	gsl_vector_complex_float_free( x_complex_float );
 	gsl_vector_complex_long_double_free( x_complex_long_double );
+	gsl_vector_long_double_free( x_long_double );
+	gsl_vector_short_free( x_short );
+	gsl_vector_uchar_free( x_uchar );
+	gsl_vector_uint_free( x_uint );
+	gsl_vector_ushort_free( x_ushort );
+	gsl_vector_ulong_free( x_ulong );
 	
 	return res ;
 }



More information about the Rcpp-commits mailing list