pub struct ComputeGraph<'a, T, DataType> { /* private fields */ }
Expand description

This is the compute abstraction over a graph. It contains an underlying representation of the data that can support running algorithms over it. Each node contains DataType data, and a status indicating whether or not it is active in the next iteration. Its methods are parallelized using atomics, and will yield good multi-threaded performance.

Implementations

Creates a new graph that can run algorithms and can keep track of node data as well as the active nodes.

Set a single node’s activity in the next iteration as status.

Sets a single node’s data in the next iteration as data.

Sets all nodes’ activity in the next iteration as status.

Sets all nodes’ data in the next iteration as data.

Performs a global iteration step, useful in many algorithms. The previous status of all nodes is now updated to the new status. The new status is reset to false.

Returns how many nodes are active in the last iteration. This function calculates the value every time, so it is recommended to store its value.

This function iterates over the active nodes in the last iteration and applies func on them. func receives two arguments: old, which is the last state of the node, and new, which is the current state.

Saves the computation’s data to the specified file in binary format, following the local machine’s endianness.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.