summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-03 19:46:01 +0100
committerAdrian Kummerlaender2019-06-24 15:17:28 +0200
commit12cde59008e15abb935a2177a2a4ed3038841c96 (patch)
tree3ec2382936dc5aabe89441095f852665bc72a98e /src
parent5a0e359141b214faf15f5057e64e8529f535c5c1 (diff)
downloadgrid_refinement_openlb-12cde59008e15abb935a2177a2a4ed3038841c96.tar
grid_refinement_openlb-12cde59008e15abb935a2177a2a4ed3038841c96.tar.gz
grid_refinement_openlb-12cde59008e15abb935a2177a2a4ed3038841c96.tar.bz2
grid_refinement_openlb-12cde59008e15abb935a2177a2a4ed3038841c96.tar.lz
grid_refinement_openlb-12cde59008e15abb935a2177a2a4ed3038841c96.tar.xz
grid_refinement_openlb-12cde59008e15abb935a2177a2a4ed3038841c96.tar.zst
grid_refinement_openlb-12cde59008e15abb935a2177a2a4ed3038841c96.zip
Add ceil function for our Vector class
Diffstat (limited to 'src')
-rw-r--r--src/utilities/vectorHelpers.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utilities/vectorHelpers.h b/src/utilities/vectorHelpers.h
index 17453dd..e4fc958 100644
--- a/src/utilities/vectorHelpers.h
+++ b/src/utilities/vectorHelpers.h
@@ -188,6 +188,17 @@ Vector<T,Size> ceil(const Vector<T,Size>& a)
return out;
}
+/// applies ceil to each component of a vector
+template <typename T, unsigned Size>
+Vector<T,Size> ceil(const Vector<T,Size>& a)
+{
+ Vector<T,Size> out;
+ for (unsigned int iDim=0; iDim < Size; ++iDim) {
+ out[iDim] = std::ceil(a[iDim]);
+ }
+ return out;
+}
+
/*
/// algorithm by Möller–Trumbore (TODO add ref), implemented by Lucas Cruz and Mathias J. Krause
/// returns true if there is an intersection of a triangle given by (point0, point1, point1) and a ray given by its origin and direction and computes the distance