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

PolyMathOrg / PolyMath / 23651208249

27 Mar 2026 02:29PM UTC coverage: 81.274% (-0.4%) from 81.638%
23651208249

Pull #333

github

web-flow
Merge e666a4899 into c9005cbb4
Pull Request #333: Fixed remaining red tests

57 of 88 new or added lines in 9 files covered. (64.77%)

50 existing lines in 4 files now uncovered.

19674 of 24207 relevant lines covered (81.27%)

3.25 hits per line

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

69.39
/src/Math-FunctionFit/PMErrorAsParameterFunction.class.st
1
"
2
ErrorAsParameterFunction is used internally by ErrorMinimizer. it is essentially a wrapper around an ErrorOfParameterFunction .
3
"
4
Class {
5
        #name : 'PMErrorAsParameterFunction',
6
        #superclass : 'PMSimpleParameterFunction',
7
        #category : 'Math-FunctionFit',
8
        #package : 'Math-FunctionFit'
9
}
10

11
{ #category : 'accessing' }
12
PMErrorAsParameterFunction >> changeParametersBy: aVector [
4✔
13
varArray :=varArray + aVector
4✔
14
]
4✔
15

16
{ #category : 'initialization' }
17
PMErrorAsParameterFunction >> function: anErrorOfParameterFunction [
4✔
18
|d f size steps|
4✔
19
d :=anErrorOfParameterFunction data.
4✔
20
usedVars :=anErrorOfParameterFunction parameterSize .
4✔
21
self initializeVarArray: 1.
4✔
22
size:=d size sqrt ceiling .
4✔
23
steps:=d size // (usedVars +1).
4✔
24
size :=size +steps //2.
4✔
25
size := size min: steps.
4✔
26
steps :=d size //size -1.
4✔
27
steps <usedVars ifTrue:[self error: 'dataSize too small for the parameterSize'].
4✔
28
function := (0 to: steps)collect: [:i|
4✔
29
        f:=anErrorOfParameterFunction copy.
4✔
30
        f data: (d copyFrom:( i *size+1) to:( i=steps ifTrue: [d size] ifFalse: [(i+1) *size])).
4✔
31
        f]
4✔
32
]
4✔
33

34
{ #category : 'accessing' }
35
PMErrorAsParameterFunction >> maxFunction [
4✔
36
        "The number of data partitions used. The highest number that can be send to #value:"
4✔
37

4✔
38
        ^ function ifNil: [ 0 ] ifNotNil: [ :f | f size ]
4✔
39
]
4✔
40

41
{ #category : 'accessing' }
42
PMErrorAsParameterFunction >> parameters [
4✔
43
^varArray
4✔
44
]
4✔
45

46
{ #category : 'accessing' }
47
PMErrorAsParameterFunction >> parameters: indexableCollection [
4✔
48
^varArray :=indexableCollection copy
4✔
49
]
4✔
50

51
{ #category : 'printing' }
UNCOV
52
PMErrorAsParameterFunction >> printOn: aStream [
×
UNCOV
53

×
UNCOV
54
        aStream
×
UNCOV
55
                nextPutAll: 'an ';
×
UNCOV
56
                nextPutAll: self class name;
×
UNCOV
57
                nextPutAll: '( function: ';
×
UNCOV
58
                print: (function ifNotNil: [ :f | f first ]);
×
UNCOV
59
                nextPutAll: ' maxFunction: ';
×
UNCOV
60
                print: self maxFunction.
×
UNCOV
61
        varArray ifNotNil: [
×
UNCOV
62
                aStream
×
UNCOV
63
                        nextPutAll: ' parameters: ';
×
UNCOV
64
                        print: self parameters ].
×
UNCOV
65
        aStream nextPut: $)
×
UNCOV
66
]
×
67

68
{ #category : 'evaluating' }
69
PMErrorAsParameterFunction >> value: aNumber [
4✔
70
"aNumber chooses the data partition. it can run from 1 to maxFunction."
4✔
71
^(function at: aNumber) value: varArray
4✔
72
]
4✔
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

© 2026 Coveralls, Inc