[Rcpp-commits] r997 - in pkg: . RcppGSL/R RcppGSL/inst/include RcppGSL/inst/unitTests RcppGSL/man RcppGSL/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 6 01:52:43 CEST 2010


Author: edd
Date: 2010-04-06 01:52:43 +0200 (Tue, 06 Apr 2010)
New Revision: 997

Added:
   pkg/RcppGSL/
   pkg/RcppGSL/R/unit.test.R
   pkg/RcppGSL/inst/include/RcppGSL.h
   pkg/RcppGSL/inst/unitTests/runTests.R
   pkg/RcppGSL/inst/unitTests/runit.gsl.R
   pkg/RcppGSL/man/RcppGSL-package.Rd
   pkg/RcppGSL/src/RcppGSL.cpp
Removed:
   pkg/RcppGSL/R/unit.test.R
   pkg/RcppGSL/inst/include/RcppGsl.h
   pkg/RcppGSL/inst/unitTests/runTests.R
   pkg/RcppGSL/inst/unitTests/runit.gsl.R
   pkg/RcppGSL/man/RcppGsl-package.Rd
   pkg/RcppGSL/src/RcppGsl.cpp
Log:
also rename top-level directory

Copied: pkg/RcppGSL (from rev 995, pkg/RcppGsl)

Deleted: pkg/RcppGSL/R/unit.test.R
===================================================================
--- pkg/RcppGsl/R/unit.test.R	2010-04-05 22:36:48 UTC (rev 995)
+++ pkg/RcppGSL/R/unit.test.R	2010-04-05 23:52:43 UTC (rev 997)
@@ -1,29 +0,0 @@
-# Copyright (C)        2010 Romain Francois
-#
-# This file is part of RcppGsl.
-#
-# RcppGsl 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.
-#
-# RcppGsl 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 RcppGsl.  If not, see <http://www.gnu.org/licenses/>.
-
-test <- function( output = if( file.exists( "/tmp" ) ) "/tmp" else getwd() ){
-	if( !file.exists( output ) ){ stop( "output directory does not exist" ) }
-
-	Rscript <- file.path( R.home( component = "bin" ), "Rscript" )
-	if( .Platform$OS.type == "windows" ){
-		Rscript <- sprintf( "%s.exe", Rscript )
-	}
-	test.script <- system.file( "unitTests", "runTests.R", package = "RcppGSL" )
-	cmd <- sprintf( '"%s" "%s" --output=%s', Rscript, test.script, output )
-	system( cmd )
-}
-

Copied: pkg/RcppGSL/R/unit.test.R (from rev 996, pkg/RcppGsl/R/unit.test.R)
===================================================================
--- pkg/RcppGSL/R/unit.test.R	                        (rev 0)
+++ pkg/RcppGSL/R/unit.test.R	2010-04-05 23:52:43 UTC (rev 997)
@@ -0,0 +1,29 @@
+# Copyright (C)        2010 Romain Francois and Dirk Eddelbuettel
+#
+# This file is part of RcppGSL.
+#
+# RcppGSL 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.
+#
+# RcppGSL 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 RcppGSL.  If not, see <http://www.gnu.org/licenses/>.
+
+test <- function( output = if( file.exists( "/tmp" ) ) "/tmp" else getwd() ){
+	if( !file.exists( output ) ){ stop( "output directory does not exist" ) }
+
+	Rscript <- file.path( R.home( component = "bin" ), "Rscript" )
+	if( .Platform$OS.type == "windows" ){
+		Rscript <- sprintf( "%s.exe", Rscript )
+	}
+	test.script <- system.file( "unitTests", "runTests.R", package = "RcppGSL" )
+	cmd <- sprintf( '"%s" "%s" --output=%s', Rscript, test.script, output )
+	system( cmd )
+}
+

Copied: pkg/RcppGSL/inst/include/RcppGSL.h (from rev 996, pkg/RcppGsl/inst/include/RcppGSL.h)
===================================================================
--- pkg/RcppGSL/inst/include/RcppGSL.h	                        (rev 0)
+++ pkg/RcppGSL/inst/include/RcppGSL.h	2010-04-05 23:52:43 UTC (rev 997)
@@ -0,0 +1,51 @@
+// RcppGSL.h: Rcpp/GSL glue
+//
+// Copyright (C)  2010 Romain Francois and Dirk Eddelbuettel
+//
+// This file is part of RcppGSL.
+//
+// RcppGSL 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.
+//                           
+// RcppGSL 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 RcppGSL.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef RCPPGSL__RCPPGSL_H
+#define RCPPGSL__RCPPGSL_H
+
+#include <RcppCommon.h>
+#include <gsl/gsl_vector.h>
+
+/* forward declarations */
+namespace Rcpp{
+	template <> SEXP wrap( const gsl_vector& ) ;
+}
+
+/* implementations */
+#include <Rcpp.h>
+
+namespace Rcpp{
+	
+// namespace RcppGSL{
+// 
+// template <typename T> struct gsl_vector_type_traits ;
+// template <> struct gsl_vector_type_traits<gsl_vector> {
+// 	typedef double type ;
+// } ;
+// 
+// } // namespace RcppGSL
+
+template <> SEXP wrap( const gsl_vector& x){
+	return wrap( x.data, x.data + x.size ) ;
+}
+
+} 
+
+#endif

Deleted: pkg/RcppGSL/inst/include/RcppGsl.h
===================================================================
--- pkg/RcppGsl/inst/include/RcppGsl.h	2010-04-05 22:36:48 UTC (rev 995)
+++ pkg/RcppGSL/inst/include/RcppGsl.h	2010-04-05 23:52:43 UTC (rev 997)
@@ -1,51 +0,0 @@
-// RcppGsl.h: Rcpp/gsl glue
-//
-// Copyright (C)  2010 Romain Francois
-//
-// This file is part of RcppGsl.
-//
-// RcppGsl 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.
-//                           
-// RcppGsl 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 RcppGsl.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef RCPPGSL__RCPPGSL_H
-#define RCPPGSL__RCPPGSL_H
-
-#include <RcppCommon.h>
-#include <gsl/gsl_vector.h>
-
-/* forward declarations */
-namespace Rcpp{
-	template <> SEXP wrap( const gsl_vector& ) ;
-}
-
-/* implementations */
-#include <Rcpp.h>
-
-namespace Rcpp{
-	
-// namespace RcppGsl{
-// 
-// template <typename T> struct gsl_vector_type_traits ;
-// template <> struct gsl_vector_type_traits<gsl_vector> {
-// 	typedef double type ;
-// } ;
-// 
-// } // namespace RcppGsl
-
-template <> SEXP wrap( const gsl_vector& x){
-	return wrap( x.data, x.data + x.size ) ;
-}
-
-} 
-
-#endif

Deleted: pkg/RcppGSL/inst/unitTests/runTests.R
===================================================================
--- pkg/RcppGsl/inst/unitTests/runTests.R	2010-04-05 22:36:48 UTC (rev 995)
+++ pkg/RcppGSL/inst/unitTests/runTests.R	2010-04-05 23:52:43 UTC (rev 997)
@@ -1,88 +0,0 @@
-pkg <- "RcppGsl"
-
-if(require("RUnit", quietly = TRUE)) {
-
-    is_local <- function(){
-    	if( exists( "argv", globalenv() ) && "--local" %in% argv ) return(TRUE)
-    	if( "--local" %in% commandArgs(TRUE) ) return(TRUE)
-    	FALSE
-    }
-    if( is_local() ) path <- getwd()
-    
-    library(package=pkg, character.only = TRUE)
-    if(!(exists("path") && file.exists(path)))
-        path <- system.file("unitTests", package = pkg)
-
-    ## --- Testing ---
-
-    ## Define tests
-    testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs = path)
-
-    if(interactive()) {
-        cat("Now have RUnit Test Suite 'testSuite' for package '", pkg,
-            "' :\n", sep='')
-        str(testSuite)
-        cat('', "Consider doing",
-            "\t  tests <- runTestSuite(testSuite)", "\nand later",
-            "\t  printTextProtocol(tests)", '', sep="\n")
-    } else { ## run from shell / Rscript / R CMD Batch / ...
-        ## Run
-        tests <- runTestSuite(testSuite)
-        
-        output <- NULL
-        
-        process_args <- function(argv){
-        	if( !is.null(argv) && length(argv) > 0 ){
-        		rx <- "^--output=(.*)$"
-        		g  <- grep( rx, argv, value = TRUE )
-        		if( length(g) ){
-        			sub( rx, "\\1", g[1L] )
-        		}
-        	}
-        }
-        
-        # give a chance to the user to customize where he/she wants 
-        # the unit tests results to be stored with the --output= command 
-        # line argument
-        if( exists( "argv",  globalenv() ) ){
-        	# littler
-        	output <- process_args(argv)
-        } else {
-        	# Rscript
-        	output <- process_args(commandArgs(TRUE))
-        }
-        
-        # if it did not work, try to use /tmp
-        if( is.null(output) ){
-        	if( file.exists( "/tmp" ) ){
-        		output <- "/tmp"
-        	} else{
-        		output <- getwd()
-        	}
-        }
-        
-        ## Print results
-        output.txt  <- file.path( output, sprintf("%s-unitTests.txt", pkg))
-        output.html <- file.path( output, sprintf("%s-unitTests.html", pkg))
-       
-        printTextProtocol(tests, fileName=output.txt)
-        message( sprintf( "saving txt unit test report to '%s'", output.txt ) )
-        
-        ## Print HTML version to a file
-        ## printHTMLProtocol has problems on Mac OS X
-        if (Sys.info()["sysname"] != "Darwin"){
-        	message( sprintf( "saving html unit test report to '%s'", output.html ) )
-        	printHTMLProtocol(tests, fileName=output.html)
-        }
-
-        ##  stop() if there are any failures i.e. FALSE to unit test.
-        ## This will cause R CMD check to return error and stop
-        if(getErrors(tests)$nFail > 0) {
-            stop("one of the unit tests failed")
-        }
-    }
-} else {
-    cat("R package 'RUnit' cannot be loaded -- no unit tests run\n",
-    "for package", pkg,"\n")
-}
-

Copied: pkg/RcppGSL/inst/unitTests/runTests.R (from rev 996, pkg/RcppGsl/inst/unitTests/runTests.R)
===================================================================
--- pkg/RcppGSL/inst/unitTests/runTests.R	                        (rev 0)
+++ pkg/RcppGSL/inst/unitTests/runTests.R	2010-04-05 23:52:43 UTC (rev 997)
@@ -0,0 +1,88 @@
+pkg <- "RcppGSL"
+
+if(require("RUnit", quietly = TRUE)) {
+
+    is_local <- function(){
+    	if( exists( "argv", globalenv() ) && "--local" %in% argv ) return(TRUE)
+    	if( "--local" %in% commandArgs(TRUE) ) return(TRUE)
+    	FALSE
+    }
+    if( is_local() ) path <- getwd()
+
+    library(package=pkg, character.only = TRUE)
+    if(!(exists("path") && file.exists(path)))
+        path <- system.file("unitTests", package = pkg)
+
+    ## --- Testing ---
+
+    ## Define tests
+    testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs = path)
+
+    if(interactive()) {
+        cat("Now have RUnit Test Suite 'testSuite' for package '", pkg,
+            "' :\n", sep='')
+        str(testSuite)
+        cat('', "Consider doing",
+            "\t  tests <- runTestSuite(testSuite)", "\nand later",
+            "\t  printTextProtocol(tests)", '', sep="\n")
+    } else { ## run from shell / Rscript / R CMD Batch / ...
+        ## Run
+        tests <- runTestSuite(testSuite)
+
+        output <- NULL
+
+        process_args <- function(argv){
+        	if( !is.null(argv) && length(argv) > 0 ){
+        		rx <- "^--output=(.*)$"
+        		g  <- grep( rx, argv, value = TRUE )
+        		if( length(g) ){
+        			sub( rx, "\\1", g[1L] )
+        		}
+        	}
+        }
+
+        # give a chance to the user to customize where he/she wants
+        # the unit tests results to be stored with the --output= command
+        # line argument
+        if( exists( "argv",  globalenv() ) ){
+        	# littler
+        	output <- process_args(argv)
+        } else {
+        	# Rscript
+        	output <- process_args(commandArgs(TRUE))
+        }
+
+        # if it did not work, try to use /tmp
+        if( is.null(output) ){
+        	if( file.exists( "/tmp" ) ){
+        		output <- "/tmp"
+        	} else{
+        		output <- getwd()
+        	}
+        }
+
+        ## Print results
+        output.txt  <- file.path( output, sprintf("%s-unitTests.txt", pkg))
+        output.html <- file.path( output, sprintf("%s-unitTests.html", pkg))
+
+        printTextProtocol(tests, fileName=output.txt)
+        message( sprintf( "saving txt unit test report to '%s'", output.txt ) )
+
+        ## Print HTML version to a file
+        ## printHTMLProtocol has problems on Mac OS X
+        if (Sys.info()["sysname"] != "Darwin"){
+        	message( sprintf( "saving html unit test report to '%s'", output.html ) )
+        	printHTMLProtocol(tests, fileName=output.html)
+        }
+
+        ##  stop() if there are any failures i.e. FALSE to unit test.
+        ## This will cause R CMD check to return error and stop
+        if(getErrors(tests)$nFail > 0) {
+            stop("one of the unit tests failed")
+        }
+    }
+} else {
+    cat("R package 'RUnit' cannot be loaded -- no unit tests run\n",
+    "for package", pkg,"\n")
+}
+

Deleted: pkg/RcppGSL/inst/unitTests/runit.gsl.R
===================================================================
--- pkg/RcppGsl/inst/unitTests/runit.gsl.R	2010-04-05 22:36:48 UTC (rev 995)
+++ pkg/RcppGSL/inst/unitTests/runit.gsl.R	2010-04-05 23:52:43 UTC (rev 997)
@@ -1,24 +0,0 @@
-#!/usr/bin/r -t
-#
-# Copyright (C) 2010	Romain Francois
-#
-# This file is part of RcppGsl.
-#
-# RcppGsl 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.
-#
-# RcppGsl 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 RcppGsl.  If not, see <http://www.gnu.org/licenses/>.
-
-test.gsl.vector <- function(){
-	res <- .Call( "test_gsl_vector", PACKAGE = "RcppGsl" )
-	checkEquals( res, numeric(10) , msg = "wrap( gsl_vector )" )
-}
-

Copied: pkg/RcppGSL/inst/unitTests/runit.gsl.R (from rev 996, pkg/RcppGsl/inst/unitTests/runit.gsl.R)
===================================================================
--- pkg/RcppGSL/inst/unitTests/runit.gsl.R	                        (rev 0)
+++ pkg/RcppGSL/inst/unitTests/runit.gsl.R	2010-04-05 23:52:43 UTC (rev 997)
@@ -0,0 +1,24 @@
+#!/usr/bin/r -t
+#
+# Copyright (C) 2010	Romain Francois and Dirk Eddelbuettel
+#
+# This file is part of RcppGSL.
+#
+# RcppGSL 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.
+#
+# RcppGSL 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 RcppGSL.  If not, see <http://www.gnu.org/licenses/>.
+
+test.gsl.vector <- function(){
+	res <- .Call( "test_gsl_vector", PACKAGE = "RcppGSL" )
+	checkEquals( res, numeric(10) , msg = "wrap( gsl_vector )" )
+}
+

Copied: pkg/RcppGSL/man/RcppGSL-package.Rd (from rev 996, pkg/RcppGsl/man/RcppGSL-package.Rd)
===================================================================
--- pkg/RcppGSL/man/RcppGSL-package.Rd	                        (rev 0)
+++ pkg/RcppGSL/man/RcppGSL-package.Rd	2010-04-05 23:52:43 UTC (rev 997)
@@ -0,0 +1,30 @@
+\name{RcppGSL-package}
+\alias{RcppGSL-package}
+\alias{RcppGSL}
+\docType{package}
+\title{
+  Glue between Rcpp and the GNU GSL
+}
+\description{
+  Glue between Rcpp and the GNU GSL
+}
+\details{
+  \tabular{ll}{
+	Package: \tab RcppGSL\cr
+	Type: \tab Package\cr
+	Version: \tab 0.0\cr
+	Date: \tab 2010-04-04\cr
+	License: \tab GPL (>= 2)\cr
+	LazyLoad: \tab yes\cr
+  }
+}
+\author{
+  Romain Francois and Dirk Eddelbuettel
+
+  Maintainer: Dirk Eddelbuettel and Romain Francois <RomainAndDirk at r-enthusiasts.com>
+}
+\references{
+  GSL: GNU Scientific Library: \url{http://www.gnu.org/software/gsl/}
+}
+\keyword{ package }
+

Deleted: pkg/RcppGSL/man/RcppGsl-package.Rd
===================================================================
--- pkg/RcppGsl/man/RcppGsl-package.Rd	2010-04-05 22:36:48 UTC (rev 995)
+++ pkg/RcppGSL/man/RcppGsl-package.Rd	2010-04-05 23:52:43 UTC (rev 997)
@@ -1,30 +0,0 @@
-\name{RcppGsl-package}
-\alias{RcppGsl-package}
-\alias{RcppGsl}
-\docType{package}
-\title{
-glue between Rcpp and gsl
-}
-\description{
-glue between Rcpp and gsl
-}
-\details{
-\tabular{ll}{
-Package: \tab RcppGsl\cr
-Type: \tab Package\cr
-Version: \tab 0.0\cr
-Date: \tab 2010-04-04\cr
-License: \tab GPL (>= 2)\cr
-LazyLoad: \tab yes\cr
-}
-}
-\author{
- Romain Francois
-
-Maintainer: Romain Francois <romain at r-enthusiasts.com>
-}
-\references{
-	GSL: Gnu scientific library: \url{http://www.gnu.org/software/gsl/}
-}
-\keyword{ package }
-

Copied: pkg/RcppGSL/src/RcppGSL.cpp (from rev 996, pkg/RcppGsl/src/RcppGSL.cpp)
===================================================================
--- pkg/RcppGSL/src/RcppGSL.cpp	                        (rev 0)
+++ pkg/RcppGSL/src/RcppGSL.cpp	2010-04-05 23:52:43 UTC (rev 997)
@@ -0,0 +1,15 @@
+#include <RcppGSL.h>
+
+extern "C" SEXP test_gsl_vector(){
+	gsl_vector * x = gsl_vector_alloc (10);
+	gsl_vector_set_zero( x ) ;
+	
+	// we cannot have Rcpp::NumericVector xx = x ; 
+	// because this does not involve the assignment operator
+	// but the constructor and Vector only had templated assignement
+	// operator, not templated constructor, so we have to do this in two steps
+	Rcpp::NumericVector xx ;
+	xx = *x  ;
+	gsl_vector_free (x);
+	return xx ;
+}

Deleted: pkg/RcppGSL/src/RcppGsl.cpp
===================================================================
--- pkg/RcppGsl/src/RcppGsl.cpp	2010-04-05 22:36:48 UTC (rev 995)
+++ pkg/RcppGSL/src/RcppGsl.cpp	2010-04-05 23:52:43 UTC (rev 997)
@@ -1,15 +0,0 @@
-#include <RcppGsl.h>
-
-extern "C" SEXP test_gsl_vector(){
-	gsl_vector * x = gsl_vector_alloc (10);
-	gsl_vector_set_zero( x ) ;
-	
-	// we cannot have Rcpp::NumericVector xx = x ; 
-	// because this does not involve the assignment operator
-	// but the constructor and Vector only had templated assignement
-	// operator, not templated constructor, so we have to do this in two steps
-	Rcpp::NumericVector xx ;
-	xx = *x  ;
-	gsl_vector_free (x);
-	return xx ;
-}



More information about the Rcpp-commits mailing list