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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 26 19:05:58 CEST 2011


Author: romain
Date: 2011-04-26 19:05:57 +0200 (Tue, 26 Apr 2011)
New Revision: 3021

Removed:
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/impl/var.h
   pkg/Rcpp/inst/include/Rcpp/sugar/sugar_impl.h
Modified:
   pkg/Rcpp/inst/include/Rcpp.h
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/var.h
Log:
simplify

Deleted: pkg/Rcpp/inst/include/Rcpp/sugar/functions/impl/var.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/impl/var.h	2011-04-26 16:58:57 UTC (rev 3020)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/impl/var.h	2011-04-26 17:05:57 UTC (rev 3021)
@@ -1,39 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// var.h: Rcpp R/C++ interface class library -- var
-//
-// Copyright (C) 2011 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__impl_var_h
-#define Rcpp__sugar__impl_var_h
-
-namespace Rcpp{
-namespace sugar{
-
-    template <int RTYPE, bool NA, typename T>
-    typename Var<RTYPE,NA,T>::STORAGE Var<RTYPE,NA,T>::get() const {
-		STORAGE m = mean(object).get() ;
-		Minus_Vector_Primitive<RTYPE,NA,T> mm( object, m) ;
-		STORAGE ssq  = sum( pow(mm,2.0) ).get() ;
-	    return ssq / (object.size() - 1 ) ;
-	}         
-	
-}
-}
-
-#endif

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/functions/var.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/var.h	2011-04-26 16:58:57 UTC (rev 3020)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/var.h	2011-04-26 17:05:57 UTC (rev 3021)
@@ -33,7 +33,12 @@
 		                                             
 	Var( const VEC_TYPE& object_ ) : object(object_){}
 	
-	STORAGE get() const ; 
+	STORAGE get() const{
+	    STORAGE m = mean(object).get() ;
+		Minus_Vector_Primitive<RTYPE,NA,T> mm( object, m) ;
+		STORAGE ssq  = sum( pow(mm,2.0) ).get() ;
+	    return ssq / (object.size() - 1 ) ;    
+	}
 	
 private:
 	const VEC_TYPE& object ;

Deleted: pkg/Rcpp/inst/include/Rcpp/sugar/sugar_impl.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/sugar_impl.h	2011-04-26 16:58:57 UTC (rev 3020)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/sugar_impl.h	2011-04-26 17:05:57 UTC (rev 3021)
@@ -1,27 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// sugar_impl.h: Rcpp R/C++ interface class library -- 
-//
-// Copyright (C) 2011 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_IMPL_H
-#define RCPP_SUGAR_IMPL_H
-
-#include <Rcpp/sugar/functions/impl/var.h>
-
-#endif

Modified: pkg/Rcpp/inst/include/Rcpp.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp.h	2011-04-26 16:58:57 UTC (rev 3020)
+++ pkg/Rcpp/inst/include/Rcpp.h	2011-04-26 17:05:57 UTC (rev 3021)
@@ -67,6 +67,5 @@
 
 #include <Rcpp/sugar/sugar.h>
 #include <Rcpp/stats/stats.h>
-#include <Rcpp/sugar/sugar_impl.h>
 
 #endif



More information about the Rcpp-commits mailing list