-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMorphism.cs
More file actions
31 lines (24 loc) · 724 Bytes
/
Morphism.cs
File metadata and controls
31 lines (24 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using QuikGraph;
namespace GraphRewriteEngine
{
public class Morphism {
public NodeMapping Vm;
public EdgeMapping Em;
public Morphism() {
Vm = new NodeMapping();
Em = new EdgeMapping();
}
public Morphism(NodeMapping vm, EdgeMapping em) {
Vm = vm;
Em = em;
}
public Morphism Compose(Morphism f) {
return new Morphism(this.Vm.Compose(f.Vm) as NodeMapping, this.Em.Compose(f.Em) as EdgeMapping);
}
public override string ToString() {
return $"Node mapping:\n{Vm.ToString()}Edge mapping:\n{Em.ToString()}";
}
}
}