@@ -44,6 +44,15 @@ def is_universe(self):
44
44
OUTPUT:
45
45
46
46
Boolean.
47
+
48
+ TESTS::
49
+
50
+ sage: from sage.geometry.convex_set import ConvexSet_base
51
+ sage: C = ConvexSet_base()
52
+ sage: C.is_universe()
53
+ Traceback (most recent call last):
54
+ ...
55
+ NotImplementedError: <abstract method dim at ...>
47
56
"""
48
57
if not self .is_full_dimensional ():
49
58
return False
@@ -53,6 +62,15 @@ def is_universe(self):
53
62
def dim (self ):
54
63
r"""
55
64
Return the dimension of ``self``.
65
+
66
+ TESTS::
67
+
68
+ sage: from sage.geometry.convex_set import ConvexSet_base
69
+ sage: C = ConvexSet_base()
70
+ sage: C.dim()
71
+ Traceback (most recent call last):
72
+ ...
73
+ NotImplementedError: <abstract method dim at ...>
56
74
"""
57
75
58
76
def dimension (self ):
@@ -88,6 +106,15 @@ def ambient(self):
88
106
def ambient_dim (self ):
89
107
r"""
90
108
Return the dimension of the ambient convex set or space.
109
+
110
+ TESTS::
111
+
112
+ sage: from sage.geometry.convex_set import ConvexSet_base
113
+ sage: C = ConvexSet_base()
114
+ sage: C.ambient_dim()
115
+ Traceback (most recent call last):
116
+ ...
117
+ NotImplementedError: <abstract method ambient_dim at ...>
91
118
"""
92
119
93
120
def ambient_dimension (self ):
@@ -111,11 +138,15 @@ def codimension(self):
111
138
r"""
112
139
Return the codimension of ``self`` in `self.ambient()``.
113
140
114
- An alias is :meth:`codim`.
115
-
116
141
EXAMPLES::
117
142
118
- sage: Polyhedron(vertices=[(1,2,3)], rays=[(1,0,0)]).codimension()
143
+ sage: P = Polyhedron(vertices=[(1,2,3)], rays=[(1,0,0)])
144
+ sage: P.codimension()
145
+ 2
146
+
147
+ An alias is :meth:`codim`::
148
+
149
+ sage: P.codim()
119
150
2
120
151
"""
121
152
return self .ambient_dim () - self .dim ()
@@ -359,13 +390,28 @@ def _test_convex_set(self, tester=None, **options):
359
390
tester .assertTrue (self == cl_self )
360
391
if self .is_compact ():
361
392
tester .assertTrue (self .is_closed ())
393
+ from sage .misc .sage_unittest import TestSuite
394
+ if relint_self is not None and relint_self is not self :
395
+ tester .info ("\n Running the test suite of self.relative_interior()" )
396
+ TestSuite (relint_self ).run (verbose = tester ._verbose ,
397
+ prefix = tester ._prefix + " " )
398
+ tester .info (tester ._prefix + " " , newline = False )
362
399
363
400
# Optional methods
364
401
365
402
@abstract_method (optional = True )
366
403
def affine_hull (self ):
367
404
r"""
368
405
Return the affine hull of ``self``.
406
+
407
+ TESTS::
408
+
409
+ sage: from sage.geometry.convex_set import ConvexSet_base
410
+ sage: C = ConvexSet_base()
411
+ sage: C.affine_hull()
412
+ Traceback (most recent call last):
413
+ ...
414
+ TypeError: 'NotImplementedType' object is not callable
369
415
"""
370
416
371
417
@abstract_method (optional = True )
@@ -380,6 +426,15 @@ def cartesian_product(self, other):
380
426
OUTPUT:
381
427
382
428
The Cartesian product of ``self`` and ``other``.
429
+
430
+ TESTS::
431
+
432
+ sage: from sage.geometry.convex_set import ConvexSet_base
433
+ sage: C = ConvexSet_base()
434
+ sage: C.cartesian_product(C)
435
+ Traceback (most recent call last):
436
+ ...
437
+ TypeError: 'NotImplementedType' object is not callable
383
438
"""
384
439
385
440
@abstract_method (optional = True )
@@ -390,6 +445,15 @@ def contains(self, point):
390
445
INPUT:
391
446
392
447
- ``point`` -- a point or its coordinates
448
+
449
+ TESTS::
450
+
451
+ sage: from sage.geometry.convex_set import ConvexSet_base
452
+ sage: C = ConvexSet_base()
453
+ sage: C.contains(vector([0, 0]))
454
+ Traceback (most recent call last):
455
+ ...
456
+ TypeError: 'NotImplementedType' object is not callable
393
457
"""
394
458
395
459
def _test_contains (self , tester = None , ** options ):
@@ -463,6 +527,15 @@ def intersection(self, other):
463
527
OUTPUT:
464
528
465
529
The intersection.
530
+
531
+ TESTS::
532
+
533
+ sage: from sage.geometry.convex_set import ConvexSet_base
534
+ sage: C = ConvexSet_base()
535
+ sage: C.intersection(C)
536
+ Traceback (most recent call last):
537
+ ...
538
+ TypeError: 'NotImplementedType' object is not callable
466
539
"""
467
540
468
541
0 commit comments