From acb6aae319ba56bc52bf6209c343a3f46c624ad8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 4 Aug 2018 20:11:09 +0200 Subject: Use inline --- Hilbert/Algorithm.hpp | 25 ++++++++++++------------- Hilbert/BigBitVec.hpp | 1 - Hilbert/Common.hpp | 26 -------------------------- Hilbert/FixBitVec.hpp | 3 +-- Hilbert/GetBits.hpp | 7 +++---- Hilbert/GetLocation.hpp | 5 ++--- Hilbert/GrayCodeRank.hpp | 9 ++++----- Hilbert/SetBits.hpp | 7 +++---- Hilbert/SetLocation.hpp | 3 +-- 9 files changed, 26 insertions(+), 60 deletions(-) delete mode 100644 Hilbert/Common.hpp diff --git a/Hilbert/Algorithm.hpp b/Hilbert/Algorithm.hpp index b22fc5e..c79f700 100644 --- a/Hilbert/Algorithm.hpp +++ b/Hilbert/Algorithm.hpp @@ -20,7 +20,6 @@ #define _ALGORITHM_HPP_ -#include #include #include #include @@ -56,7 +55,7 @@ namespace Hilbert { // 'Transforms' a point. template - H_INLINE + inline void transform( const I &e, @@ -72,7 +71,7 @@ namespace Hilbert // Inverse 'transforms' a point. template - H_INLINE + inline void transformInv( const I &e, @@ -88,7 +87,7 @@ namespace Hilbert // Update for method 1 (GrayCodeInv in the loop) template - H_INLINE + inline void update1( const I &l, @@ -117,7 +116,7 @@ namespace Hilbert // Update for method 2 (GrayCodeInv out of loop) template - H_INLINE + inline void update2( const I &l, @@ -142,7 +141,7 @@ namespace Hilbert } template - H_INLINE + inline void _coordsToIndex( const P *p, @@ -200,7 +199,7 @@ namespace Hilbert // representation for interim variables. // Assumes h is big enough for the output (n*m bits!) template - H_INLINE + inline void coordsToIndex( const P *p, // [in ] point @@ -221,7 +220,7 @@ namespace Hilbert template - H_INLINE + inline void _indexToCoords( P *p, @@ -277,7 +276,7 @@ namespace Hilbert // Assumes each entry of p is big enough to hold the // appropriate variable. template - H_INLINE + inline void indexToCoords( P *p, // [out] point @@ -297,7 +296,7 @@ namespace Hilbert } template - H_INLINE + inline void _coordsToCompactIndex( const P *p, @@ -355,7 +354,7 @@ namespace Hilbert // representation for interim variables. // Assumes h is big enough for the output (n*m bits!) template - H_INLINE + inline void coordsToCompactIndex( const P *p, // [in ] point @@ -377,7 +376,7 @@ namespace Hilbert } template - H_INLINE + inline void _compactIndexToCoords( P *p, @@ -451,7 +450,7 @@ namespace Hilbert // Assumes each entry of p is big enough to hold the // appropriate variable. template - H_INLINE + inline void compactIndexToCoords( P *p, // [out] point diff --git a/Hilbert/BigBitVec.hpp b/Hilbert/BigBitVec.hpp index 175a96a..9d83610 100644 --- a/Hilbert/BigBitVec.hpp +++ b/Hilbert/BigBitVec.hpp @@ -21,7 +21,6 @@ #define _BIGBITVEC_HPP_ -#include #include #include diff --git a/Hilbert/Common.hpp b/Hilbert/Common.hpp deleted file mode 100644 index b297162..0000000 --- a/Hilbert/Common.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2006-2007 Chris Hamilton - * - * This program 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. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _COMMON_HPP_ -#define _COMMON_HPP_ - -#include - -#define H_INLINE inline - -#endif diff --git a/Hilbert/FixBitVec.hpp b/Hilbert/FixBitVec.hpp index 60f4384..0117c89 100644 --- a/Hilbert/FixBitVec.hpp +++ b/Hilbert/FixBitVec.hpp @@ -22,8 +22,7 @@ #include -#include - +#include // This must be an unsigned integer that is either // 32 or 64 bits. Otherwise, there are places in the diff --git a/Hilbert/GetBits.hpp b/Hilbert/GetBits.hpp index 862eae3..461690c 100644 --- a/Hilbert/GetBits.hpp +++ b/Hilbert/GetBits.hpp @@ -20,14 +20,13 @@ #define _GETBITS_HPP_ -#include #include namespace Hilbert { template - H_INLINE + inline void getBits( const H &h, // bits to read @@ -49,7 +48,7 @@ namespace Hilbert // template<> - H_INLINE + inline void getBits( const CBigBitVec &h, @@ -73,7 +72,7 @@ namespace Hilbert // template<> - H_INLINE + inline void getBits( const CFixBitVec &h, diff --git a/Hilbert/GetLocation.hpp b/Hilbert/GetLocation.hpp index c0d6781..e66dc04 100644 --- a/Hilbert/GetLocation.hpp +++ b/Hilbert/GetLocation.hpp @@ -20,7 +20,6 @@ #define _GETLOCATION_HPP_ -#include #include @@ -28,7 +27,7 @@ namespace Hilbert { template - H_INLINE + inline void _getLocation( const P *p, @@ -68,7 +67,7 @@ namespace Hilbert template - H_INLINE + inline void getLocation( const P *p, diff --git a/Hilbert/GrayCodeRank.hpp b/Hilbert/GrayCodeRank.hpp index f4f46d1..036d9d4 100644 --- a/Hilbert/GrayCodeRank.hpp +++ b/Hilbert/GrayCodeRank.hpp @@ -20,7 +20,6 @@ #define _GRAYCODERANK_HPP_ -#include #include @@ -31,7 +30,7 @@ namespace Hilbert // calculated index when provided the rotation // at each level of precision. template - H_INLINE + inline void compactIndex( const int *ms, @@ -75,7 +74,7 @@ namespace Hilbert } template - H_INLINE + inline void grayCodeRank( const I &mask, @@ -107,7 +106,7 @@ namespace Hilbert template - H_INLINE + inline void grayCodeRankInv( const I &mask, @@ -165,7 +164,7 @@ namespace Hilbert template - H_INLINE + inline void extractMask( const int *ms, diff --git a/Hilbert/SetBits.hpp b/Hilbert/SetBits.hpp index 1dc9857..5f311f1 100644 --- a/Hilbert/SetBits.hpp +++ b/Hilbert/SetBits.hpp @@ -20,7 +20,6 @@ #define _SETBITS_HPP_ -#include #include @@ -28,7 +27,7 @@ namespace Hilbert { template - H_INLINE + inline void setBits( H &h, // destination @@ -50,7 +49,7 @@ namespace Hilbert // template<> - H_INLINE + inline void setBits( CBigBitVec &h, @@ -74,7 +73,7 @@ namespace Hilbert // template<> - H_INLINE + inline void setBits( CFixBitVec &h, diff --git a/Hilbert/SetLocation.hpp b/Hilbert/SetLocation.hpp index d3f6130..66e6459 100644 --- a/Hilbert/SetLocation.hpp +++ b/Hilbert/SetLocation.hpp @@ -20,14 +20,13 @@ #define _SETLOCATION_HPP_ -#include #include namespace Hilbert { template - H_INLINE + inline void setLocation( P *p, -- cgit v1.2.1