Categorygithub.com/pbenner/autodiff
modulepackage
1.0.3
Repository: https://github.com/pbenner/autodiff.git
Documentation: pkg.go.dev

# README

Documentation

Autodiff is a numerical optimization and linear algebra library for the Go / Golang programming language. It implements basic automatic differentation for many mathematical routines. The documentation of this package can be found here.

Scalars

Autodiff defines three different scalar types. A Scalar contains a single mutable value that can be the result of a mathematical operation, whereas the value of a ConstScalar is constant and fixed when the scalar is created. Automatic differentiation is implemented by MagicScalar types that allow to compute first and second order derivatives. Autodiff supports the following scalars types:

ScalarImplemented interfaces
ConstInt8ConstScalar
ConstInt16ConstScalar
ConstInt32ConstScalar
ConstInt64ConstScalar
ConstIntConstScalar
ConstFloat32ConstScalar
ConstFloat64ConstScalar
Int8ConstScalar, Scalar
Int16ConstScalar, Scalar
Int32ConstScalar, Scalar
Int64ConstScalar, Scalar
IntConstScalar, Scalar
Float32ConstScalar, Scalar
Float64ConstScalar, Scalar
Real32ConstScalar, Scalar, MagicScalar
Real64ConstScalar, Scalar, MagicScalar

The ConstScalar, Scalar and MagicScalar interfaces define the following operations:

FunctionDescription
GetInt8Get value as int8
GetInt16Get value as int16
GetInt32Get value as int32
GetInt64Get value as int64
GetIntGet value as int
GetFloat32Get value as float32
GetFloat64Get value as float64
EqualsCheck if two constants are equal
GreaterTrue if first constant is greater
SmallerTrue if first constant is smaller
SignReturns the sign of the scalar

The Scalar and MagicScalar interfaces define the following operations:

FunctionDescription
SetInt8Set value by passing an int8 variable
SetInt16Set value by passing an int16 variable
SetInt32Set value by passing an int32 variable
SetInt64Set value by passing an int64 variable
SetIntSet value by passing an int variable
SetFloat32Set value by passing an float32 variable
SetFloat64Set value by passing an float64 variable

The Scalar and MagicScalar interfaces define the following mathematical operations:

FunctionDescription
MinMinimum
MaxMaximum
AbsAbsolute value
SignSign
NegNegation
AddAddition
SubSubstraction
MulMultiplication
DivDivision
PowPower
SqrtSquare root
ExpExponential function
LogLogarithm
Log1pLogarithm of 1+x
Log1pExpLogarithm of 1+Exp(x)
LogisticStandard logistic function
ErfError function
ErfcComplementary error function
LogErfcLog complementary error function
SigmoidNumerically stable sigmoid function
SinSine
SinhHyperbolic sine
CosCosine
CoshHyperbolic cosine
TanTangent
TanhHyperbolic tangent
LogAddAddition on log scale
LogSubSubstraction on log scale
SmoothMaxDifferentiable maximum
LogSmoothMaxDifferentiable maximum on log scale
GammaGamma function
LgammaLog gamma function
MlgammaMultivariate log gamma function
GammaPLower incomplete gamma function
BesselIModified Bessel function of the first kind
LogBesselILog of the Modified Bessel function of the first kind

Vectors and Matrices

Autodiff implements dense and sparse vectors and matrices that support basic linear algebra operations. The following vector and matrix types are provided by autodiff:

TypeScalarDescription
DenseInt8VectorInt8Dense vector of Int8 scalars
DenseInt16VectorInt16Dense vector of Int16 scalars
DenseInt32VectorInt32Dense vector of Int32 scalars
DenseInt64VectorInt64Dense vector of Int64 scalars
DenseIntVectorIntDense vector of Int scalars
DenseFloat32VectorFloat32Dense vector of Float32 scalars
DenseFloat64VectorFloat64Dense vector of Float64 scalars
DenseReal32VectorReal32Dense vector of Real32 scalars
DenseReal64VectorReal64Dense vector of Real64 scalars
SparseInt8VectorInt8Sparse vector of Int8 scalars
SparseInt16VectorInt16Sparse vector of Int16 scalars
SparseInt32VectorInt32Sparse vector of Int32 scalars
SparseInt64VectorInt64Sparse vector of Int64 scalars
SparseIntVectorIntSparse vector of Int scalars
SparseFloat32VectorFloat32Sparse vector of Float32 scalars
SparseFloat64VectorFloat64Sparse vector of Float64 scalars
SparseReal32VectorReal32Sparse vector of Real32 scalars
SparseReal64VectorReal64Sparse vector of Real64 scalars
SparseConstInt8VectorConstInt8Sparse vector of ConstInt8 scalars
SparseConstInt16VectorConstInt16Sparse vector of ConstInt16 scalars
SparseConstInt32VectorConstInt32Sparse vector of ConstInt32 scalars
SparseConstInt64VectorConstInt64Sparse vector of ConstInt64 scalars
SparseConstIntVectorConstIntSparse vector of ConstInt scalars
SparseConstFloat32VectorConstFloat32Sparse vector of ConstFloat32 scalars
SparseConstFloat64VectorConstFloat64Sparse vector of ConstFloat64 scalars
DenseInt8MatrixInt8Dense matrix of Int8 scalars
DenseInt16MatrixInt16Dense matrix of Int16 scalars
DenseInt32MatrixInt32Dense matrix of Int32 scalars
DenseInt64MatrixInt64Dense matrix of Int64 scalars
DenseIntMatrixIntDense matrix of Int scalars
DenseFloat32MatrixFloat32Dense matrix of Float32 scalars
DenseFloat64MatrixFloat64Dense matrix of Float64 scalars
DenseReal32MatrixReal32Dense matrix of Real32 scalars
DenseReal64MatrixReal64Dense matrix of Real64 scalars
SparseInt8MatrixInt8Sparse matrix of Int8 scalars
SparseInt16MatrixInt16Sparse matrix of Int16 scalars
SparseInt32MatrixInt32Sparse matrix of Int32 scalars
SparseInt64MatrixInt64Sparse matrix of Int64 scalars
SparseIntMatrixIntSparse matrix of Int scalars
SparseFloat32MatrixFloat32Sparse matrix of Float32 scalars
SparseFloat64MatrixFloat64Sparse matrix of Float64 scalars
SparseReal32MatrixReal32Sparse matrix of Real32 scalars
SparseReal64MatrixReal64Sparse matrix of Real64 scalars

Autodiff defines three vector interfaces ConstVector, Vector, and MagicVector:

InterfaceFunctionDescription
ConstVectorDimReturn the length of the vector
ConstVectorEqualsReturns true if the two vectors are equal
ConstVectorTableConverts vector to a string
ConstVectorInt8AtReturns the scalar at the given position as int8
ConstVectorInt16AtReturns the scalar at the given position as int16
ConstVectorInt32AtReturns the scalar at the given position as int32
ConstVectorInt64AtReturns the scalar at the given position as int64
ConstVectorIntAtReturns the scalar at the given position as int
ConstVectorFloat32AtReturns the scalar at the given position as Float32
ConstVectorFloat64AtReturns the scalar at the given position as Float64
ConstVectorConstAtReturns the scalar at the given position as ConstScalar
ConstVectorConstSliceReturns a slice as a constant vector (ConstVector)
ConstVectorAsConstMatrixConvert vector to a matrix of type ConstMatrix
ConstVectorConstIteratorReturns a constant iterator
ConstVectorCloneConstVectorReturn a deep copy of the vector as ConstVector
ConstVector, VectorAtReturn the scalar the given index
ConstVector, VectorResetSet all scalars to zero
ConstVector, VectorSetSet the value and derivatives of a scalar
ConstVector, VectorSliceReturn a slice of the vector
ConstVector, VectorExportExport vector to file
ConstVector, VectorPermutePermute elements of the vector
ConstVector, VectorReverseOrderReverse the order of vector elements
ConstVector, VectorSortSort vector elements
ConstVector, VectorAppendScalarAppend a single scalar to the vector
ConstVector, VectorAppendVectorAppend another vector
ConstVector, VectorSwapSwap two elements of the vector
ConstVector, VectorAsMatrixConvert vector to a matrix
ConstVector, VectorIteratorReturns an iterator
ConstVector, VectorCloneVectorReturn a deep copy of the vector as Vector
ConstVector, Vector, MagicVectorMagicAtReturns the scalar at the given position as MagicScalar
ConstVector, Vector, MagicVectorMagicSliceResutns a slice as a magic vector (MagicVector)
ConstVector, Vector, MagicVectorAppendMagicScalarAppend a single magic scalar
ConstVector, Vector, MagicVectorAppendMagicVectorAppend a magic vector
ConstVector, Vector, MagicVectorAsMagicMatrixConvert vector to a matrix of type MagicMatrix
ConstVector, Vector, MagicVectorCloneMagicVectorReturn a deep copy of the vector as MagicVector

Vectors support the following mathematical operations:

FunctionDescription
VaddVElement-wise addition
VsubVElement-wise substraction
VmulVElement-wise multiplication
VdivVElement-wise division
VaddSAddition of a scalar
VsubSSubstraction of a scalar
VmulSMultiplication with a scalar
VdivSDivision by a scalar
VdotVDot product

Autodiff defines three matrix interfaces ConstMatrix, Matrix, and MagicMatrix:

InterfaceFunctionDescription
ConstMatrixDimsReturn the number of rows and columns of the matrix
ConstMatrixEqualsReturns true if the two matrixs are equal
ConstMatrixTableConverts matrix to a string
ConstMatrixInt8AtReturns the scalar at the given position as int8
ConstMatrixInt16AtReturns the scalar at the given position as int16
ConstMatrixInt32AtReturns the scalar at the given position as int32
ConstMatrixInt64AtReturns the scalar at the given position as int64
ConstMatrixIntAtReturns the scalar at the given position as int
ConstMatrixFloat32AtReturns the scalar at the given position as Float32
ConstMatrixFloat64AtReturns the scalar at the given position as Float64
ConstMatrixConstAtReturns the scalar at the given position as ConstScalar
ConstMatrixConstSliceReturns a slice as a constant matrix (ConstMatrix)
ConstMatrixConstRowReturns the ith row as a ConstVector
ConstMatrixConstColReturns the jth column as a ConstVector
ConstMatrixConstIteratorReturns a constant iterator
ConstMatrixAsConstVectorConvert matrix to a vector of type ConstVector
ConstMatrixCloneConstMatrixReturn a deep copy of the matrix as ConstMatrix
ConstMatrix, MatrixAtReturn the scalar the given index
ConstMatrix, MatrixResetSet all scalars to zero
ConstMatrix, MatrixSetSet the value and derivatives of a scalar
ConstMatrix, MatrixSliceReturn a slice of the matrix
ConstMatrix, MatrixExportExport matrix to file
ConstMatrix, MatrixPermutePermute elements of the matrix
ConstMatrix, MatrixReverseOrderReverse the order of matrix elements
ConstMatrix, MatrixSortSort matrix elements
ConstMatrix, MatrixAppendScalarAppend a single scalar to the matrix
ConstMatrix, MatrixAppendMatrixAppend another matrix
ConstMatrix, MatrixSwapSwap two elements of the matrix
ConstMatrix, MatrixSwapRowsSwap two rows
ConstMatrix, MatrixSwapColsSwap two columns
ConstMatrix, MatrixPermuteRowsPermute rows
ConstMatrix, MatrixPermuteColsPermute columns
ConstMatrix, MatrixRowReturns a copy of the ith row as a Vector
ConstMatrix, MatrixColReturns a copy of the jth column a Vector
ConstMatrix, MatrixTReturns a transposed matrix
ConstMatrix, MatrixTipTranspose in-place
ConstMatrix, MatrixAsVectorConvert matrix to a vector of type Vector
ConstMatrix, MatrixIteratorReturns an iterator
ConstMatrix, MatrixCloneMatrixReturn a deep copy of the matrix as Matrix
ConstMatrix, Matrix, MagicMatrixMagicAtReturns the scalar at the given position as MagicScalar
ConstMatrix, Matrix, MagicMatrixMagicSliceResutns a slice as a magic matrix (MagicMatrix)
ConstMatrix, Matrix, MagicMatrixMagicTReturns a transposed matrix of type MagicMatrix
ConstMatrix, Matrix, MagicMatrixAppendMagicScalarAppend a single magic scalar
ConstMatrix, Matrix, MagicMatrixAppendMagicMatrixAppend a magic matrix
ConstMatrix, Matrix, MagicMatrixCloneMagicMatrixReturn a deep copy of the matrix as MagicMatrix

Matrices support the following linear algebra operations:

FunctionDescription
MaddMElement-wise addition
MsubMElement-wise substraction
MmulMElement-wise multiplication
MdivMElement-wise division
MaddSAddition of a scalar
MsubSSubstraction of a scalar
MmulSMultiplication with a scalar
MdivSDivision by a scalar
MdotMMatrix product
OuterOuter product

Methods, such as VaddV and MaddM, are generic and accept vector or matrix types that implement the respective ConstVector or ConstMatrix interface. However, opertions on interface types are much slower than on concrete types, which is why most vector and matrix types in autodiff also implement methods that operate on concrete types. For instance, DenseFloat64Vector implements a method called VADDV that takes as arguments two objects of type DenseFloat64Vector. Methods that operate on concrete types are always named in capital letters.

Algorithms

The algorithms package contains more complex linear algebra and optimization routines:

PackageDescription
bfgsBroyden-Fletcher-Goldfarb-Shanno (BFGS) algorithm
blahutBlahut algorithm (channel capacity)
choleskyCholesky and LDL factorization
determinantMatrix determinants
eigensystemCompute Eigenvalues and Eigenvectors
gaussJordanGauss-Jordan algorithm
gradientDescentVanilla gradient desent algorithm
gramSchmidtGram-Schmidt algorithm
hessenbergReductionMatrix Hessenberg reduction
lineSearchLine-search (satisfying the Wolfe conditions)
matrixInverseMatrix inverse
msqrtMatrix square root
msqrtInvInverse matrix square root
newtonNewton's method (root finding and optimization)
qrAlgorithmQR-Algorithm for computing Schur decompositions
rpropResilient backpropagation
svdSingular Value Decomposition (SVD)
sagaSAGA stochastic average gradient descent method

Basic usage

Import the autodiff library with

  import . "github.com/pbenner/autodiff"

A scalar holding the value 1.0 can be defined in several ways, i.e.

  a := NullScalar(Real64Type)
  a.SetFloat64(1.0)
  b := NewReal64(1.0)
  c := NewFloat64(1.0)

a and b are both MagicScalars, however a has type Scalar whereas b has type *Real64 which implements the Scalar interface. Variable c is of type Float64 which cannot carry any derivatives. Basic operations such as additions are defined on all Scalars, i.e.

  a.Add(a, b)

which stores the result of adding a and b in a. The ConstFloat64 type allows to define float64 constants without allocation of additional memory. For instance

  a.Add(a, ConstFloat64(1.0))

adds a constant value to a where a type cast is used to define the constant 1.0.

To differentiate a function f(x,y) = x y^3 + 4, we define

  f := func(x, y ConstScalar) MagicScalar {
    // compute f(x,y) = x*y^3 + 4
    z := NewReal64()
    z.Pow(y, ConstFloat64(3.0))
    z.Mul(z, x)
    z.Add(z, ConstFloat64(4.0))
    return z
  }

that accepts as arguments two ConstScalar variables and returns a MagicScalar. We first define two MagicReal variables

  x := NewReal64(2)
  y := NewReal64(4)

that store the value at which the derivatives should be evaluated. Afterwards, x and y must be activated with

  Variables(2, x, y)

where the first argument sets the order of the derivatives. Variables() should only be called once, as it allocates memory for the given magic variables. In this case, derivatives up to second order are computed. After evaluating f, i.e.

  z := f(x, y)

the function value at (x,y) = (2, 4) can be retrieved with z.GetFloat64(). The first and second partial derivatives can be accessed with z.GetDerivative(i) and z.GetHessian(i, j), where the arguments specify the index of the variable. For instance, the derivative of f with respect to x is returned by z.GetDerivative(0), whereas the derivative with respect to y by z.GetDerivative(1).

Basic linear algebra

Vectors and matrices can be created with

  v := NewDenseFloat64Vector([]float64{1,2})
  m := NewDenseFloat64Matrix([]float64{1,2,3,4}, 2, 2)

  v_ := NewDenseReal64Vector([]float64{1,2})
  m_ := NewDenseReal64Matrix([]float64{1,2,3,4}, 2, 2)

where v has length 2 and m is a 2x2 matrix. With

  v := NullDenseFloat64Vector(2)
  m := NullDenseFloat64Matrix(2, 2)

all values are initially set to zero. Vector and matrix elements can be accessed with the At, MagicAt or ConstAt methods, which return a reference to the scalar implementing either a Scalar, MagicScalar or ConstScalar, i.e.

  m.At(1,1).Add(v.ConstAt(0), v.ConstAt(1))

adds the first two values in v and stores the result in the lower right element of the matrix m. Autodiff supports basic linear algebra operations, for instance, the vector matrix product can be computed with

  w := NullDenseFloat64Vector(2)
  w.MdotV(m, v)

where the result is stored in w. Other operations, such as computing the eigenvalues and eigenvectors of a matrix, require importing the respective package from the algorithm library, i.e.

  import "github.com/pbenner/autodiff/algorithm/eigensystem"

  lambda, _, _ := eigensystem.Run(m)

Examples

Gradient descent

Compare vanilla gradient descent with resilient backpropagation

  import . "github.com/pbenner/autodiff"
  import   "github.com/pbenner/autodiff/algorithm/gradientDescent"
  import   "github.com/pbenner/autodiff/algorithm/rprop"

  f := func(x_ ConstVector) MagicScalar {
    x := x_.ConstAt(0)
    // x^4 - 3x^3 + 2
    r := NewReal64()
    s := NewReal64()
    r.Pow(x.ConstAt(0), ConstFloat64(4.0)
    s.Mul(ConstFloat64(3.0), s.Pow(x, ConstFloat64(3.0)))
    r.Add(ConstFloat64(2.0), r.Add(r, s))
    return r
  }
  x0 := NewDenseFloat64Vector([]float64{8})
  // vanilla gradient descent
  xn1, _ := gradientDescent.Run(f, x0, 0.0001, gradientDescent.Epsilon{1e-8})
  // resilient backpropagation
  xn2, _ := rprop.Run(f, x0, 0.0001, 0.4, rprop.Epsilon{1e-8})

Gradient descent

Matrix inversion

Compute the inverse r of a matrix m by minimizing the Frobenius norm ||mb - I||

  import . "github.com/pbenner/autodiff"
  import   "github.com/pbenner/autodiff/algorithm/rprop"

  // define matrix r
  m := NewDenseFloat64Matrix([]float64{1,2,3,4}, 2, 2)
  // create identity matrix I
  I := NullDenseFloat64Matrix(2, 2)
  I.SetIdentity()

  // magic variables for computing the Frobenius norm and its derivative
  t := NewDenseReal64Matrix(2, 2)
  s := NewReal64()
  // objective function
  f := func(x ConstVector) MagicScalar {
    t.Set(x)
    s.Mnorm(t.MsubM(t.MmulM(m, t), I))
    return s
  }
  r, _ := rprop.Run(f, r.GetValues(), 0.01, 0.1, rprop.Epsilon{1e-12})

Newton's method

Find the root of a function f with initial value x0 = (1,1)

  import . "github.com/pbenner/autodiff"
  import   "github.com/pbenner/autodiff/algorithm/newton"

  t := NullReal64()

  f := func(x ConstVector) MagicVector {
    x1 := x.ConstAt(0)
    x2 := x.ConstAt(1)
    y  := NullDenseReal64Vector(2)
    y1 := y.At(0)
    y2 := y.At(1)
    // y1 = x1^2 + x2^2 - 6
    t .Pow(x1, ConstFloat64(2.0))
    y1.Add(y1, t)
    t .Pow(x2, ConstFloat64(2.0))
    y1.Add(y1, t)
    y1.Sub(y1, ConstFloat64(6.0))
    // y2 = x1^3 - x2^2
    t .Pow(x1, ConstFloat64(3.0))
    y2.Add(y2, t)
    t .Pow(x2, ConstFloat64(2.0))
    y2.Sub(y2, t)

    return y
  }

  x0    := NewDenseFloat64Vector([]float64{1,1})
  xn, _ := newton.RunRoot(f, x0, newton.Epsilon{1e-8})

Minimize Rosenbrock's function

Compare Newton's method, BFGS and Rprop for minimizing Rosenbrock's function

  import   "fmt"

  import . "github.com/pbenner/autodiff"
  import   "github.com/pbenner/autodiff/algorithm/rprop"
  import   "github.com/pbenner/autodiff/algorithm/bfgs"
  import   "github.com/pbenner/autodiff/algorithm/newton"

  f := func(x ConstVector) (MagicScalar, error) {
    // f(x1, x2) = (a - x1)^2 + b(x2 - x1^2)^2
    // a = 1
    // b = 100
    // minimum: (x1,x2) = (a, a^2)
    a := ConstFloat64(  1.0)
    b := ConstFloat64(100.0)
    c := ConstFloat64(  2.0)
    s := NullReal64()
    t := NullReal64()
    s.Pow(s.Sub(a, x.ConstAt(0)), c)
    t.Mul(b, t.Pow(t.Sub(x.ConstAt(1), t.Mul(x.ConstAt(0), x.ConstAt(0))), c))
    s.Add(s, t)
    return s, nil
  }
  hook_rprop := func(gradient, step []float64, x ConstVector, y ConstScalar) bool {
    fmt.Fprintf(fp1, "%s\n", x.Table())
    fmt.Println("x       :", x)
    fmt.Println("gradient:", gradient)
    fmt.Println("y       :", y)
    fmt.Println()
    return false
  }
  hook_bfgs := func(x, gradient ConstVector, y ConstScalar) bool {
    fmt.Fprintf(fp2, "%s\n", x.Table())
    fmt.Println("x       :", x)
    fmt.Println("gradient:", gradient)
    fmt.Println("y       :", y)
    fmt.Println()
    return false
  }
  hook_newton := func(x, gradient ConstVector, hessian ConstMatrix, y ConstScalar) bool {
    fmt.Fprintf(fp3, "%s\n", x.Table())
    fmt.Println("x       :", x)
    fmt.Println("gradient:", gradient)
    fmt.Println("y       :", y)
    fmt.Println()
    return false
  }

  x0 := NewDenseFloat64Vector([]float64{-0.5, 2})

  rprop.Run(f, x0, 0.05, []float64{1.2, 0.8},
    rprop.Hook{hook_rprop},
    rprop.Epsilon{1e-10})

  bfgs.Run(f, x0,
    bfgs.Hook{hook_bfgs},
    bfgs.Epsilon{1e-10})

  newton.RunMin(f, x0,
    newton.HookMin{hook_newton},
    newton.Epsilon{1e-8},
    newton.HessianModification{"LDL"})

Gradient descent

Constrained optimization

Maximize the function f(x, y) = x + y subject to x^2 + y^2 = 1 by finding the critical point of the corresponding Lagrangian

  import . "github.com/pbenner/autodiff"
  import   "github.com/pbenner/autodiff/algorithm/newton"

  z := NullReal64()
  t := NullReal64()
  // define the Lagrangian
  f := func(x_ ConstVector) (MagicScalar, error) {
    // z = x + y + lambda(x^2 + y^2 - 1)
    x      := x_.ConstAt(0)
    y      := x_.ConstAt(1)
    lambda := x_.ConstAt(2)
    z.Reset()
    t.Pow(x, ConstFloat64(2.0))
    z.Add(z, t)
    t.Pow(y, ConstFloat64(2.0))
    z.Add(z, t)
    z.Sub(z, ConstFloat64(1.0))
    z.Mul(z, lambda)
    z.Add(z, y)
    z.Add(z, x)

    return z, nil
  }
  // initial value
  x0    := NewDenseFloat64Vector([]float64{3,  5, 1})
  // run Newton's method
  xn, _ := newton.RunCrit(
      f, x0,
      newton.Epsilon{1e-8})

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
Convert vector type.
Convert vector type.
Convert vector type.
Convert vector type.
Convert vector type.
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Convert vector type.
No description provided by the author
Convert vector type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
No description provided by the author
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
No description provided by the author
constructors * -------------------------------------------------------------------------- */ Create a new real constant or variable.
constructors * -------------------------------------------------------------------------- */ Create a new real constant or variable.
No description provided by the author
Allocate a new vector.
Allocate a new vector.
Allocate a new vector.
Allocate a new vector.
Allocate a new vector.
Allocate a new vector.
Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */ Allocate a new vector.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Allocate a new vector.
No description provided by the author
Allocate a new vector.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Allocate a new vector.
No description provided by the author
Allocate a new vector.
No description provided by the author
Allocate a new vector.
No description provided by the author
Allocate a new vector.
No description provided by the author
Allocate a new vector.
No description provided by the author
Allocate a new vector.
No description provided by the author
Allocate a new vector.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Allocate a new vector.
No description provided by the author
Allocate a new vector.
No description provided by the author
scalar types can be registered so that the constructors below can be used for all types.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
constructors * -------------------------------------------------------------------------- */.
No description provided by the author

# Variables

register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.
register scalar type * -------------------------------------------------------------------------- */.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
-------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
No description provided by the author
No description provided by the author
No description provided by the author
-------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
const iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint3 iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint3 iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint3 iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint3 iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint3 iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint3 iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint3 iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint3 iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
matrix type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint3 iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.
joint iterator * -------------------------------------------------------------------------- */.

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
-------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
vector type declaration * -------------------------------------------------------------------------- */.
this allows to idenfity the type of a scalar.