Update of LabelTensor class and fix Simplex domain (#362)
*Implement new methods in LabelTensor and fix operators
This commit is contained in:
committed by
Nicola Demo
parent
fdb8f65143
commit
7528f6ef74
@@ -92,13 +92,12 @@ class SimplexDomain(DomainInterface):
|
||||
"""
|
||||
|
||||
span_dict = {}
|
||||
|
||||
for i, coord in enumerate(self.variables):
|
||||
sorted_vertices = sorted(vertices, key=lambda vertex: vertex[i])
|
||||
sorted_vertices = torch.sort(vertices[coord].tensor.squeeze())
|
||||
# respective coord bounded by the lowest and highest values
|
||||
span_dict[coord] = [
|
||||
float(sorted_vertices[0][i]),
|
||||
float(sorted_vertices[-1][i]),
|
||||
float(sorted_vertices.values[0]),
|
||||
float(sorted_vertices.values[-1]),
|
||||
]
|
||||
|
||||
return CartesianDomain(span_dict)
|
||||
|
||||
Reference in New Issue
Block a user