[Rcpp-commits] r1608 - in pkg/Rcpp/inst/include/Rcpp/sugar: . functions

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 18 16:08:45 CEST 2010


Author: romain
Date: 2010-06-18 16:08:45 +0200 (Fri, 18 Jun 2010)
New Revision: 1608

Added:
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/all.h
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/any.h
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/functions.h
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/is_na.h
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/seq_along.h
Removed:
   pkg/Rcpp/inst/include/Rcpp/sugar/all.h
   pkg/Rcpp/inst/include/Rcpp/sugar/any.h
   pkg/Rcpp/inst/include/Rcpp/sugar/is_na.h
   pkg/Rcpp/inst/include/Rcpp/sugar/seq_along.h
Modified:
   pkg/Rcpp/inst/include/Rcpp/sugar/sugar.h
Log:
moving functions to the functions directory

Deleted: pkg/Rcpp/inst/include/Rcpp/sugar/all.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/all.h	2010-06-18 14:05:59 UTC (rev 1607)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/all.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -1,85 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// all.h: Rcpp R/C++ interface class library -- all
-//
-// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
-//
-// This file is part of Rcpp.
-//
-// Rcpp 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.
-//
-// Rcpp 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 Rcpp.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef Rcpp__sugar__all_h
-#define Rcpp__sugar__all_h
-
-namespace Rcpp{
-namespace sugar{
-
-template <typename T>
-class All : public SingleLogicalResult< All<T> >{
-public:
-	typedef SingleLogicalResult< All<T> > PARENT ;
-	All( const T& t ) : PARENT() , object(t) {}
-	
-	void apply(){
-		apply__impl( typename can_have_na<T>::type() ) ;
-	}	
-private:		
-	const T& object ;
-
-	// version that takes NA into account
-	void apply__impl( Rcpp::traits::true_type ){
-		int n = object.size() ;
-		int current = 0 ;
-		PARENT::reset() ;
-		for( int i=0 ; i<n ; i++){
-			current = object[i] ;
-			if( current == FALSE ) {
-				PARENT::set_false() ; 
-				return ;
-			}
-			if( Rcpp::traits::is_na<LGLSXP>(current)  ) {
-				PARENT::set_na();
-			}
-		}
-		if( PARENT::is_unresolved() ){
-			PARENT::set_true() ;
-		}
-	}
-	
-	// version to use when we know there is no NA
-	void apply__impl( Rcpp::traits::false_type ){
-		int n = object.size() ;
-		PARENT::set_true() ;
-		for( int i=0 ; i<n ; i++){
-			if( object[i] == TRUE ) {
-				PARENT::set_false() ; 
-				return ;
-			}
-		}
-	}
-	
-	
-private:
-} ;
-
-} // sugar
-
-template <typename T>
-inline sugar::All<T> all( const T& t){
-	return sugar::All<T>( t ) ;
-}
-
-} // Rcpp
-#endif
-

Deleted: pkg/Rcpp/inst/include/Rcpp/sugar/any.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/any.h	2010-06-18 14:05:59 UTC (rev 1607)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/any.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -1,85 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// any.h: Rcpp R/C++ interface class library -- any
-//
-// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
-//
-// This file is part of Rcpp.
-//
-// Rcpp 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.
-//
-// Rcpp 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 Rcpp.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef Rcpp__sugar__any_h
-#define Rcpp__sugar__any_h
-
-namespace Rcpp{
-namespace sugar{
-
-template <typename T>
-class Any : public SingleLogicalResult< Any<T> >{
-public:
-	typedef SingleLogicalResult< Any<T> > PARENT ;
-	Any( const T& t ) : PARENT() , object(t) {}
-	
-	void apply(){
-		apply__impl( typename can_have_na<T>::type() ) ;
-	}	
-private:		
-	const T& object ;
-
-	// version that takes NA into account
-	void apply__impl( Rcpp::traits::true_type ){
-		int n = object.size() ;
-		int current = 0 ;
-		PARENT::reset() ;
-		for( int i=0 ; i<n ; i++){
-			current = object[i] ;
-			if( current == TRUE ) {
-				PARENT::set_true() ; 
-				return ;
-			}
-			if( Rcpp::traits::is_na<LGLSXP>(current)  ) {
-				PARENT::set_na();
-			}
-		}
-		if( PARENT::is_unresolved() ){
-			PARENT::set_false() ;
-		}
-	}
-	
-	// version to use when we know there is no NA
-	void apply__impl( Rcpp::traits::false_type ){
-		int n = object.size() ;
-		PARENT::set_false() ;
-		for( int i=0 ; i<n ; i++){
-			if( object[i] == TRUE ) {
-				PARENT::set_true() ; 
-				return ;
-			}
-		}
-	}
-	
-	
-private:
-} ;
-
-} // sugar
-
-template <typename T>
-inline sugar::Any<T> any( const T& t){
-	return sugar::Any<T>( t ) ;
-}
-
-} // Rcpp
-#endif
-

Copied: pkg/Rcpp/inst/include/Rcpp/sugar/functions/all.h (from rev 1602, pkg/Rcpp/inst/include/Rcpp/sugar/all.h)
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/all.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/all.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -0,0 +1,85 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// all.h: Rcpp R/C++ interface class library -- all
+//
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of Rcpp.
+//
+// Rcpp 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.
+//
+// Rcpp 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 Rcpp.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef Rcpp__sugar__all_h
+#define Rcpp__sugar__all_h
+
+namespace Rcpp{
+namespace sugar{
+
+template <typename T>
+class All : public SingleLogicalResult< All<T> >{
+public:
+	typedef SingleLogicalResult< All<T> > PARENT ;
+	All( const T& t ) : PARENT() , object(t) {}
+	
+	void apply(){
+		apply__impl( typename can_have_na<T>::type() ) ;
+	}	
+private:		
+	const T& object ;
+
+	// version that takes NA into account
+	void apply__impl( Rcpp::traits::true_type ){
+		int n = object.size() ;
+		int current = 0 ;
+		PARENT::reset() ;
+		for( int i=0 ; i<n ; i++){
+			current = object[i] ;
+			if( current == FALSE ) {
+				PARENT::set_false() ; 
+				return ;
+			}
+			if( Rcpp::traits::is_na<LGLSXP>(current)  ) {
+				PARENT::set_na();
+			}
+		}
+		if( PARENT::is_unresolved() ){
+			PARENT::set_true() ;
+		}
+	}
+	
+	// version to use when we know there is no NA
+	void apply__impl( Rcpp::traits::false_type ){
+		int n = object.size() ;
+		PARENT::set_true() ;
+		for( int i=0 ; i<n ; i++){
+			if( object[i] == TRUE ) {
+				PARENT::set_false() ; 
+				return ;
+			}
+		}
+	}
+	
+	
+private:
+} ;
+
+} // sugar
+
+template <typename T>
+inline sugar::All<T> all( const T& t){
+	return sugar::All<T>( t ) ;
+}
+
+} // Rcpp
+#endif
+

Copied: pkg/Rcpp/inst/include/Rcpp/sugar/functions/any.h (from rev 1602, pkg/Rcpp/inst/include/Rcpp/sugar/any.h)
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/any.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/any.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -0,0 +1,85 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// any.h: Rcpp R/C++ interface class library -- any
+//
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of Rcpp.
+//
+// Rcpp 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.
+//
+// Rcpp 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 Rcpp.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef Rcpp__sugar__any_h
+#define Rcpp__sugar__any_h
+
+namespace Rcpp{
+namespace sugar{
+
+template <typename T>
+class Any : public SingleLogicalResult< Any<T> >{
+public:
+	typedef SingleLogicalResult< Any<T> > PARENT ;
+	Any( const T& t ) : PARENT() , object(t) {}
+	
+	void apply(){
+		apply__impl( typename can_have_na<T>::type() ) ;
+	}	
+private:		
+	const T& object ;
+
+	// version that takes NA into account
+	void apply__impl( Rcpp::traits::true_type ){
+		int n = object.size() ;
+		int current = 0 ;
+		PARENT::reset() ;
+		for( int i=0 ; i<n ; i++){
+			current = object[i] ;
+			if( current == TRUE ) {
+				PARENT::set_true() ; 
+				return ;
+			}
+			if( Rcpp::traits::is_na<LGLSXP>(current)  ) {
+				PARENT::set_na();
+			}
+		}
+		if( PARENT::is_unresolved() ){
+			PARENT::set_false() ;
+		}
+	}
+	
+	// version to use when we know there is no NA
+	void apply__impl( Rcpp::traits::false_type ){
+		int n = object.size() ;
+		PARENT::set_false() ;
+		for( int i=0 ; i<n ; i++){
+			if( object[i] == TRUE ) {
+				PARENT::set_true() ; 
+				return ;
+			}
+		}
+	}
+	
+	
+private:
+} ;
+
+} // sugar
+
+template <typename T>
+inline sugar::Any<T> any( const T& t){
+	return sugar::Any<T>( t ) ;
+}
+
+} // Rcpp
+#endif
+

Added: pkg/Rcpp/inst/include/Rcpp/sugar/functions/functions.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/functions.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/functions.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -0,0 +1,30 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// functions.h: Rcpp R/C++ interface class library -- sugar functions
+//
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of Rcpp.
+//
+// Rcpp 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.
+//
+// Rcpp 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 Rcpp.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef RCPP_SUGAR_FUNCTIONS_H
+#define RCPP_SUGAR_FUNCTIONS_H
+
+#include <Rcpp/sugar/functions/any.h>
+#include <Rcpp/sugar/functions/all.h>
+#include <Rcpp/sugar/functions/is_na.h>
+#include <Rcpp/sugar/functions/seq_along.h>
+
+#endif

Copied: pkg/Rcpp/inst/include/Rcpp/sugar/functions/is_na.h (from rev 1602, pkg/Rcpp/inst/include/Rcpp/sugar/is_na.h)
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/is_na.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/is_na.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -0,0 +1,79 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// any.h: Rcpp R/C++ interface class library -- any
+//
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of Rcpp.
+//
+// Rcpp 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.
+//
+// Rcpp 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 Rcpp.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef Rcpp__sugar__is_na_h
+#define Rcpp__sugar__is_na_h
+
+namespace Rcpp{
+namespace sugar{
+
+template <int RTYPE, bool _NA_, typename VEC_TYPE>
+class IsNa : public ::Rcpp::VectorBase< LGLSXP, false, IsNa<RTYPE,_NA_,VEC_TYPE> > {
+public:
+	typedef typename traits::storage_type<RTYPE>::type STORAGE ;
+	typedef Rcpp::VectorBase<RTYPE,_NA_,VEC_TYPE> BASE ;
+	
+	IsNa( const BASE& obj_) : obj(obj_){}
+	
+	inline int operator[]( int i ) const {
+		return ::Rcpp::traits::is_na<RTYPE>( obj[i] ) ;
+	}
+	
+	inline int size() const { return obj.size() ; }
+	         
+private:
+	const BASE& obj ;
+	
+} ;
+      
+// specialization for the case where we already know
+// the result (FALSE) because it is embedded in the type
+// (the second template parameter of VectorBase)
+template <int RTYPE, typename VEC_TYPE>
+class IsNa<RTYPE,false,VEC_TYPE> : public ::Rcpp::VectorBase< LGLSXP, false, IsNa<RTYPE,false,VEC_TYPE> > {
+public:
+	typedef typename traits::storage_type<RTYPE>::type STORAGE ;
+	typedef Rcpp::VectorBase<RTYPE,false,VEC_TYPE> BASE ;
+	
+	IsNa( const BASE& obj_) : obj(obj_){}
+	
+	inline int operator[]( int i ) const {
+		return FALSE ;
+	}
+	
+	inline int size() const { return obj.size() ; }
+	
+private:
+	const BASE& obj ;
+	
+} ;
+
+	
+} // sugar
+
+template <int RTYPE, bool _NA_, typename T>
+inline sugar::IsNa<RTYPE,_NA_,T> is_na( const Rcpp::VectorBase<RTYPE,_NA_,T>& t){
+	return sugar::IsNa<RTYPE,_NA_,T>( t ) ;
+}
+
+} // Rcpp
+#endif
+

Copied: pkg/Rcpp/inst/include/Rcpp/sugar/functions/seq_along.h (from rev 1602, pkg/Rcpp/inst/include/Rcpp/sugar/seq_along.h)
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/seq_along.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/seq_along.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -0,0 +1,56 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// seq_along.h: Rcpp R/C++ interface class library -- any
+//
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of Rcpp.
+//
+// Rcpp 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.
+//
+// Rcpp 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 Rcpp.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef Rcpp__sugar__seq_along_h
+#define Rcpp__sugar__seq_along_h
+
+namespace Rcpp{
+namespace sugar{
+
+class SeqLen : public VectorBase< INTSXP,false,SeqLen > {
+public:
+	SeqLen( int len_ ) : len(len_){}
+	
+	inline int operator[]( int i ) const {
+		return 1 + i ;
+	}
+	inline int size() const { return len ; }
+	         
+private:
+	int len ;
+} ;
+	
+} // sugar
+
+template <int RTYPE, bool _NA_, typename T>
+inline sugar::SeqLen seq_along( const Rcpp::VectorBase<RTYPE,_NA_,T>& t){
+	return sugar::SeqLen( t.size() ) ;
+}
+
+inline sugar::SeqLen seq_len( const size_t& n){
+	return sugar::SeqLen( n ) ;
+}
+
+
+
+} // Rcpp
+#endif
+

Deleted: pkg/Rcpp/inst/include/Rcpp/sugar/is_na.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/is_na.h	2010-06-18 14:05:59 UTC (rev 1607)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/is_na.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -1,79 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// any.h: Rcpp R/C++ interface class library -- any
-//
-// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
-//
-// This file is part of Rcpp.
-//
-// Rcpp 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.
-//
-// Rcpp 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 Rcpp.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef Rcpp__sugar__is_na_h
-#define Rcpp__sugar__is_na_h
-
-namespace Rcpp{
-namespace sugar{
-
-template <int RTYPE, bool _NA_, typename VEC_TYPE>
-class IsNa : public ::Rcpp::VectorBase< LGLSXP, false, IsNa<RTYPE,_NA_,VEC_TYPE> > {
-public:
-	typedef typename traits::storage_type<RTYPE>::type STORAGE ;
-	typedef Rcpp::VectorBase<RTYPE,_NA_,VEC_TYPE> BASE ;
-	
-	IsNa( const BASE& obj_) : obj(obj_){}
-	
-	inline int operator[]( int i ) const {
-		return ::Rcpp::traits::is_na<RTYPE>( obj[i] ) ;
-	}
-	
-	inline int size() const { return obj.size() ; }
-	         
-private:
-	const BASE& obj ;
-	
-} ;
-      
-// specialization for the case where we already know
-// the result (FALSE) because it is embedded in the type
-// (the second template parameter of VectorBase)
-template <int RTYPE, typename VEC_TYPE>
-class IsNa<RTYPE,false,VEC_TYPE> : public ::Rcpp::VectorBase< LGLSXP, false, IsNa<RTYPE,false,VEC_TYPE> > {
-public:
-	typedef typename traits::storage_type<RTYPE>::type STORAGE ;
-	typedef Rcpp::VectorBase<RTYPE,false,VEC_TYPE> BASE ;
-	
-	IsNa( const BASE& obj_) : obj(obj_){}
-	
-	inline int operator[]( int i ) const {
-		return FALSE ;
-	}
-	
-	inline int size() const { return obj.size() ; }
-	
-private:
-	const BASE& obj ;
-	
-} ;
-
-	
-} // sugar
-
-template <int RTYPE, bool _NA_, typename T>
-inline sugar::IsNa<RTYPE,_NA_,T> is_na( const Rcpp::VectorBase<RTYPE,_NA_,T>& t){
-	return sugar::IsNa<RTYPE,_NA_,T>( t ) ;
-}
-
-} // Rcpp
-#endif
-

Deleted: pkg/Rcpp/inst/include/Rcpp/sugar/seq_along.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/seq_along.h	2010-06-18 14:05:59 UTC (rev 1607)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/seq_along.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -1,56 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// seq_along.h: Rcpp R/C++ interface class library -- any
-//
-// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
-//
-// This file is part of Rcpp.
-//
-// Rcpp 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.
-//
-// Rcpp 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 Rcpp.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef Rcpp__sugar__seq_along_h
-#define Rcpp__sugar__seq_along_h
-
-namespace Rcpp{
-namespace sugar{
-
-class SeqLen : public VectorBase< INTSXP,false,SeqLen > {
-public:
-	SeqLen( int len_ ) : len(len_){}
-	
-	inline int operator[]( int i ) const {
-		return 1 + i ;
-	}
-	inline int size() const { return len ; }
-	         
-private:
-	int len ;
-} ;
-	
-} // sugar
-
-template <int RTYPE, bool _NA_, typename T>
-inline sugar::SeqLen seq_along( const Rcpp::VectorBase<RTYPE,_NA_,T>& t){
-	return sugar::SeqLen( t.size() ) ;
-}
-
-inline sugar::SeqLen seq_len( const size_t& n){
-	return sugar::SeqLen( n ) ;
-}
-
-
-
-} // Rcpp
-#endif
-

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/sugar.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/sugar.h	2010-06-18 14:05:59 UTC (rev 1607)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/sugar.h	2010-06-18 14:08:45 UTC (rev 1608)
@@ -22,12 +22,7 @@
 #ifndef RCPP_SUGAR_H
 #define RCPP_SUGAR_H
 
-// functions
-#include <Rcpp/sugar/any.h>
-#include <Rcpp/sugar/all.h>
-#include <Rcpp/sugar/is_na.h>
-#include <Rcpp/sugar/seq_along.h>
-
+#include <Rcpp/sugar/functions/functions.h>
 #include <Rcpp/sugar/operators/operators.h>
 
 #endif



More information about the Rcpp-commits mailing list