Options
All
  • Public
  • Public/Protected
  • All
Menu

Uses a gradient descent approach to reduce a stress or p-stress goal function over a graph with specified ideal edge lengths or a square matrix of dissimilarities. The standard stress function over a graph nodes with position vectors x,y,z is (mathematica input): stress[x_,y_,z_,D_,w_]:=Sum[w[[i,j]] (length[x[[i]],y[[i]],z[[i]],x[[j]],y[[j]],z[[j]]]-d[[i,j]])^2,{i,Length[x]-1},{j,i+1,Length[x]}] where: D is a square matrix of ideal separations between nodes, w is matrix of weights for those separations length[x1_, y1_, z1_, x2_, y2_, z2_] = Sqrt[(x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2] below, we use wij = 1/(Dij^2)

class

Descent

Hierarchy

  • Descent

Index

Constructors

constructor

  • new Descent(x: number[][], D: number[][], G?: number[][]): Descent
  • method

    constructor

    Parameters

    • x: number[][]

      initial coordinates for nodes

    • D: number[][]

      matrix of desired distances between pairs of nodes

    • Default value G: number[][] = null

      [default=null] if specified, G is a matrix of weights for goal terms between pairs of nodes. If G[i][j] > 1 and the separation between nodes i and j is greater than their ideal distance, then there is no contribution for this pair to the goal If G[i][j] <= 1 then it is used as a weighting on the contribution of the variance between ideal and actual separation between i and j to the goal function

    Returns Descent

Properties

D

D: number[][]

matrix of desired distances between pairs of nodes

G

G: number[][]

[default=null] if specified, G is a matrix of weights for goal terms between pairs of nodes. If G[i][j] > 1 and the separation between nodes i and j is greater than their ideal distance, then there is no contribution for this pair to the goal If G[i][j] <= 1 then it is used as a weighting on the contribution of the variance between ideal and actual separation between i and j to the goal function

H

H: number[][][]

Hessian Matrix

property

H {number[][][]}

Private Hd

Hd: number[][]

Private a

a: number[][]

Private b

b: number[][]

Private c

c: number[][]

Private d

d: number[][]

Private e

e: number[][]

g

g: number[][]

gradient vector

property

G {number[][]}

Private ia

ia: number[][]

Private ib

ib: number[][]

k

k: number
property

k {number} dimensionality

locks

locks: Locks

Private minD

minD: number

n

n: number

number of data-points / nodes / size of vectors/matrices

property

n {number}

numGridSnapNodes

numGridSnapNodes: number = 0

project

project: function[] = null

Private random

random: PseudoRandom = new PseudoRandom()

scaleSnapByMaxH

scaleSnapByMaxH: boolean = false

snapGridSize

snapGridSize: number = 100

snapStrength

snapStrength: number = 1000

threshold

threshold: number = 0.0001

x

x: number[][]

positions vector

property

x {number[][]}

Private xtmp

xtmp: number[][]

Static Private zeroDistance

zeroDistance: number = 1e-10

Methods

computeDerivatives

  • computeDerivatives(x: number[][]): void

Private computeNextPosition

  • computeNextPosition(x0: number[][], r: number[][]): void
  • Parameters

    • x0: number[][]
    • r: number[][]

    Returns void

computeStepSize

  • computeStepSize(d: number[][]): number

computeStress

  • computeStress(): number

Private matrixApply

  • matrixApply(f: function): void
  • Parameters

    • f: function
        • (i: number, j: number): any
        • Parameters

          • i: number
          • j: number

          Returns any

    Returns void

Private offsetDir

  • offsetDir(): number[]

reduceStress

  • reduceStress(): number

run

  • run(iterations: number): number
  • Parameters

    • iterations: number

    Returns number

rungeKutta

  • rungeKutta(): number

Private stepAndProject

  • stepAndProject(x0: number[][], r: number[][], d: number[][], stepSize: number): void
  • Parameters

    • x0: number[][]
    • r: number[][]
    • d: number[][]
    • stepSize: number

    Returns void

takeDescentStep

  • takeDescentStep(x: number[], d: number[], stepSize: number): void
  • Parameters

    • x: number[]
    • d: number[]
    • stepSize: number

    Returns void

Static Private copy

  • copy(a: number[][], b: number[][]): void
  • Parameters

    • a: number[][]
    • b: number[][]

    Returns void

Static createSquareMatrix

  • createSquareMatrix(n: number, f: function): number[][]
  • Parameters

    • n: number
    • f: function
        • (i: number, j: number): number
        • Parameters

          • i: number
          • j: number

          Returns number

    Returns number[][]

Static Private dotProd

  • dotProd(a: number[], b: number[]): number
  • Parameters

    • a: number[]
    • b: number[]

    Returns number

Static Private mApply

  • mApply(m: number, n: number, f: function): void
  • Parameters

    • m: number
    • n: number
    • f: function
        • (i: number, j: number): any
        • Parameters

          • i: number
          • j: number

          Returns any

    Returns void

Static Private mid

  • mid(a: number[][], b: number[][], m: number[][]): void
  • Parameters

    • a: number[][]
    • b: number[][]
    • m: number[][]

    Returns void

Static Private rightMultiply

  • rightMultiply(m: number[][], v: number[], r: number[]): void
  • Parameters

    • m: number[][]
    • v: number[]
    • r: number[]

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc