Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1var LGraphObject = require('./LGraphObject');
2var IGeometry = require('./util/IGeometry');
3var IMath = require('./util/IMath');
4
5function LEdge(source, target, vEdge) {
6 LGraphObject.call(this, vEdge);
7
8 this.isOverlapingSourceAndTarget = false;
9 this.vGraphObject = vEdge;
10 this.bendpoints = [];
11 this.source = source;
12 this.target = target;
13}
14
15LEdge.prototype = Object.create(LGraphObject.prototype);
16
17for (var prop in LGraphObject) {
18 LEdge[prop] = LGraphObject[prop];
19}
20
21LEdge.prototype.getSource = function ()
22{
23 return this.source;
24};
25
26LEdge.prototype.getTarget = function ()
27{
28 return this.target;
29};
30
31LEdge.prototype.isInterGraph = function ()
32{
33 return this.isInterGraph;
34};
35
36LEdge.prototype.getLength = function ()
37{
38 return this.length;
39};
40
41LEdge.prototype.isOverlapingSourceAndTarget = function ()
42{
43 return this.isOverlapingSourceAndTarget;
44};
45
46LEdge.prototype.getBendpoints = function ()
47{
48 return this.bendpoints;
49};
50
51LEdge.prototype.getLca = function ()
52{
53 return this.lca;
54};
55
56LEdge.prototype.getSourceInLca = function ()
57{
58 return this.sourceInLca;
59};
60
61LEdge.prototype.getTargetInLca = function ()
62{
63 return this.targetInLca;
64};
65
66LEdge.prototype.getOtherEnd = function (node)
67{
68 if (this.source === node)
69 {
70 return this.target;
71 }
72 else if (this.target === node)
73 {
74 return this.source;
75 }
76 else
77 {
78 throw "Node is not incident with this edge";
79 }
80}
81
82LEdge.prototype.getOtherEndInGraph = function (node, graph)
83{
84 var otherEnd = this.getOtherEnd(node);
85 var root = graph.getGraphManager().getRoot();
86
87 while (true)
88 {
89 if (otherEnd.getOwner() == graph)
90 {
91 return otherEnd;
92 }
93
94 if (otherEnd.getOwner() == root)
95 {
96 break;
97 }
98
99 otherEnd = otherEnd.getOwner().getParent();
100 }
101
102 return null;
103};
104
105LEdge.prototype.updateLength = function ()
106{
107 var clipPointCoordinates = new Array(4);
108
109 this.isOverlapingSourceAndTarget =
110 IGeometry.getIntersection(this.target.getRect(),
111 this.source.getRect(),
112 clipPointCoordinates);
113
114 if (!this.isOverlapingSourceAndTarget)
115 {
116 this.lengthX = clipPointCoordinates[0] - clipPointCoordinates[2];
117 this.lengthY = clipPointCoordinates[1] - clipPointCoordinates[3];
118
119 if (Math.abs(this.lengthX) < 1.0)
120 {
121 this.lengthX = IMath.sign(this.lengthX);
122 }
123
124 if (Math.abs(this.lengthY) < 1.0)
125 {
126 this.lengthY = IMath.sign(this.lengthY);
127 }
128
129 this.length = Math.sqrt(
130 this.lengthX * this.lengthX + this.lengthY * this.lengthY);
131 }
132};
133
134LEdge.prototype.updateLengthSimple = function ()
135{
136 this.lengthX = this.target.getCenterX() - this.source.getCenterX();
137 this.lengthY = this.target.getCenterY() - this.source.getCenterY();
138
139 if (Math.abs(this.lengthX) < 1.0)
140 {
141 this.lengthX = IMath.sign(this.lengthX);
142 }
143
144 if (Math.abs(this.lengthY) < 1.0)
145 {
146 this.lengthY = IMath.sign(this.lengthY);
147 }
148
149 this.length = Math.sqrt(
150 this.lengthX * this.lengthX + this.lengthY * this.lengthY);
151}
152
153module.exports = LEdge;
154 