eq

Purpose

Returns true if the set covered by polyhedra P is the same as the set covered by S and false otherwise.

Syntax

tf = P.eq(S)
tf = P == S

Description

Returns true if ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/eq3.png equals ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/eq4.png and false otherwise by testing if both ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/eq5.png and ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/eq6.png.

Input Arguments

P

Polyhedron in any format or array of Polyhedra in H-representation.

Class: Polyhedron

S

Polyhedron (or array of polyhedra) in the same dimension as P.

Class: Polyhedron

Output Arguments

tf

True if S == P and false otherwise.

Class: logical

Allowed values:

  • true
  • false

Example(s)

Example 1

Create a polytope:
P = ExamplePoly.poly3d_sin
Polyhedron in R^2 with representations:
    H-rep (redundant)   : Inequalities  13 | Equalities   0
    V-rep               : Unknown (call computeVRep() to compute)
Functions : none
Create a V-representation of the same polytope
S = Polyhedron(Polyhedron(P).computeVRep)
Polyhedron in R^2 with representations:
    H-rep (redundant)   : Inequalities  13 | Equalities   0
    V-rep (redundant)   : Vertices  13 | Rays   0
Functions : none
Test equivalence:
P == S
ans =

     1

Example 2

Create arrays of polytope in the same dimension
P(1) = ExamplePoly.randHrep;

P(2) = ExamplePoly.randHrep('ne',1);
Create a copy of this array
S = Polyhedron(Polyhedron(P))
Array of 2 polyhedra.
The arrays of polyhedra should cover the same set
P == S
ans =

     1

See Also

neq, contains, le, lt, ge, gt


© 2010-2013 Colin Neil Jones: EPF Lausanne, colin.jones@epfl.ch

© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch