Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MoodVector<M>

Type parameters

Hierarchy

  • MoodVector

Implements

Index

Constructors

constructor

  • new MoodVector<M>(array: readonly [M, number][], index: {}): MoodVector<M>
  • Type parameters

    Parameters

    • array: readonly [M, number][]
    • index: {}
      • [name: string]: number | undefined

    Returns MoodVector<M>

Properties

Readonly array

array: readonly [M, number][]

Readonly index

index: {}

Type declaration

  • [name: string]: number | undefined

Accessors

size

  • get size(): number
  • Returns number

Methods

Protected copy

  • copy(array: readonly [M, number][], index?: {}): MoodVector<M>
  • Parameters

    • array: readonly [M, number][]
    • Optional index: {}
      • [name: string]: number | undefined

    Returns MoodVector<M>

debug

  • debug(output: Output<unknown>): void
  • Parameters

    Returns void

dot

  • Parameters

    Returns undefined | number

equals

  • equals(that: unknown): boolean
  • Parameters

    • that: unknown

    Returns boolean

forEach

  • forEach<R>(callback: (value: number, key: M) => void | R): undefined | R
  • forEach<R, S>(callback: (value: number, key: M) => void | R, thisArg: S): undefined | R
  • Type parameters

    • R

    Parameters

    • callback: (value: number, key: M) => void | R
        • (value: number, key: M): void | R
        • Parameters

          • value: number
          • key: M

          Returns void | R

    Returns undefined | R

  • Type parameters

    • R

    • S

    Parameters

    • callback: (value: number, key: M) => void | R
        • (value: number, key: M): void | R
        • Parameters

          • value: number
          • key: M

          Returns void | R

    • thisArg: S

    Returns undefined | R

get

  • get(key: M): undefined | number
  • get(name: string): undefined | number
  • get(index: number): undefined | number
  • Parameters

    • key: M

    Returns undefined | number

  • Parameters

    • name: string

    Returns undefined | number

  • Parameters

    • index: number

    Returns undefined | number

getOr

  • getOr<E>(key: M, elseValue: E): number | E
  • getOr<E>(name: string, elseValue: E): number | E
  • getOr<E>(index: number, elseValue: E): number | E
  • Type parameters

    • E

    Parameters

    • key: M
    • elseValue: E

    Returns number | E

  • Type parameters

    • E

    Parameters

    • name: string
    • elseValue: E

    Returns number | E

  • Type parameters

    • E

    Parameters

    • index: number
    • elseValue: E

    Returns number | E

has

  • has(key: M): boolean
  • has(name: string): boolean
  • Parameters

    • key: M

    Returns boolean

  • Parameters

    • name: string

    Returns boolean

isEmpty

  • isEmpty(): boolean
  • Returns boolean

minus

  • Parameters

    Returns MoodVector<M>

negative

  • Returns MoodVector<M>

plus

  • Parameters

    Returns MoodVector<M>

times

  • Parameters

    • scalar: number

    Returns MoodVector<M>

toString

  • toString(): string
  • Returns string

updated

  • Parameters

    • key: M
    • value: undefined | number

    Returns MoodVector<M>

  • Parameters

    Returns MoodVector<M>

Static empty

  • Type parameters

    Returns MoodVector<M>

Static fromAny

  • Type parameters

    Parameters

    Returns MoodVector<M>

Static fromArray

  • fromArray<M>(array: readonly [M, number][], index?: {}): MoodVector<M>
  • Type parameters

    Parameters

    • array: readonly [M, number][]
    • Optional index: {}
      • [name: string]: number | undefined

    Returns MoodVector<M>

Static index

  • index<M>(array: readonly [M, unknown][]): {}
  • Type parameters

    Parameters

    • array: readonly [M, unknown][]

    Returns {}

    • [name: string]: number | undefined

Static of

  • Type parameters

    Parameters

    • Rest ...keys: [M, number][]

    Returns MoodVector<M>

Generated using TypeDoc