simplex
Simplex
dataclass
Bases: tuple
Implements the concept of simplex.
Notes
- As a subclasse of
tuple, instances ofSimplexcan be compared to np.ndarray[int]. - The volume property computes the volume when called. It might be time consuming on large complexes. That is why volumes are also stored within the Module.
- 0-simplices are assigned a null volume by convention.
- TODO? Should add a test to be sure that the number of vertices matches the number of indices.
Source code in src/dxtr/complexes/simplex.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
circumcenter
property
The circumcenter of the k-simplex.
Note
The circumcenter is set to None if the simplex is abstract.
dim
property
The topological dimension (k) of the k-simplex.
isabstract
property
True if no position vectors are associated with the nodes.
vertices
property
The position vectors of the nodes.
volume
property
The k-volume of the k-simplex.
Note
The volume is set to None if the simplex is abstract.
isfaceof(another)
Checks if one simplex is the face of another
Notes
- We only check the topology here.
- TODO? Maybe it would be interesting to also check the geometry, when relevant (i.e. non abstract) to be sure that the vertices are at the same positions.
Source code in src/dxtr/complexes/simplex.py
142 143 144 145 146 147 148 149 150 151 152 | |
set_vertices(vertices)
Sets the positions of the simplex indices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vertices
|
ndarray[float] | list[list[float]]
|
The provided position vectors of the vertices. |
required |
Notes
- The number of provided position vectors must at least match the number of indices.
- It can be bigger (e.g. one might provide the list of the position vectors of the whole complex).
- In this case, the vertices of the simplex are determined by the
indices values.
Source code in src/dxtr/complexes/simplex.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |