Link Search Menu Expand Document

number overview

Typeclass instances for Javascript’s 64-bit floating point number type. Note: instances are not strictly law abiding as floating point error violates particular instance laws with more complex computation.

Added in v1.0.0


Table of contents


Aliases

add

Signature

export declare const add: (x: number, y: number) => number

Added in v1.0.0

degree

Signature

export declare const degree: (a: number) => number

Added in v1.0.0

div

Signature

export declare const div: (x: number, y: number) => number

Added in v1.0.0

mod

Signature

export declare const mod: (x: number, y: number) => number

Added in v1.0.0

mul

Signature

export declare const mul: (x: number, y: number) => number

Added in v1.0.0

sub

Signature

export declare const sub: (x: number, y: number) => number

Added in v1.0.0

Constructors

one

Signature

export declare const one: 1

Added in v1.0.0

onesN

Signature

export declare const onesN: <N extends number>(n: N) => Vec<N>

Added in v1.1.0

randExp

Exponential random variable with parameter λ

Signature

export declare const randExp: (λ: number) => IO.IO<number>

Added in v1.1.0

randNorm

Normal random variable with mean μ and standard deviation σ. Uses the Box-Muller transform

Signature

export declare const randNorm: (μ?: number | undefined, σ?: number | undefined) => IO.IO<number>

Added in v1.1.0

randNumber

Uniform random variable in the interval: [low, high)

Signature

export declare const randNumber: (low: number, high: number) => IO.IO<number>

Added in v1.0.0

zero

Signature

export declare const zero: 0

Added in v1.0.0

zerosN

Signature

export declare const zerosN: <N extends number>(n: N) => Vec<N>

Added in v1.1.0

Infix

$_

Signature

export declare const $_: (s: Inf.FieldSymbol, x: number, y: number) => number

Added in v1.0.0

_

Signature

export declare const _: (a: number, s: Inf.FieldSymbol, b: number) => number

Added in v1.0.0

_$

Signature

export declare const _$: (a: number, b: number, s: Inf.FieldSymbol) => number

Added in v1.0.0

Instances

AdditiveAbGrpMN

Signature

export declare const AdditiveAbGrpMN: <M, N>(m: M, n: N) => AbelianGroup<M.Mat<M, N, number>>

Added in v1.0.0

AdditiveAbGrpN

Signature

export declare const AdditiveAbGrpN: <N>(n: N) => AbelianGroup<V.Vec<N, number>>

Added in v1.0.0

BiModMN

Signature

export declare const BiModMN: <M, N>(m: M, n: N) => Bimodule<M.Mat<M, N, number>, number, number>

Added in v1.0.0

BiModN

Signature

export declare const BiModN: <N>(n: N) => Bimodule<V.Vec<N, number>, number, number>

Added in v1.0.0

Bounded

Signature

export declare const Bounded: Bounded<number>

Added in v1.0.0

Eq

Signature

export declare const Eq: Eq<number>

Added in v1.0.0

Field

Signature

export declare const Field: Field<number>

Added in v1.0.0

MagmaSub

Signature

export declare const MagmaSub: Magma<number>

Added in v1.0.0

MonoidProduct

Signature

export declare const MonoidProduct: Monoid<number>

Added in v1.0.0

MonoidProductMM

Signature

export declare const MonoidProductMM: <M>(m: M) => Monoid<M.Mat<M, M, number>>

Added in v1.1.0

MonoidSum

Signature

export declare const MonoidSum: Monoid<number>

Added in v1.0.0

Ord

Signature

export declare const Ord: Ord<number>

Added in v1.0.0

PolynomialAdditiveAbelianGroup

Signature

export declare const PolynomialAdditiveAbelianGroup: AbelianGroup<Poly.Polynomial<number>>

Added in v1.0.0

PolynomialBimodule

Signature

export declare const PolynomialBimodule: Bimodule<Poly.Polynomial<number>, number, number>

Added in v1.0.0

PolynomialEuclidianRing

Signature

export declare const PolynomialEuclidianRing: EuclidianRing<Poly.Polynomial<number>>

Added in v1.0.0

PolynomialRing

Signature

export declare const PolynomialRing: CommutativeRing<Poly.Polynomial<number>>

Added in v1.0.0

SemigroupProduct

Signature

export declare const SemigroupProduct: Semigroup<number>

Added in v1.0.0

SemigroupSum

Signature

export declare const SemigroupSum: Semigroup<number>

Added in v1.0.0

Show

Signature

export declare const Show: Show<number>

Added in v1.0.0

get2dRotation

Signature

export declare const get2dRotation: (theta: number) => Auto.Automorphism<V.Vec<2, number>>

Added in v1.0.0

get3dXRotation

Signature

export declare const get3dXRotation: (theta: number) => Auto.Automorphism<V.Vec<3, number>>

Added in v1.0.0

get3dYRotation

Signature

export declare const get3dYRotation: (theta: number) => Auto.Automorphism<V.Vec<3, number>>

Added in v1.0.0

get3dZRotation

Signature

export declare const get3dZRotation: (theta: number) => Auto.Automorphism<V.Vec<3, number>>

Added in v1.0.0

getDifferentialAutomorphism

Signature

export declare const getDifferentialAutomorphism: (constantTerm: number) => Auto.Automorphism<Poly.Polynomial<number>>

Added in v1.0.0

Matrix Operations

addM

Add two matricies

Signature

export declare const addM: <M, N>(x: M.Mat<M, N, number>, y: M.Mat<M, N, number>) => M.Mat<M, N, number>

Added in v1.1.0

addV

Add two vectors

Signature

export declare const addV: <N>(x: V.Vec<N, number>, y: V.Vec<N, number>) => V.Vec<N, number>

Added in v1.1.0

idMat

Signature

export declare const idMat: <M>(m: M) => M.Mat<M, M, number>

Added in v1.0.0

linMap

Transform a column vector x into vector b by matrix A

Ax = b

Efficiency: 2mn flops

Signature

export declare const linMap: <M, N1, N2>(A: M.Mat<M, N1, number>, x: V.Vec<N2, number>) => V.Vec<M, number>

Added in v1.0.0

linMapR

Transform a row-vector x into vector b by matrix A

xA = b

Efficiency: 2mn flops

Signature

export declare const linMapR: <M, N1, N2>(x: V.Vec<N1, number>, A: M.Mat<N2, M, number>) => V.Vec<M, number>

Added in v1.1.0

mulM

Multiply two matricies with matching inner dimensions

(A ∈ R_mn) (B ∈ R_np) = C ∈ R_mp

Efficiency: 2mpn flops

Signature

export declare const mulM: <M, N1, N2, P>(x: M.Mat<M, N1, number>, y: M.Mat<N2, P, number>) => M.Mat<M, P, number>

Added in v1.0.0

subM

Subtract two matricies

Signature

export declare const subM: <M, N>(x: M.Mat<M, N, number>, y: M.Mat<M, N, number>) => M.Mat<M, N, number>

Added in v1.1.0

subV

Subtract two vectors

Signature

export declare const subV: <N>(x: V.Vec<N, number>, y: V.Vec<N, number>) => V.Vec<N, number>

Added in v1.1.0

trace

The sum of the diagonal elements

Efficiency: m flops (for numeric Ring)

Signature

export declare const trace: <M>(fa: M.Mat<M, M, number>) => number

Added in v1.0.0

Model

Mat (type alias)

Signature

export type Mat<M, N> = M.Mat<M, N, number>

Added in v1.0.0

Vec (type alias)

Signature

export type Vec<N> = V.Vec<N, number>

Added in v1.0.0

Polynomial Operations

derivative

Signature

export declare const derivative: (coeffs: Poly.Polynomial<number>) => Poly.Polynomial<number>

Added in v1.0.0

evaluatePolynomial

Signature

export declare const evaluatePolynomial: (p: Poly.Polynomial<number>) => (x: number) => number

Added in v1.0.0

getAntiderivative

Signature

export declare const getAntiderivative: (
  constantTerm: number
) => (p: Poly.Polynomial<number>) => Poly.Polynomial<number>

Added in v1.0.0

integrate

Signature

export declare const integrate: (lower: number, upper: number) => (p: Poly.Polynomial<number>) => number

Added in v1.0.0

polynomialInnerProduct

Signature

export declare const polynomialInnerProduct: (p: Poly.Polynomial<number>, q: Poly.Polynomial<number>) => number

Added in v1.0.0

polynomialNorm

Signature

export declare const polynomialNorm: (p: Poly.Polynomial<number>) => number

Added in v1.0.0

polynomialProjection

Signature

export declare const polynomialProjection: (
  p: Poly.Polynomial<number>,
  q: Poly.Polynomial<number>
) => Poly.Polynomial<number>

Added in v1.0.0

Vector Operations

cross

Signature

export declare const cross: (x: V.Vec<3, number>, y: V.Vec<3, number>) => V.Vec<3, number>

Added in v1.0.0

dot

Signature

export declare const dot: <N>(x: V.Vec<N, number>, y: V.Vec<N, number>) => number

Added in v1.0.0

l1Norm

Signature

export declare const l1Norm: <N>(x: V.Vec<N, number>) => number

Added in v1.0.0

l2Norm

Signature

export declare const l2Norm: <N>(x: V.Vec<N, number>) => number

Added in v1.0.0

lInfNorm

Signature

export declare const lInfNorm: <N>(x: V.Vec<N, number>) => number

Added in v1.0.0

lpNorm

Signature

export declare const lpNorm: (p: number) => <N>(v: V.Vec<N, number>) => number

Added in v1.0.0

outerProduct

Signature

export declare const outerProduct: <M, N>(v1: V.Vec<M, number>, v2: V.Vec<N, number>) => M.Mat<M, N, number>

Added in v1.0.0

projection

Signature

export declare const projection: <N>(u: V.Vec<N, number>, v: V.Vec<N, number>) => V.Vec<N, number>

Added in v1.0.0