[Rcpp-commits] r1568 - pkg/Rcpp/inst/include/Rcpp/sugar

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 17 13:44:48 CEST 2010


Author: romain
Date: 2010-06-17 13:44:47 +0200 (Thu, 17 Jun 2010)
New Revision: 1568

Added:
   pkg/Rcpp/inst/include/Rcpp/sugar/logical_operators__Vector__Vector.h
Modified:
   pkg/Rcpp/inst/include/Rcpp/sugar/logical_operators.h
Log:
moving Vector to Vector operations in a separate file

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/logical_operators.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/logical_operators.h	2010-06-17 11:41:55 UTC (rev 1567)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/logical_operators.h	2010-06-17 11:44:47 UTC (rev 1568)
@@ -22,135 +22,8 @@
 #ifndef Rcpp__sugar__logical_operators_h
 #define Rcpp__sugar__logical_operators_h
 
+#include <Rcpp/sugar/logical_operators__Vector__Vector.h> 
 
-/* Vector < Vector */ 
-template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
-inline Rcpp::sugar::Comparator<
-	RTYPE , 
-	Rcpp::sugar::less<RTYPE>, 
-	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-	> 
-operator<( 
-	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
-	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
-	){
-	return Rcpp::sugar::Comparator<
-		RTYPE, 
-		Rcpp::sugar::less<RTYPE>, 
-		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-		>( 
-		lhs, rhs
-		) ;
-}
-/* Vector > Vector */
-template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
-inline Rcpp::sugar::Comparator<
-	RTYPE , 
-	Rcpp::sugar::greater<RTYPE>, 
-	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-	> 
-operator>( 
-	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
-	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
-	){
-	return Rcpp::sugar::Comparator<
-		RTYPE, 
-		Rcpp::sugar::greater<RTYPE>, 
-		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-		>( 
-		lhs, rhs
-		) ;
-}
-/* Vector <= Vector */
-template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
-inline Rcpp::sugar::Comparator<
-	RTYPE , 
-	Rcpp::sugar::less_or_equal<RTYPE>, 
-	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-	> 
-operator<=( 
-	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
-	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
-	){
-	return Rcpp::sugar::Comparator<
-		RTYPE, 
-		Rcpp::sugar::less_or_equal<RTYPE>, 
-		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-		>( 
-		lhs, rhs
-		) ;
-}
-/* Vector >= Vector */
-template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
-inline Rcpp::sugar::Comparator<
-	RTYPE , 
-	Rcpp::sugar::greater_or_equal<RTYPE>, 
-	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-	> 
-operator>=( 
-	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
-	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
-	){
-	return Rcpp::sugar::Comparator<
-		RTYPE, 
-		Rcpp::sugar::greater_or_equal<RTYPE>, 
-		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-		>( 
-		lhs, rhs
-		) ;
-}
-/* Vector == Vector */
-template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
-inline Rcpp::sugar::Comparator<
-	RTYPE , 
-	Rcpp::sugar::equal<RTYPE>, 
-	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-	> 
-operator==( 
-	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
-	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
-	){
-	return Rcpp::sugar::Comparator<
-		RTYPE, 
-		Rcpp::sugar::equal<RTYPE>, 
-		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-		>( 
-		lhs, rhs
-		) ;
-}
-/* Vector != Vector */
-template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
-inline Rcpp::sugar::Comparator<
-	RTYPE , 
-	Rcpp::sugar::not_equal<RTYPE>, 
-	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-	> 
-operator!=( 
-	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
-	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
-	){
-	return Rcpp::sugar::Comparator<
-		RTYPE, 
-		Rcpp::sugar::not_equal<RTYPE>, 
-		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
-		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
-		>( 
-		lhs, rhs
-		) ;
-}
-
-
 /* Vector op primitive */
 template <int RTYPE>
 inline Rcpp::sugar::Comparator_With_One_Value< RTYPE , Rcpp::sugar::less<RTYPE> > 

Added: pkg/Rcpp/inst/include/Rcpp/sugar/logical_operators__Vector__Vector.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/logical_operators__Vector__Vector.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/logical_operators__Vector__Vector.h	2010-06-17 11:44:47 UTC (rev 1568)
@@ -0,0 +1,153 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// logical_operators__Vector__Vector.h: Rcpp R/C++ interface class library -- 
+//    logical operators for Vector to Vector comparisons
+//                                                                      
+// 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__logical_operators_h
+#define Rcpp__sugar__logical_operators_h
+
+/* Vector < Vector */ 
+template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
+inline Rcpp::sugar::Comparator<
+	RTYPE , 
+	Rcpp::sugar::less<RTYPE>, 
+	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+	> 
+operator<( 
+	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
+	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
+	){
+	return Rcpp::sugar::Comparator<
+		RTYPE, 
+		Rcpp::sugar::less<RTYPE>, 
+		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+		>( 
+		lhs, rhs
+		) ;
+}
+/* Vector > Vector */
+template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
+inline Rcpp::sugar::Comparator<
+	RTYPE , 
+	Rcpp::sugar::greater<RTYPE>, 
+	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+	> 
+operator>( 
+	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
+	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
+	){
+	return Rcpp::sugar::Comparator<
+		RTYPE, 
+		Rcpp::sugar::greater<RTYPE>, 
+		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+		>( 
+		lhs, rhs
+		) ;
+}
+/* Vector <= Vector */
+template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
+inline Rcpp::sugar::Comparator<
+	RTYPE , 
+	Rcpp::sugar::less_or_equal<RTYPE>, 
+	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+	> 
+operator<=( 
+	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
+	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
+	){
+	return Rcpp::sugar::Comparator<
+		RTYPE, 
+		Rcpp::sugar::less_or_equal<RTYPE>, 
+		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+		>( 
+		lhs, rhs
+		) ;
+}
+/* Vector >= Vector */
+template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
+inline Rcpp::sugar::Comparator<
+	RTYPE , 
+	Rcpp::sugar::greater_or_equal<RTYPE>, 
+	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+	> 
+operator>=( 
+	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
+	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
+	){
+	return Rcpp::sugar::Comparator<
+		RTYPE, 
+		Rcpp::sugar::greater_or_equal<RTYPE>, 
+		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+		>( 
+		lhs, rhs
+		) ;
+}
+/* Vector == Vector */
+template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
+inline Rcpp::sugar::Comparator<
+	RTYPE , 
+	Rcpp::sugar::equal<RTYPE>, 
+	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+	> 
+operator==( 
+	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
+	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
+	){
+	return Rcpp::sugar::Comparator<
+		RTYPE, 
+		Rcpp::sugar::equal<RTYPE>, 
+		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+		>( 
+		lhs, rhs
+		) ;
+}
+/* Vector != Vector */
+template <int RTYPE,bool LHS_NA,typename LHS_T,bool RHS_NA, typename RHS_T>
+inline Rcpp::sugar::Comparator<
+	RTYPE , 
+	Rcpp::sugar::not_equal<RTYPE>, 
+	Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+	Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+	> 
+operator!=( 
+	const Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>& lhs , 
+	const Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>& rhs
+	){
+	return Rcpp::sugar::Comparator<
+		RTYPE, 
+		Rcpp::sugar::not_equal<RTYPE>, 
+		Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T>, 
+		Rcpp::VectorBase<RTYPE,RHS_NA,RHS_T>
+		>( 
+		lhs, rhs
+		) ;
+}
+
+#endif



More information about the Rcpp-commits mailing list