Documentation ¶
Index ¶
- Constants
- Variables
- func NaturalRange(start, size, increment uint) (res []float64)
- func Range(start float64, size uint, increment float64) (res []float64)
- type Histogram
- func (h *Histogram) Add(x float64) error
- func (h *Histogram) Find(x float64) (int, error)
- func (h *Histogram) Get(i int) int
- func (h *Histogram) GetRange(i int) (lower, upper float64)
- func (h *Histogram) Len() int
- func (h *Histogram) Max() (max, imax int)
- func (h *Histogram) Mean() float64
- func (h *Histogram) Min() (min, imin int)
- func (h *Histogram) Sigma() float64
- func (h *Histogram) String() (res string)
- func (h *Histogram) Sum() (res int)
- type Histogram2d
- func (h *Histogram2d) Add(x, y float64) error
- func (h *Histogram2d) Covariance() float64
- func (h *Histogram2d) Find(x, y float64) (i, j int, err error)
- func (h *Histogram2d) Get(i, j int) int
- func (h *Histogram2d) GetXrange(i int) (xlower, xupper float64)
- func (h *Histogram2d) GetYrange(j int) (ylower, yupper float64)
- func (h *Histogram2d) LenX() int
- func (h *Histogram2d) LenY() int
- func (h *Histogram2d) Max() (xmax, ymax, imax int)
- func (h *Histogram2d) Min() (xmin, ymin, imin int)
- func (h *Histogram2d) String() (res string)
- func (h *Histogram2d) Sum() (sum int)
- func (h *Histogram2d) Xmean() (wmean float64)
- func (h *Histogram2d) Xsigma() (xsigma float64)
- func (h *Histogram2d) Ymean() (wmean float64)
- func (h *Histogram2d) Ysigma() (ysigma float64)
- type Pdf
- type Pdf2d
Constants ¶
const IntString = "%.0f %.0f %d\n"
Use IntString for the variable FormatString with ints.
Variables ¶
var FormatString = "%f %f %v\n"
FormatString is used by the String and Scan functions for data parsing. If you want a different output, just modify the variable.
var FormatString2d = "%v %v %v %v %v\n"
FormatString2d is used by the String and Scan functions for data parsing. If you want a different output, just modify the variable.
Functions ¶
func NaturalRange ¶
NaturalRange generates a range of natural numbers for a new histogram. The Histogram struct works with []float64 for ranges, so this function generates []float64. Also note that the resulting range contains one extra position for the final value. For example: NaturalRange(0, 5, 10) generates []float64{0.0, 10.0, 20.0, 30.0, 40.0, 50.0}
Types ¶
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
func NewHistogram ¶
type Histogram2d ¶
type Histogram2d struct {
// contains filtered or unexported fields
}
func NewHistogram2d ¶
func NewHistogram2d(xrange, yrange []float64) (*Histogram2d, error)
Routine that create a 2D histogram using the given values for X and Y ranges
func (*Histogram2d) Add ¶
func (h *Histogram2d) Add(x, y float64) error
func (*Histogram2d) Covariance ¶
func (h *Histogram2d) Covariance() float64
func (*Histogram2d) Get ¶
func (h *Histogram2d) Get(i, j int) int
func (*Histogram2d) GetXrange ¶
func (h *Histogram2d) GetXrange(i int) (xlower, xupper float64)
func (*Histogram2d) GetYrange ¶
func (h *Histogram2d) GetYrange(j int) (ylower, yupper float64)
func (*Histogram2d) LenX ¶
func (h *Histogram2d) LenX() int
func (*Histogram2d) LenY ¶
func (h *Histogram2d) LenY() int
func (*Histogram2d) Max ¶
func (h *Histogram2d) Max() (xmax, ymax, imax int)
Max finds first value and index of max contents in bins
func (*Histogram2d) Min ¶
func (h *Histogram2d) Min() (xmin, ymin, imin int)
Min finds first value and index of min contents in bins
func (*Histogram2d) String ¶
func (h *Histogram2d) String() (res string)
String uses the variabele FormatString for the data parsing
func (*Histogram2d) Xmean ¶
func (h *Histogram2d) Xmean() (wmean float64)
Xmean returns the histogram arithmetic mean
func (*Histogram2d) Xsigma ¶
func (h *Histogram2d) Xsigma() (xsigma float64)
func (*Histogram2d) Ymean ¶
func (h *Histogram2d) Ymean() (wmean float64)
Ymean returns the histogram arithmetic mean
func (*Histogram2d) Ysigma ¶
func (h *Histogram2d) Ysigma() (ysigma float64)