Skip to content

ArgsVisitor


class ArgsVisitor

Gather arguments and gradients from a delayed expression.

Member Variables

Name Description
x:Real[_] Vectorized arguments. This is over-allocated and only the prefix used, to reduce re-allocation.
g:Real[_] Vectorized gradients. This is over-allocated and only the prefix used, to reduce re-allocation.
n:Integer Current position in x and g.

Member Functions

Name Description
args Get arguments and gradients after visiting.
visit Gather argument.
visit Gather argument.
visit Gather argument.
visit Gather argument.
visit Gather argument.
visit Gather argument.
reserve Ensure that there is sufficient space, resizing if necessary.

Member Function Details

args

function args() -> (Real[_], Real[_])

Get arguments and gradients after visiting.

Returns Vectorized arguments and gradients.

reserve

function reserve(m:Integer)

Ensure that there is sufficient space, resizing if necessary.

  • m Required size.

visit

function visit(v:Random<Real>)

Gather argument.

v: Argument.

function visit(v:Random<Integer>)

Gather argument.

v: Argument.

function visit(v:Random<Boolean>)

Gather argument.

v: Argument.

function visit(v:Random<Real[_]>)

Gather argument.

v: Argument

function visit(v:Random<Integer[_]>)

Gather argument.

v: Argument.

function visit(v:Random<Real[_,_]>)

Gather argument.

v: Argument.