-
Notifications
You must be signed in to change notification settings - Fork 5
/
schema.go
66 lines (58 loc) · 1.37 KB
/
schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package efd
import (
"github.com/mmcloughlin/ec3/efd/op3/ast"
)
type Shape struct {
Collection string
ID string
Tag string
Class string
Name string
Parameters []string
Coordinates []string
A [7]string
Satisfying []string
Addition []string
Doubling []string
Negation []string
Neutral []string
FromWeierstrass []string
ToWeierstrass []string
}
type Representation struct {
Collection string
ID string
Tag string
Class string
Shape *Shape
Name string
Assume []string
Parameters []string
Variables []string
Satisfying []string
}
type Formula struct {
Collection string
ID string
Tag string
Class string
Shape *Shape
Representation *Representation
Operation string
URL string
Source string
AppliesTo string
Assume []string
Compute []string
Parameters []string
Program *ast.Program
}
// AllParameters returns all parameter variables for this formula. This merges
// the parameters from the shape, representation and formula itself.
func (f Formula) AllParameters() []string {
params := []string{}
params = append(params, f.Shape.Parameters...)
params = append(params, f.Representation.Parameters...)
params = append(params, f.Parameters...)
return params
}