Liking cljdoc? Tell your friends :D

bortexz.graphcom


-base-compilationclj

(-base-compilation graph parallel?)
(-base-compilation graph input-ids parallel?)

Base compilation used by sequential and parallel processors. When parallel? is false, the topology is flattened to be 1-dimensional. When no inputs specified, it will create a compilation for all input nodes of the graph. Throws when any input does not exist as input of the graph.

Base compilation used by sequential and parallel processors. 
When parallel? is false, the topology is flattened to be 1-dimensional.
When no inputs specified, it will create a compilation for all input nodes of the graph.
Throws when any input does not exist as input of the graph.
sourceraw docstring

-sources-valuesclj

(-sources-values compute-node values inputs)

Returns a map of {<source-label> <source-value>}, given a node, current processor accumulated values and currently processing inputs. Useful for implementing graph-processors.

Returns a map of {<source-label> <source-value>}, given a `node`, current processor accumulated `values`
and currently processing `inputs`.
Useful for implementing graph-processors.
sourceraw docstring

-topological-sortclj

(-topological-sort graph input-ids)

Returns a parallel topological sort of the graph, as a collection of steps, where each step is a collection of node ids that can be run in parallel. Useful as a base for certain processor compilations.

Returns a parallel topological sort of the graph, as a collection of steps,
where each step is a collection of node ids that can be run in parallel.
Useful as a base for certain processor compilations.
sourceraw docstring

addclj

(add graph label node)

Adds node to graph with the given label. Recursively adds all sources of node that do not exist yet on graph, without label.

Adds `node` to `graph` with the given `label`.
Recursively adds all sources of `node` that do not exist yet on `graph`, without label.
sourceraw docstring

Computecljprotocol

-computeclj

(-compute this curr-val sources)

Computes the new value of a compute-node

Computes the new value of a compute-node

-sourcesclj

(-sources this)

Returns a map of {<source-label> <source-node>}

Returns a map of {<source-label> <source-node>}
source

compute-nodeclj

(compute-node sources handler)

Returns a graph node that computes a new value from the values of its sources using handler. sources is a map as {<source-label> <soure-node>}. handler is a 2-arity function accepting the current node value and a map of {<source-label> <source-value>}. Sources that are inputs to the graph will be nil unless specified as inputs to process.

Returns a graph node that computes a new value from the values of its `sources` using `handler`.
`sources` is a map as {<source-label> <soure-node>}.
`handler` is a 2-arity function accepting the current node value and a map of {<source-label> <source-value>}.
Sources that are inputs to the graph will be nil unless specified as inputs to [[process]].
sourceraw docstring

compute-node?clj

(compute-node? x)

Returns true iff x is a compute node

Returns true iff x is a compute node
sourceraw docstring

ComputeNodeclj

source

Contextclj

source

contextclj

(context graph)
(context graph processor)

Returns a context to execute the given graph with processor. If processor is not specified, it will use a sequential-processor.

Returns a context to execute the given `graph` with `processor`.
If `processor` is not specified, it will use a `sequential-processor`.
sourceraw docstring

graphclj

(graph)
(graph nodes-map)

Returns a graph, empty or from a map of {label node}.

Returns a graph, empty or from a map of {label node}.
sourceraw docstring

Graphclj

source

Inputcljprotocol

source

input-nodeclj

(input-node)

Returns a graph node that can be used to input values when processing the graph context. input-nodes do not hold their values through calls to [process], and only have a non-nil value when they are specified as inputs to process.

Returns a graph node that can be used to input values when processing the graph context.
input-nodes do not hold their values through calls to [[[process]]], and only have a non-nil value
when they are specified as inputs to [[process]].
sourceraw docstring

input-node?clj

(input-node? x)

Checks if x is an input node

Checks if x is an input node
sourceraw docstring

InputNodeclj

source

Nodecljprotocol

-idclj

(-id this)

Returns id of this node. ID must be unique on a graph.

Returns id of this node. ID must be unique on a graph.
source

node?clj

(node? x)

Checks if x is any type of graph node

Checks if x is any type of graph node
sourceraw docstring

parallel-processorclj

(parallel-processor)

Only CLJ: Returns a parallel processor that will execute each parallel step of the topological sort using pmap.

Only CLJ: Returns a parallel processor that will execute each parallel step of the topological sort using pmap.
sourceraw docstring

precompileclj

(precompile context input-labels)

Creates a compilation for the given inputs-labels, and stores the result into context to be used when processing the graph with the same input-labels in future calls to process.

Creates a compilation for the given `inputs-labels`, and stores the result into `context` to
be used when processing the graph with the same `input-labels` in future calls to `process`.
sourceraw docstring

processclj

(process {:keys [processor graph values] :as context} labelled-inputs)

Processes the given context using labelled-inputs as {<input-node-label> <input-value>}. If a compilation didn't exist for the current set of inputs, it will create one and store it in context. Returns updated context.

Processes the given `context` using `labelled-inputs` as {<input-node-label> <input-value>}.
If a compilation didn't exist for the current set of inputs, it will create one and store it in `context`.
Returns updated `context`.
sourceraw docstring

Processorcljprotocol

Compiles and processes a graph context for the given inputs.

Compiles and processes a graph context for the given inputs.

-compileclj

(-compile this graph input-set)

Creates a compilation to traverse the graph for the given input-set (set of input-nodes ids). The result will be passed to -process as compilation.

Creates a compilation to traverse the `graph` for the given `input-set` (set of input-nodes ids).
The result will be passed to -process as `compilation`.

-processclj

(-process this graph compilation values inputs-map)

Processes the graph traversing the given compilation, using the current values of the context and the given inputs-map as {<input-id> <value>}. Returns the new values of the context as {<compute-id> <value>}.

Processes the `graph` traversing the given `compilation`, 
using the current `values` of the context and the given 
`inputs-map` as {<input-id> <value>}. Returns the new values
of the context as {<compute-id> <value>}.
sourceraw docstring

sequential-processorclj

(sequential-processor)

Returns a sequential processor that processes nodes sequentially.

Returns a sequential processor that processes nodes sequentially.
sourceraw docstring

valueclj

(value {:keys [graph values]} label)

Returns the value of node identified by label in context. Slightly faster than (get (values context) label), as it only needs to translate label->id for the requested label.

Returns the value of node identified by `label` in `context`.
Slightly faster than `(get (values context) label)`, as it only needs to translate label->id
for the requested label.
sourceraw docstring

valuesclj

(values {:keys [graph values]})

Returns current context values as {label value}.

Returns current `context` values as {label value}.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close