Liking cljdoc? Tell your friends :D

bortexz.graphcom


-base-compilationclj/s

(-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.

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.
sourceraw docstring

-process-nodeclj/s

(-process-node graph node values inputs)

Processor impl: processes a single node on a graph with given accumulated values and inputs from processor process. If node throws exception, wraps the exception in ex-info containing paths.

Processor impl: processes a single node on a graph with given accumulated values and inputs from processor process.
If node throws exception, wraps the exception in ex-info containing `paths`.
sourceraw docstring

-sources-valuesclj/s

(-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/s

(-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/s

(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

Computeclj/sprotocol

-computeclj/s

(-compute this curr-val sources)

Computes the new value of a compute-node

Computes the new value of a compute-node

-sourcesclj/s

(-sources this)

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

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

compute-nodeclj/s

(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/s

(compute-node? x)

Returns true iff x is a compute node

Returns true iff x is a compute node
sourceraw docstring

contextclj/s

(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/s

(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

Inputclj/sprotocol

source

input-nodeclj/s

(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/s

(input-node? x)

Checks if x is an input node

Checks if x is an input node
sourceraw docstring

Nodeclj/sprotocol

-idclj/s

(-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/s

(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/s

(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/s

(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

Processorclj/sprotocol

Compiles and processes a graph context for the given inputs.

Compiles and processes a graph context for the given inputs.

-compileclj/s

(-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/s

(-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/s

(sequential-processor)

Returns a sequential processor that processes nodes sequentially.

Returns a sequential processor that processes nodes sequentially.
sourceraw docstring

valueclj/s

(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/s

(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