Class Matrices.Simplex
- Enclosing class:
Matrices
Simplex: the simplest n-dimensional hyperpolyhedron with
Simplex is a particular case of the convex hyperpolyhedron
.
Simplex is specified by its vertices and can be created by the following methods:
Matrices.Region.getSimplex(double[][] vertices)
,Matrices.Region.getTriangle2D(double x1, double y1, double x2, double y2, double x3, double y3)
,Matrices.Region.getTetrahedron3D(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)
.
Note: degenerated simplexes, when all vertices lie in the same (n−1)-dimensional hyperplane,
are not allowed. (In DegeneratedSimplexException
is thrown in these cases.
This class is immutable and thread-safe: there are no ways to modify settings of the created instance.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isSimplexDegenerated
(double[][] vertices) Returns true if and only if the specified vertices lies in the same (n−1)-dimensional hyperplane, as far as it can be detected by analysing the coordinates via calculations with standard Java double numbers.toString()
Returns a brief string description of this object.double[][]
vertices()
Returns the coordinates of all vertices of the simplex.Methods inherited from class net.algart.arrays.Matrices.ConvexHyperpolyhedron
a, b, contains, sectionAtLastCoordinate
Methods inherited from class net.algart.arrays.Matrices.Region
checkSectionAtLastCoordinate, coordRange, coordRanges, getConvexHyperpolyhedron, getHyperparallelepiped, getParallelepiped3D, getPolygon2D, getRectangle2D, getSegment, getSimplex, getTetrahedron3D, getTriangle2D, isContainsSupported, isRectangular, n
-
Method Details
-
isSimplexDegenerated
public static boolean isSimplexDegenerated(double[][] vertices) Returns true if and only if the specified vertices lies in the same (n−1)-dimensional hyperplane, as far as it can be detected by analysing the coordinates via calculations with standard Java double numbers. Heren=vertices[k].length ; this length must be same for all k, and vertices.length must be equal to n+1.Matrices.Region.getSimplex(double[][] vertices)
method throwsDegeneratedSimplexException
if and only if this method returns true for the same argument.- Parameters:
vertices
- coordinates of all vertices.- Returns:
- whether the simplex with the specified vertices is degenerated and cannot be described by this class.
- Throws:
NullPointerException
- if the vertices array or some of its elements is null.IllegalArgumentException
- if the vertices array or some of its elements is empty (has zero length), or if the length of some vertices[k] array is not equal to vertices[0].length+1.
-
vertices
public double[][] vertices()Returns the coordinates of all vertices of the simplex. The returned arrays is identical to an array, passed toMatrices.Region.getSimplex(double[][] vertices)
method.The returned array is a deep clone of the internal data stored in this object: no references, maintained by this object, are returned.
- Returns:
- the coordinates of all vertices of the simplex: the element (line) #k of the returned 2-dimensional array contains n coordinates of the vertex #k.
-
toString
Returns a brief string description of this object.The result of this method may depend on implementation.
- Overrides:
toString
in classMatrices.ConvexHyperpolyhedron
- Returns:
- a brief string description of this object.
-