@@ -458,17 +458,17 @@ def compose(f, g):
458
458
sage: def f(x): return x + 1
459
459
sage: h1 = compose(f, g)
460
460
sage: h2 = compose(g, f)
461
- sage: _ = var('x') # optional - sage.symbolic
462
- sage: h1(x) # optional - sage.symbolic
461
+ sage: _ = var('x') # needs sage.symbolic
462
+ sage: h1(x) # needs sage.symbolic
463
463
3*x + 1
464
- sage: h2(x) # optional - sage.symbolic
464
+ sage: h2(x) # needs sage.symbolic
465
465
3*x + 3
466
466
467
467
::
468
468
469
- sage: _ = function('f g') # optional - sage.symbolic
470
- sage: _ = var('x') # optional - sage.symbolic
471
- sage: compose(f, g)(x) # optional - sage.symbolic
469
+ sage: _ = function('f g') # needs sage.symbolic
470
+ sage: _ = var('x') # needs sage.symbolic
471
+ sage: compose(f, g)(x) # needs sage.symbolic
472
472
f(g(x))
473
473
474
474
"""
@@ -492,22 +492,22 @@ def nest(f, n, x):
492
492
EXAMPLES::
493
493
494
494
sage: def f(x): return x^2 + 1
495
- sage: x = var('x') # optional - sage.symbolic
496
- sage: nest(f, 3, x) # optional - sage.symbolic
495
+ sage: x = var('x') # needs sage.symbolic
496
+ sage: nest(f, 3, x) # needs sage.symbolic
497
497
((x^2 + 1)^2 + 1)^2 + 1
498
498
499
499
::
500
500
501
- sage: _ = function('f') # optional - sage.symbolic
502
- sage: _ = var('x') # optional - sage.symbolic
503
- sage: nest(f, 10, x) # optional - sage.symbolic
501
+ sage: _ = function('f') # needs sage.symbolic
502
+ sage: _ = var('x') # needs sage.symbolic
503
+ sage: nest(f, 10, x) # needs sage.symbolic
504
504
f(f(f(f(f(f(f(f(f(f(x))))))))))
505
505
506
506
::
507
507
508
- sage: _ = function('f') # optional - sage.symbolic
509
- sage: _ = var('x') # optional - sage.symbolic
510
- sage: nest(f, 0, x) # optional - sage.symbolic
508
+ sage: _ = function('f') # needs sage.symbolic
509
+ sage: _ = var('x') # needs sage.symbolic
510
+ sage: nest(f, 0, x) # needs sage.symbolic
511
511
x
512
512
513
513
"""
@@ -554,15 +554,16 @@ def __rmul__(self, left):
554
554
"""
555
555
EXAMPLES::
556
556
557
- sage: A = random_matrix(ZZ, 4) # optional - sage.modules
558
- sage: while A.rank() != 4: # optional - sage.modules
557
+ sage: # needs sage.modules
558
+ sage: A = random_matrix(ZZ, 4)
559
+ sage: while A.rank() != 4:
559
560
....: A = random_matrix(ZZ, 4)
560
- sage: B = random_matrix(ZZ, 4) # optional - sage.modules
561
- sage: temp = A * BackslashOperator() # optional - sage.modules
562
- sage: temp.left is A # optional - sage.modules
561
+ sage: B = random_matrix(ZZ, 4)
562
+ sage: temp = A * BackslashOperator()
563
+ sage: temp.left is A
563
564
True
564
- sage: X = temp * B # optional - sage.modules
565
- sage: A * X == B # optional - sage.modules
565
+ sage: X = temp * B
566
+ sage: A * X == B
566
567
True
567
568
"""
568
569
self .left = left
@@ -572,16 +573,17 @@ def __mul__(self, right):
572
573
r"""
573
574
EXAMPLES::
574
575
575
- sage: A = matrix(RDF, 5, 5, 2) # optional - sage.modules
576
- sage: b = vector(RDF, 5, range(5)) # optional - sage.modules
577
- sage: v = A \ b # optional - sage.modules
578
- sage: v.zero_at(1e-19) # On at least one platform, we get a "negative zero" # optional - sage.modules
576
+ sage: # needs sage.modules
577
+ sage: A = matrix(RDF, 5, 5, 2)
578
+ sage: b = vector(RDF, 5, range(5))
579
+ sage: v = A \ b
580
+ sage: v.zero_at(1e-19) # On at least one platform, we get a "negative zero"
579
581
(0.0, 0.5, 1.0, 1.5, 2.0)
580
- sage: v = A._backslash_(b) # optional - sage.modules
581
- sage: v.zero_at(1e-19) # optional - sage.modules
582
+ sage: v = A._backslash_(b)
583
+ sage: v.zero_at(1e-19)
582
584
(0.0, 0.5, 1.0, 1.5, 2.0)
583
- sage: v = A * BackslashOperator() * b # optional - sage.modules
584
- sage: v.zero_at(1e-19) # optional - sage.modules
585
+ sage: v = A * BackslashOperator() * b
586
+ sage: v.zero_at(1e-19)
585
587
(0.0, 0.5, 1.0, 1.5, 2.0)
586
588
"""
587
589
return self .left ._backslash_ (right )
@@ -626,10 +628,10 @@ def is_iterator(it) -> bool:
626
628
sage: list(x)
627
629
[4, 3, 2, 1]
628
630
629
- sage: P = Partitions(3) # optional - sage.combinat
630
- sage: is_iterator(P) # optional - sage.combinat
631
+ sage: P = Partitions(3) # needs sage.combinat
632
+ sage: is_iterator(P) # needs sage.combinat
631
633
False
632
- sage: is_iterator(iter(P)) # optional - sage.combinat
634
+ sage: is_iterator(iter(P)) # needs sage.combinat
633
635
True
634
636
"""
635
637
# see trac #7398 for a discussion
0 commit comments