- Home
- About DUNE
- Download
- Documentation
- Community
- Development
. To get the coordinates of the corners
of the simplex, you do as follows:
.
(
is the unit vector in direction i.)The number of points in a 0-dimensional simplex is 1, independent of its width.
N(0, x) = 1
The recursion formula is
We slice the n+1 dimensional simplex ortogonal to one of the dimensions and sum the number of points in the n dimensional subsimplices.
This formula is satisfied by the binomial koefficient
See Bronstein, Semendjajew, Musiol, Mühlig "Taschenbuch der Mathematik" (1999), Formula (1.35c)
Observations:
The image shows the Kuhn0 tetrahedron of width 2 (wireframe). It is partitioned into a tetrahedron (green), a triangle (red), a line (blue), and a vertex (black), each of width 1 and each a Kuhn0 simplex.
.
(4). Then we take the green tetrahedron away. Whats left is a triangle, which extends into the (1,2)-plane.
(3). Again we take the counted points away and are left with a line which extends into direction 2.
, count the number of vertices (2), and throw away the counted stuff. The only thing remaining is a point, so we're done.
On to a more complicated example: vertex 6 with coordinates
.
). The result is 4.
(vertex 4), which is just a point. The result is 1.
(vertex 5), which is also just a point. The result is 1.
The general algorithm for n dimensions and a vertex with coordinates
is as follows:
,In formulas it looks like this:
Let
be the index of point
in the n-dimensional Kuhn0 simplex. The coordinates measure the position of the point in gridunits and thus are integer.
Since the coordinates of a vertex within the Kuhn0 obey the relation
, they cannot simply be swapped so the sum is somewhat ugly.
Each subelement is a Kuhn (sub)simplex which triangulates a hypercube. We need to remember the vertex which is the origin of that hypercube and the index of the permutation of that identifies the Kuhn subsimplex. Now to get to the next subelement, we simply need to increment the permutation index, and if the overflows we reset it and increment the origin to the next vertex (we already know how to do that).
Some subelements generated this way are outside the refined Kuhn0 simplex, so we have to check for that, and skip them.
We need to index the n! permutations of the integers from 0 to n-1 and a way to calculate the permutation if given the index.
I'll discuss the permutation P, which operates on a vector
.
P can be made up of n transpositions,
. Each transposition
exchanges some arbitrary element
with the element
, where
. So we can totally describe
by the integer
. Thus we can describe P by the integer vector
, where
.
Now we need to encode the vector
into a single number. To do that we view
as digit i of a number p written in a base faculty notation:
This number p is unique for each possible permutation P so we could use this as index. There is a problem though: we would like the identity permutation
to have index 0. So we define the index I of the permutation slightly differently:
I can easily calculate the
from I:
('/' is integer division and '' calculates the remainder).
Step 1 moves each point by its x2 value into x1 direction. Step 2 moves each point by its new x1 value into x0 direction.
from the reference simplex of dimension n to the Kuhn0 simplex (as illustrated in the image) is as follows:
.The reverse (from Kuhn0 to reference) is simple as well:
.
) we do:
.And or the reverse:
.