montecarlo

package
v0.0.0-...-ec9fd1c Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2012 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package montecarlo provides numerical algorithms helpful for performing Monte Carlo approximations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VanDerCorput

func VanDerCorput(bits, r uint32) float64

VanDerCorput returns the next number in the van der Corput sequence.

This function can also be used to generate Sobol sequences and Larcher & Pillichshammer sequences. The particular algorithm used is described in "Efficient Multidimensional Sampling" by Alexander Keller.

Types

type Halton

type Halton struct {
	// contains filtered or unexported fields
}

Halton is a fast, incremental Halton sequence generator.

func NewHalton

func NewHalton(base uint) (h *Halton)

NewHalton creates a new Halton sequence generator.

func (*Halton) Float64

func (hal *Halton) Float64() float64

Float64 returns the next number in the sequence with 64 bits of precision.

func (*Halton) Reset

func (h *Halton) Reset()

Reset starts the generator over without changing the base.

func (*Halton) SetBase

func (h *Halton) SetBase(base uint)

SetBase changes the Halton generator's base number. This will reset the generator.

func (*Halton) SetStart

func (h *Halton) SetStart(i uint)

SetStart changes the generator to start with the given index in the sequence.

Jump to

Keyboard shortcuts

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