Skip to content

Commit

Permalink
chore(project): rename to HypergraphZ
Browse files Browse the repository at this point in the history
  • Loading branch information
yamafaktory committed Sep 8, 2024
1 parent ac0ce71 commit 919874b
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 114 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# HyperZig - A Hypergraph Implementation in Zig
# HypergraphZ - A Hypergraph Implementation in Zig

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/yamafaktory/hyperzig/ci.yml?branch=main&style=flat-square)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/yamafaktory/hypergraphz/ci.yml?branch=main&style=flat-square)

HyperZig is a directed hypergraph implementation in Zig (https://en.wikipedia.org/wiki/Hypergraph):
HypergraphZ is a directed hypergraph implementation in Zig (https://en.wikipedia.org/wiki/Hypergraph):

- Each hyperedge can contain zero, one (unary) or multiple vertices.
- Each hyperedge can contain vertices directed to themselves one or more times.

## Usage

Add `hyperzig` as a dependency to your `build.zig.zon`:
Add `hypergraphz` as a dependency to your `build.zig.zon`:

```sh
zig fetch --save https://github.com/yamafaktory/hyperzig/archive/<commit-hash>.tar.gz
zig fetch --save https://github.com/yamafaktory/hypergraphz/archive/<commit-hash>.tar.gz
```

Add `hyperzig` as a dependency to your `build.zig`:
Add `hypergraphz` as a dependency to your `build.zig`:

```zig
const hyperzig = b.dependency("hyperzig", .{
const hypergraphz = b.dependency("hypergraphz", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("hyperzig", hyperzig.module("hyperzig"));
exe.root_module.addImport("hypergraphz", hypergraphz.module("hypergraphz"));
```

## Documentation

The latest online documentation can be found [here](https://yamafaktory.github.io/hyperzig/).
The latest online documentation can be found [here](https://yamafaktory.github.io/hypergraphz/).
12 changes: 6 additions & 6 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const std = @import("std");
const HyperZigPath = "src/hyperzig.zig";
const HypergraphZPath = "src/hypergraphz.zig";

// Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external
Expand All @@ -16,10 +16,10 @@ pub fn build(b: *std.Build) void {
// set a preferred release mode, allowing the user to decide how to optimize.
const optimize = b.standardOptimizeOption(.{});

const root_source_file = b.path(HyperZigPath);
const root_source_file = b.path(HypergraphZPath);

// Export as module to be available via @import("hyperzig").
_ = b.addModule("hyperzig", .{
// Export as module to be available via @import("hypergraphz").
_ = b.addModule("hypergraphz", .{
.root_source_file = root_source_file,
.target = target,
.optimize = optimize,
Expand Down Expand Up @@ -50,7 +50,7 @@ pub fn build(b: *std.Build) void {

// Generate docs step.
const lib = b.addStaticLibrary(.{
.name = "hyperzig",
.name = "hypergraphz",
.target = target,
.optimize = optimize,
.root_source_file = root_source_file,
Expand All @@ -65,7 +65,7 @@ pub fn build(b: *std.Build) void {
b.default_step.dependOn(docs_step);

// Check step used by the zls configuration.
const check_step = b.step("check", "Check if HyperZig compiles");
const check_step = b.step("check", "Check if HypergraphZ compiles");
const check = b.addTest(.{
.root_source_file = root_source_file,
.target = target,
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.{
.name = "hyperzig",
.name = "hypergraphz",
.version = "0.0.1",
.minimum_zig_version = "0.13.0",
.dependencies = .{
Expand Down
10 changes: 5 additions & 5 deletions src/bench.zig
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! Benchmarks for HyperZig.
//! Benchmarks for HypergraphZ.

const std = @import("std");
const uuid = @import("uuid");
const hyperzig = @import("hyperzig.zig");
const hypergraphz = @import("hypergraphz.zig");

const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
const GeneralPurposeAllocator = std.heap.GeneralPurposeAllocator;
const HyperZig = hyperzig.HyperZig;
const HypergraphZ = hypergraphz.HypergraphZ;
const Timer = std.time.Timer;
const Uuid = uuid.Uuid;
const comptimePrint = std.fmt.comptimePrint;
Expand All @@ -21,13 +21,13 @@ const Vertex = struct {};
const Bench = struct {
const Self = @This();

graph: HyperZig(Hyperedge, Vertex),
graph: HypergraphZ(Hyperedge, Vertex),
start: u64,
stdout: Writer,
timer: Timer,

pub fn init(allocator: Allocator, stdout: Writer, comptime name: []const u8) !Self {
const graph = try HyperZig(
const graph = try HypergraphZ(
Hyperedge,
Vertex,
).init(allocator, .{ .vertices_capacity = 1_000_000, .hyperedges_capacity = 1_000 });
Expand Down
Loading

0 comments on commit 919874b

Please sign in to comment.