• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PolyMathOrg / PolyMath / 4385132063

pending completion
4385132063

push

github

GitHub
Merge pull request #316 from jecisc/divers-cleanings

2977 of 2977 new or added lines in 214 files covered. (100.0%)

19725 of 24212 relevant lines covered (81.47%)

2.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Math-ODE/PMTranscriptRecorder.class.st
1
"
2
A TranscriptRecorder is a very primitive tool.
3
It prints a message to transcript when a step is taken by the solver.
4

5
The demo class method shows an example.
6
"
7
Class {
8
        #name : #PMTranscriptRecorder,
9
        #superclass : #PMExplicitSolverSubscriber,
10
        #category : #'Math-ODE'
11
}
12

13
{ #category : #example }
14
PMTranscriptRecorder class >> demo [
×
15

×
16
        "self demo"
×
17

×
18
        | solver system recorder stepper |
×
19
        "Transcript openAsMorphLabel: 'TransciptRecorderDemo'."
×
20
        Transcript
×
21
                cr;
×
22
                show: 'TranscriptRecorder demo start';
×
23
                cr.
×
24

×
25
        system := PMExplicitSystem block: [ :x :t | x collect: [ :ea | t ] ].
×
26
        stepper := PMRungeKuttaStepper onSystem: system.
×
27
        solver := PMExplicitSolver new
×
28
                          stepper: stepper;
×
29
                          system: system.
×
30

×
31
        Transcript
×
32
                show: system block;
×
33
                cr.
×
34
        recorder := self forSolver: solver.
×
35
        "this should be shown, explicit solution is x=1/2*t^2"
×
36
        solver
×
37
                solve: system
×
38
                startState: #( 1 2 3 4 )
×
39
                startTime: 0
×
40
                endTime: 2
×
41
                stepSize: 0.1.
×
42
        recorder unsubscribe.
×
43
        "this should not be shown"
×
44
        solver
×
45
                solve: system
×
46
                startState: #( 0 )
×
47
                startTime: 0
×
48
                endTime: 5
×
49
                stepSize: 0.1.
×
50
        Transcript
×
51
                show: 'TranscriptRecorder demo end';
×
52
                cr
×
53
]
×
54

55
{ #category : #accessing }
56
PMTranscriptRecorder >> defaultBlock [
×
57
        "this is the default transcript output"
×
58
        ^  [:ann | Transcript show: 'state: ';
×
59
                                        show: ann state asString ;
×
60
                                        tab; tab;
×
61
                                        show: ' time: ';
×
62
                                        show: ann time asString;
×
63
                                        cr ]
×
64
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc