aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-08-04 20:11:09 +0200
committerDavid Robillard <d@drobilla.net>2018-08-07 20:01:13 +0200
commitacb6aae319ba56bc52bf6209c343a3f46c624ad8 (patch)
tree675556194ba9bb06fed82547d232b41578eb34d6
parent7a9f0cef536dd257474ea64cd0df86bf5ed778b3 (diff)
downloadchilbert-acb6aae319ba56bc52bf6209c343a3f46c624ad8.tar.gz
chilbert-acb6aae319ba56bc52bf6209c343a3f46c624ad8.tar.bz2
chilbert-acb6aae319ba56bc52bf6209c343a3f46c624ad8.zip
Use inline
-rw-r--r--Hilbert/Algorithm.hpp25
-rw-r--r--Hilbert/BigBitVec.hpp1
-rw-r--r--Hilbert/Common.hpp26
-rw-r--r--Hilbert/FixBitVec.hpp3
-rw-r--r--Hilbert/GetBits.hpp7
-rw-r--r--Hilbert/GetLocation.hpp5
-rw-r--r--Hilbert/GrayCodeRank.hpp9
-rw-r--r--Hilbert/SetBits.hpp7
-rw-r--r--Hilbert/SetLocation.hpp3
9 files changed, 26 insertions, 60 deletions
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 <Hilbert/Common.hpp>
#include <Hilbert/BigBitVec.hpp>
#include <Hilbert/GetLocation.hpp>
#include <Hilbert/SetLocation.hpp>
@@ -56,7 +55,7 @@ namespace Hilbert
{
// 'Transforms' a point.
template<class I>
- H_INLINE
+ inline
void
transform(
const I &e,
@@ -72,7 +71,7 @@ namespace Hilbert
// Inverse 'transforms' a point.
template<class I>
- H_INLINE
+ inline
void
transformInv(
const I &e,
@@ -88,7 +87,7 @@ namespace Hilbert
// Update for method 1 (GrayCodeInv in the loop)
template<class I>
- H_INLINE
+ inline
void
update1(
const I &l,
@@ -117,7 +116,7 @@ namespace Hilbert
// Update for method 2 (GrayCodeInv out of loop)
template<class I>
- H_INLINE
+ inline
void
update2(
const I &l,
@@ -142,7 +141,7 @@ namespace Hilbert
}
template <class P,class H,class I>
- 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<class P,class H>
- H_INLINE
+ inline
void
coordsToIndex(
const P *p, // [in ] point
@@ -221,7 +220,7 @@ namespace Hilbert
template <class P,class H,class I>
- 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<class P,class H>
- H_INLINE
+ inline
void
indexToCoords(
P *p, // [out] point
@@ -297,7 +296,7 @@ namespace Hilbert
}
template <class P,class HC,class I>
- 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<class P,class HC>
- H_INLINE
+ inline
void
coordsToCompactIndex(
const P *p, // [in ] point
@@ -377,7 +376,7 @@ namespace Hilbert
}
template <class P,class HC,class I>
- 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<class P,class HC>
- 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 <Hilbert/Common.hpp>
#include <Hilbert/FixBitVec.hpp>
#include <cstring>
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 <chamilton@cs.dal.ca>
- *
- * 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 <assert.h>
-
-#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 <inttypes.h>
-#include <Hilbert/Common.hpp>
-
+#include <cassert>
// 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 <Hilbert/Common.hpp>
#include <Hilbert/BigBitVec.hpp>
namespace Hilbert
{
template <class H,class I>
- H_INLINE
+ inline
void
getBits(
const H &h, // bits to read
@@ -49,7 +48,7 @@ namespace Hilbert
// <CBigBitVec,CFixBitVec>
template<>
- H_INLINE
+ inline
void
getBits(
const CBigBitVec &h,
@@ -73,7 +72,7 @@ namespace Hilbert
// <CFixBitVec,CFixBitVec>
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 <Hilbert/Common.hpp>
#include <Hilbert/BigBitVec.hpp>
@@ -28,7 +27,7 @@ namespace Hilbert
{
template<class P,class I>
- H_INLINE
+ inline
void
_getLocation(
const P *p,
@@ -68,7 +67,7 @@ namespace Hilbert
template<class P,class I>
- 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 <Hilbert/Common.hpp>
#include <Hilbert/BigBitVec.hpp>
@@ -31,7 +30,7 @@ namespace Hilbert
// calculated index when provided the rotation
// at each level of precision.
template<class H,class HC>
- H_INLINE
+ inline
void
compactIndex(
const int *ms,
@@ -75,7 +74,7 @@ namespace Hilbert
}
template<class I>
- H_INLINE
+ inline
void
grayCodeRank(
const I &mask,
@@ -107,7 +106,7 @@ namespace Hilbert
template<class I>
- H_INLINE
+ inline
void
grayCodeRankInv(
const I &mask,
@@ -165,7 +164,7 @@ namespace Hilbert
template <class I>
- 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 <Hilbert/Common.hpp>
#include <Hilbert/BigBitVec.hpp>
@@ -28,7 +27,7 @@ namespace Hilbert
{
template<class H,class I>
- H_INLINE
+ inline
void
setBits(
H &h, // destination
@@ -50,7 +49,7 @@ namespace Hilbert
// <CBigBitVec,CFixBitVec>
template<>
- H_INLINE
+ inline
void
setBits(
CBigBitVec &h,
@@ -74,7 +73,7 @@ namespace Hilbert
// <CFixBitVec,CFixBitVec>
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 <Hilbert/Common.hpp>
#include <Hilbert/BigBitVec.hpp>
namespace Hilbert
{
template <class P,class I>
- H_INLINE
+ inline
void
setLocation(
P *p,