Wildmeshing Toolkit
Loading...
Searching...
No Matches
grid_utils.cpp
Go to the documentation of this file.
1
#include "
grid_utils.hpp
"
2
namespace
wmtk::components::procedural
{
3
4
namespace
{
5
template
<
int
64_t D>
6
int64_t _grid_index(
const
std::array<int64_t, D>& d,
const
std::array<int64_t, D>& i)
7
{
8
int64_t v = i[0];
9
for
(int64_t j = 1; j < D; ++j) {
10
v = v * d[j] + i[j];
11
}
12
return
v;
13
}
14
}
// namespace
15
16
int64_t
grid_index
(
const
std::array<int64_t, 3>& d,
const
std::array<int64_t, 3>& i)
17
{
18
return
_grid_index<3>(d, i);
19
}
20
int64_t
grid_index
(
const
std::array<int64_t, 2>& d,
const
std::array<int64_t, 2>& i)
21
{
22
return
_grid_index<2>(d, i);
23
}
24
}
// namespace wmtk::components::procedural
grid_utils.hpp
wmtk::components::procedural
Definition
DiskOptions.cpp:8
wmtk::components::procedural::grid_index
int64_t grid_index(const std::array< int64_t, 3 > &d, const std::array< int64_t, 3 > &i)
Definition
grid_utils.cpp:16
components
procedural
wmtk
components
procedural
grid_utils.cpp
Generated by
1.9.8