Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markuszoppelt/cgl
(Fixed) Computational Graph Library in Rust
https://github.com/markuszoppelt/cgl
computational-graphs rust zkp
Last synced: about 8 hours ago
JSON representation
(Fixed) Computational Graph Library in Rust
- Host: GitHub
- URL: https://github.com/markuszoppelt/cgl
- Owner: MarkusZoppelt
- Created: 2024-06-26T09:41:14.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-26T13:08:15.000Z (5 months ago)
- Last Synced: 2024-07-15T09:25:06.407Z (4 months ago)
- Topics: computational-graphs, rust, zkp
- Language: Rust
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Computation Graph Library
A simple computation graph library in Rust, designed for easy creation, manipulation, and evaluation of computational graphs.
This library supports basic arithmetic operations, hints for complex computations, and constraint checking.## Features
- Define and initialize nodes in the computation graph.
- Support for basic arithmetic operations: addition and multiplication.
- Ability to set constant values for nodes.
- Hinting mechanism for complex computations like division and square roots.
- Constraint checking to ensure correctness of computations.## Example
Here’s a basic example demonstrating how to use the library:
```rust
use computation_graph::Builder;fn main() {
let mut builder = Builder::new();// Example: f(x) = x^2 + x + 5
let x = builder.init();
let x_squared = builder.mul(&x, &x);
let x_squared_plus_x = builder.add(&x_squared, &x);
let five = builder.constant(5);
let y = builder.add(&x_squared_plus_x, &five);let inputs = vec![Some(3)];
builder.fill_nodes(inputs);
assert!(builder.check_constraints());
}
```Tests
cargo test