/
briotest.go
116 lines (92 loc) · 1.39 KB
/
briotest.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copyright ©2018 The go-hep Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package briotest // import "go-hep.org/x/hep/brio/cmd/brio-gen/internal/briotest"
type Hist struct {
Name string
Data struct {
X float64
}
i int
u uint
i8 int8
i16 int16
i32 int32
i64 int64
u8 uint8
u16 uint16
u32 uint32
u64 uint64
f32 float32
f64 float64
c64 complex64
c128 complex128
b bool
arrI8 [2]int8
sliF64 []float64
bins []Bin
sliPs []*Bin
ptr *float64
myu8 U8
myu16 U16
}
func NewHist(
name string, dataX float64,
i int,
u uint,
i8 int8,
i16 int16,
i32 int32,
i64 int64,
u8 uint8,
u16 uint16,
u32 uint32,
u64 uint64,
f32 float32,
f64 float64,
c64 complex64,
c128 complex128,
b bool,
arrI8 [2]int8,
sliF64 []float64,
bins []Bin,
sliPs []*Bin,
ptr *float64,
myu8 U8,
myu16 U16,
) *Hist {
return &Hist{
Name: name,
Data: struct {
X float64
}{X: dataX},
i: i,
u: u,
i8: i8,
i16: i16,
i32: i32,
i64: i64,
u8: u8,
u16: u16,
u32: u32,
u64: u64,
f32: f32,
f64: f64,
c64: c64,
c128: c128,
b: b,
arrI8: arrI8,
sliF64: sliF64,
bins: bins,
sliPs: sliPs,
ptr: ptr,
myu8: myu8,
myu16: myu16,
}
}
type Bin struct {
x, y float64
}
func NewBin(x, y float64) *Bin { return &Bin{x: x, y: y} }
type U8 uint8
type U16 uint16