1.0.0 • Published 5 months ago

halton v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

halton

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Generate n points of the Halton sequence in n-dimensions.

paypal coinbase twitter

npm.io

Installation

npm install halton

Usage

import halton from "halton";

const points = halton(pointsCount);
// =>
// 0: [0, 0]
// 1: [0.5, 0.3333333333333333]
// 2: [0.25, 0.6666666666666666]
// 3: [0.75, 0.1111111111111111]

API

halton

halton.haltonSequence(index, base) ⇒ number

The Halton sequence algorithm.

Kind: static method of halton See: Wikipedia Halton_sequence

ParamTypeDescription
indexnumberIndex in the sequence.
basenumberAn integer, preferably prime number.

halton.default(count, bases) ⇒ Array.<Array.<number>>

Generate n points of the Halton sequence in n-dimensions. The "bases" parameter defines how many dimensions.

Kind: static method of halton

ParamTypeDefaultDescription
countnumberNumber of points in the sequence to generate.
basesArray.<number>2, 3The bases for the Van der Corput operation. Best results with small coprime numbers.

License

MIT. See license file.

1.0.0

5 months ago

0.0.0

5 months ago