Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1723b48
Add HugrMut::insert_forest / insert_view_forest, implement insert_hug…
acl-cqc Aug 11, 2025
2e66542
insert_subgraph delegates to insert_forest (copying nodes list)
acl-cqc Aug 11, 2025
02fea73
errors; docs
acl-cqc Aug 11, 2025
fdee944
Tests
acl-cqc Aug 12, 2025
0eaf3eb
fix test - edges removed rather than delocalized
acl-cqc Aug 12, 2025
05072b6
Merge remote-tracking branch 'origin/main' into acl/insert_forest
acl-cqc Aug 12, 2025
f55c288
More docs/links
acl-cqc Aug 13, 2025
10778ce
Optimize by turning HashMap into impl IntoIterator, avoid size_hint
acl-cqc Aug 12, 2025
826990d
struct InsertedForest; use InsertForestResult alias more widely
acl-cqc Aug 15, 2025
f9eee44
N -> SN
acl-cqc Aug 15, 2025
caecc43
Make DoubleCopy contain a named field
acl-cqc Aug 15, 2025
bd12196
Revert "Make DoubleCopy contain a named field"
acl-cqc Aug 16, 2025
bdc0ff1
Use rstest::fixture
acl-cqc Aug 16, 2025
58dccdd
test tidy
acl-cqc Aug 16, 2025
b1c0d2a
add benchmark
acl-cqc Aug 17, 2025
88a4987
lint benchmark and add to criterion group
acl-cqc Aug 17, 2025
cb92e0c
comments
acl-cqc Aug 17, 2025
a73ce4f
Better benchmarks via iter_batched
acl-cqc Aug 19, 2025
481648e
Always convert to HashMap; update insert_forest_internal; roots->root…
acl-cqc Aug 19, 2025
9a9c325
Do not require HashMap, so insert_view_forest can avoid building one
acl-cqc Aug 19, 2025
ec01c36
Separate errors: DoubleCopy => DuplicateNode + SubtreeAlreadyCopied
acl-cqc Aug 19, 2025
8426498
docs
acl-cqc Aug 20, 2025
f8bdaa1
Builder docs for #2496
acl-cqc Aug 21, 2025
17a8de4
remove not-yet-existent doclink
acl-cqc Aug 21, 2025
191119f
Improve doc of dfg_calling_defn_decl
acl-cqc Aug 22, 2025
685e19f
insert_view_forest uses iter_batched and recreates host each time
acl-cqc Sep 1, 2025
57e58e2
oops, fix borrow in bench
acl-cqc Sep 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion hugr-core/src/builder/build_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ pub trait Container {
}

/// Insert a copy of a HUGR as a child of the container.
///
/// Only the portion below the entrypoint will be inserted, with any incoming
/// edges broken.
fn add_hugr_view<H: HugrView>(&mut self, child: &H) -> InsertionResult<H::Node, Node> {
let parent = self.container_node();
self.hugr_mut().insert_from_view(parent, child)
Expand Down Expand Up @@ -256,7 +259,9 @@ pub trait Dataflow: Container {
}

/// Copy a hugr-defined op into the sibling graph, wiring up the
/// `input_wires` to the incoming ports of the resulting root node.
/// `input_wires` to the incoming ports of the node that was the entrypoint.
/// (Note, any part of `hugr` outside the entrypoint is not copied;
/// this may lead to new input ports being disconnected.)
///
/// # Errors
///
Expand Down
Loading
Loading