Liking cljdoc? Tell your friends :D

fastmath.protocols

Set of protocols for fastmath.

Includes:

  • random generator protocol
  • distribution protocols
  • vector protocol
Set of protocols for fastmath.

Includes:

* random generator protocol
* distribution protocols
* vector protocol
raw docstring

DistributionIdProtocljprotocol

Get name and parameter names from distribution

Get name and parameter names from distribution

distribution-idclj

(distribution-id d)

Distribution id as keyword

Distribution id as keyword

distribution-parametersclj

(distribution-parameters d)

List of distribution parameter names

List of distribution parameter names
sourceraw docstring

DistributionProtocljprotocol

Get information from distributions.

Get information from distributions.

lpdfclj

(lpdf d v)

Log density

Log density

icdfclj

(icdf d p)

Inverse cumulative probability

Inverse cumulative probability

cdfclj

(cdf d v)
(cdf d v1 v2)

Cumulative probability.

Cumulative probability.

pdfclj

(pdf d v)

Density

Density

probabilityclj

(probability d v)

Probability (PMF)

Probability (PMF)

continuous?clj

(continuous? d)

Does distribution support continuous range?

Does distribution support continuous range?

source-objectclj

(source-object d)

Returns Java object from backend library

Returns Java object from backend library

dimensionsclj

(dimensions d)

Returns dimensions

Returns dimensions

sampleclj

(sample d)

Returns random sample.

Returns random sample.
sourceraw docstring

GridProtocljprotocol

Common grid conversion functions.

Common grid conversion functions.

cell->anchorclj

(cell->anchor g cell)

Converts cell coordinates to anchor coordinates.

Converts cell coordinates to anchor coordinates.

cell->midclj

(cell->mid g cell)

Converts cell coordinates to cell midpoint

Converts cell coordinates to cell midpoint

coords->cellclj

(coords->cell g coords)

Converts 2d space coordinates to cell coordinates.

Converts 2d space coordinates to cell coordinates.

coords->midclj

(coords->mid g coords)

Converts 2d space into cell midpoint.

Converts 2d space into cell midpoint.

cornersclj

(corners g coords)
(corners g coords scale)

Returns list of cell vertices for given 2d space coordinates.

Returns list of cell vertices for given 2d space coordinates.

grid-typeclj

(grid-type g)

Returns type of the cell.

Returns type of the cell.
sourceraw docstring

MultivariateDistributionProtocljprotocol

Get information from distributions.

Get information from distributions.

covarianceclj

(covariance d)

Variance

Variance

meansclj

(means d)

Mean

Mean
sourceraw docstring

RNGProtocljprotocol

Defines set of random functions for different RNGs or distributions returning primitive values.

Defines set of random functions for different RNGs or distributions returning primitive values.

->seqclj

(->seq rng)
(->seq rng n)

Returns lazy sequence of random samples (can be limited to optional n values).

Returns lazy sequence of random samples (can be limited to optional `n` values).

brandomclj

(brandom rng)
(brandom rng p)

Boolean random.

Returns true or false with equal probability. You can set p probability for true

Boolean random.

Returns true or false with equal probability. You can set `p` probability for `true`

drandomclj

(drandom rng)
(drandom rng mx)
(drandom rng mn mx)

Random double.

As default returns random double from [0,1) range. When mx is passed, range is set to [0, mx). When mn is passed, range is set to [mn, mx).

Random double.

As default returns random double from `[0,1)` range.
When `mx` is passed, range is set to `[0, mx)`. When `mn` is passed, range is set to `[mn, mx)`.

frandomclj

(frandom rng)
(frandom rng mx)
(frandom rng mn mx)

Random float.

As default returns random float from [0,1) range. When mx is passed, range is set to [0, mx). When mn is passed, range is set to [mn, mx).

Random float.

As default returns random float from `[0,1)` range.
When `mx` is passed, range is set to `[0, mx)`. When `mn` is passed, range is set to `[mn, mx)`.

grandomclj

(grandom rng)
(grandom rng std)
(grandom rng mean std)

Random double from gaussian distribution.

As default returns random double from N(0,1). When std is passed, N(0,std) is used. When mean is passed, distribution is set to N(mean, std).

Random double from gaussian distribution.

As default returns random double from `N(0,1)`. 
When `std` is passed, `N(0,std)` is used. When `mean` is passed, distribution is set to `N(mean, std)`.

irandomclj

(irandom rng)
(irandom rng mx)
(irandom rng mn mx)

Random integer.

As default returns random integer from full integer range. When mx is passed, range is set to [0, mx). When mn is passed, range is set to [mn, mx).

Random integer.

As default returns random integer from full integer range. 
When `mx` is passed, range is set to `[0, mx)`. When `mn` is passed, range is set to `[mn, mx)`.

lrandomclj

(lrandom rng)
(lrandom rng mx)
(lrandom rng mn mx)

Random long.

As default returns random long from full long range. When mx is passed, range is set to [0, mx). When mn is passed, range is set to [mn, mx).

Random long.

As default returns random long from full long range. 
When `mx` is passed, range is set to `[0, mx)`. When `mn` is passed, range is set to `[mn, mx)`.

set-seed!clj

(set-seed! rng v)

Sets seed. Returns rng

Sets seed. Returns `rng`
sourceraw docstring

TransformProtocljprotocol

Transformer functions.

Transformer functions.

forward-1dclj

(forward-1d t xs)

Forward transform of sequence or array.

Forward transform of sequence or array.

forward-2dclj

(forward-2d t xss)

Forward transform of sequence of sequences.

Forward transform of sequence of sequences.

reverse-1dclj

(reverse-1d t xs)

Reverse transform of sequence or array.

Reverse transform of sequence or array.

reverse-2dclj

(reverse-2d t xss)

Reverse transform of sequence of sequences.

Reverse transform of sequence of sequences.
sourceraw docstring

UnivariateDistributionProtocljprotocol

lower-boundclj

(lower-bound d)

Lower value

Lower value

meanclj

(mean d)

Mean

Mean

upper-boundclj

(upper-bound d)

Higher value

Higher value

varianceclj

(variance d)

Variance

Variance
source

VectorProtocljprotocol

Vector operations

Vector operations

to-vecclj

(to-vec v)

Convert to Clojure primitive vector Vec.

Convert to Clojure primitive vector `Vec`.

dotclj

(dot v1 v2)

Dot product of two vectors.

Dot product of two vectors.

permuteclj

(permute v idxs)

Permute vector elements with given indices.

Permute vector elements with given indices.

addclj

(add v1)
(add v1 v2)

Sum of two vectors.

Sum of two vectors.

approxclj

(approx v)
(approx v d)

Round to 2 (or d) decimal places

Round to 2 (or `d`) decimal places

crossclj

(cross v1 v2)

Cross product

Cross product

reciprocalclj

(reciprocal v)

Reciprocal of elements.

Reciprocal of elements.

sumclj

(sum v1)

Sum of elements

Sum of elements

emnclj

(emn v1 v2)

Element-wise min from two vectors.

Element-wise min from two vectors.

is-near-zero?clj

(is-near-zero? v1)
(is-near-zero? v1 tol)

Is vector almost zero? (all absolute values of elements are less than tol tolerance or 1.0e-6)

Is vector almost zero? (all absolute values of elements are less than `tol` tolerance or `1.0e-6`)

headingclj

(heading v1)

Angle between vector and unit vector [1,0,...]

Angle between vector and unit vector `[1,0,...]`

axis-rotateclj

(axis-rotate v1 angle axis)
(axis-rotate v1 angle axis pivot)

Rotate around axis, 3d only

Rotate around axis, 3d only

magsqclj

(magsq v1)

Length of the vector squared.

Length of the vector squared.

to-polarclj

(to-polar v1)

To polar coordinates (2d, 3d only), first element is length, the rest angle.

To polar coordinates (2d, 3d only), first element is length, the rest angle.

transformclj

(transform v1 o vx vy)
(transform v1 o vx vy vz)

Transform vector; map point to coordinate system defined by origin, vx and vy (as bases), d and 3d only.

Transform vector; map point to coordinate system defined by origin, vx and vy (as bases), d and 3d only.

magclj

(mag v1)

length of the vector.

length of the vector.

from-polarclj

(from-polar v1)

From polar coordinates (2d, 3d only)

From polar coordinates (2d, 3d only)

subclj

(sub v1)
(sub v1 v2)

Subtraction of two vectors.

Subtraction of two vectors.

mindimclj

(mindim v)

Index of minimum value.

Index of minimum value.

is-zero?clj

(is-zero? v1)

Is vector zero?

Is vector zero?

econstrainclj

(econstrain v val1 val2)

Element-wise constrain

Element-wise constrain

base-fromclj

(base-from v)

List of perpendicular vectors (basis)

List of perpendicular vectors (basis)

emultclj

(emult v1 v2)

Element-wise vector multiplication (Hadamard product).

Element-wise vector multiplication (Hadamard product).

maxdimclj

(maxdim v)

Index of maximum value.

Index of maximum value.

emxclj

(emx v1 v2)

Element-wise max from two vectors.

Element-wise max from two vectors.

interpolateclj

(interpolate v1 v2 t f)

Interpolate vectors, optionally set interpolation fn

Interpolate vectors, optionally set interpolation fn

perpendicularclj

(perpendicular v1)
(perpendicular v1 v2)

Perpendicular vector (only 2d).

Perpendicular vector (only 2d).

as-vecclj

(as-vec v)
(as-vec v xs)

Create vector from sequence as given type.

Create vector from sequence as given type.

mnclj

(mn v1)

Minimum value of vector elements

Minimum value of vector elements

absclj

(abs v1)

Absolute value of vector elements

Absolute value of vector elements

einterpolateclj

(einterpolate v1 v2 v f)

Interpolate vectors element-wise, optionally set interpolation fn

Interpolate vectors element-wise, optionally set interpolation fn

mxclj

(mx v1)

Maximum value of vector elements

Maximum value of vector elements

fmapclj

(fmap v f)

Apply function to all vector values (like map but returns the same type).

Apply function to all vector values (like map but returns the same type).

multclj

(mult v1 v)

Multiply vector by number v.

Multiply vector by number `v`.

rotateclj

(rotate v1 angle)
(rotate v1 anglex angley anglez)

Rotate vector

Rotate vector
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close