fn

package
v0.0.0-...-324d411 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Special math functions not included in "math" package.

Index

Constants

View Source
const (
	MACHEP float64 = 1.11022302462515654042e-16
	MAXLOG float64 = 7.08396418532264106224e2
)

Variables

View Source
var GammaF = math.Gamma
View Source
var LnΓp = LnGammaP
View Source
var LnΓpRatio = LnGammaPRatio

Functions

func ArithMean

func ArithMean(data *Vector) float64

Arithmetic mean

func B

func B(x float64, y float64) float64

B returns the Beta function.

func BetaIncReg

func BetaIncReg(α, β, x float64) float64

BetaIncReg returns the Regularized incomplete Beta function.

func BinomCoeff

func BinomCoeff(n, k int64) float64

func Bn

func Bn(n int64) float64

Bernoulli number Akiyama–Tanigawa algorithm for Bn

func Choose

func Choose(n int64, i int64) int64

Choose returns binomial coefficient for integer n and k.

func FChoose

func FChoose(n, k float64) float64

FChoose returns generalized binomial coefficient i.e., also defined for non-integer n (integer k).

func Fact

func Fact(n int64) float64

func FactInt

func FactInt(n int64) int64

FactInt(n) = n*FactInt(n-1)

func GammaP

func GammaP(p int, x float64) (r float64)

func GammaPRatio

func GammaPRatio(p int, x, y float64) (r float64)

func GenMean

func GenMean(data *Vector, p float64) float64

Generalized mean

func GeomMean

func GeomMean(data *Vector) float64

Geometric mean

func H

func H(n int64, m float64) float64

H returns the generalized harmonic number of order n of m.

func H2

func H2(n int64, q, s float64) float64

Generalized harmonic number

func HarmonicMean

func HarmonicMean(data *Vector) float64

Harmonic mean

func IB

func IB(a, b, x float64) float64

BetaIncReg returns the Non-regularized incomplete Beta function.

func IGam

func IGam(a, x float64) float64

func IGamC

func IGamC(a, x float64) float64

func

func IΓ(s, x float64) float64

Upper incomplete Gamma function // did not pass test for IΓ(1.45896, 3.315) == 0.0706743424609074192334

func IΓint

func IΓint(s int64, x float64) float64

Upper incomplete Gamma function for integer s only

func

func Iγ(s, x float64) float64

Lower incomplete Gamma function

func Iγint

func Iγint(s int64, x float64) float64

Lower incomplete Gamma function for integer s only

func LnB

func LnB(x float64, y float64) float64

LogBeta function

func LnBeta

func LnBeta(a, b float64) float64

LnBeta returns the value of the log beta function. Translation of the Fortran code by W. Fullerton of Los Alamos Scientific Laboratory.

func LnBinomCoeff

func LnBinomCoeff(n, k float64) float64

func LnChoose

func LnChoose(n int64, i int64) float64

LnChoose returns the natural logarithm of the binomial coefficient for integer n and k.

func LnFChoose

func LnFChoose(n, k float64) float64

LnFChoose returns the natural logarithm of the generalized binomial coefficient i.e., also defined for non-integer n (integer k).

func LnFact

func LnFact(nn float64) float64

func LnFactBig

func LnFactBig(n float64) float64

LnFactBig(n) = Gamma(n+1)

func LnGammaP

func LnGammaP(p int, x float64) (r float64)

func LnGammaPRatio

func LnGammaPRatio(p int, x, y float64) (r float64)

LnΓp(x)/LnΓp(y)

func LnPartialFact

func LnPartialFact(n, m float64) float64

LnPartialFact returns LnFact(n)-LnFact(m)

func LnΓ

func LnΓ(x float64) (res float64)

Natural logarithm of the Gamma function

func PartialFactInt

func PartialFactInt(n int64, m int64) int64

PartialFactInt returns Fact(n)/Fact(m)

func RiemannZeta

func RiemannZeta(s float64) float64

Riemann zeta function ζ(s)

func Round

func Round(x float64) float64

Round to nearest integer

func Γr

func Γr(s, x float64) float64

Regularized Gamma function

Types

type Matrix

type Matrix struct {
	R int
	C int
	A []float64
}

func NewMatrix

func NewMatrix(rows, cols int) (m *Matrix)

func (Matrix) Get

func (m Matrix) Get(i int, j int) float64

func (Matrix) Set

func (m Matrix) Set(i int, j int, x float64)

type Vector

type Vector struct {
	A []float64 // data
	L int       // length
}

import (

"fmt"
"math/rand"
"bufio"

// "strconv" )

func NewVector

func NewVector(length int) (v *Vector)

func (Vector) Get

func (v Vector) Get(i int) float64

func (Vector) Set

func (v Vector) Set(i int, x float64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL