Documentation
¶
Overview ¶
Package comply provides routines that do not make sense to be written from scratch/ provided in pkg, or have other design constrains that are imposed for the sake of complying with the problem statements in the assignment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LU ¶
type LU struct {
// contains filtered or unexported fields
}
We define out own LU decomposition here and not as a reusable package in pkg, since there is already very good LU decomposition functionality in gonum (based on LAPACK and BLAS), which is preferable to this home-cooked solution.
type Rejection ¶
type Rejection struct {
C float64
Target distuv.LogProber
Proposal distuv.RandLogProber
Src rand.Source
}
RejectionSample implements rejection sampling. Note that this is implemented in comply, since Gonum has a robust and tested rejection sampling implementation. This types interface is modeled on Gonum's distuv.Rejection type. This implementation is more simplistic than the the Gonum one, and panics on any errors it encounters. It also requires a random source and does not fall back to other sources of randomness if Rejection.Src == nil.
type SplineRange ¶
type SplineRange struct {
// contains filtered or unexported fields
}
We have a separate spline range here to comply with using the home-cooked LU decomposition instead of the much more stable and faster inline tridiagonal band solver...
func NewSplineRange ¶
func NewSplineRange(xs, ys []float64) (*SplineRange, error)
NewSplineRange is a compliant version of interpolate.NewSplineRange
func (*SplineRange) Bounds ¶
func (r *SplineRange) Bounds() (float64, float64)
Bounds implements a Range.
func (*SplineRange) Eval ¶
func (r *SplineRange) Eval(x float64) (y float64, err error)
Eval implements a Range.
func (*SplineRange) InBounds ¶
func (r *SplineRange) InBounds(x float64) bool
InBounds implements a Range.