How to use edge_AB method in wpt

Best JavaScript code snippet using wpt

BaseGraph.test.ts

Source:BaseGraph.test.ts Github

copy

Full Screen

1import { CSV_DATA_PATH, JSON_DATA_PATH } from "_/config/test_paths";2import { GraphMode, GraphStats, MinAdjacencyListDict, MinAdjacencyListArray, NextArray } from "@/core/interfaces";3import * as $N from "@/core/base/BaseNode";4import * as $E from "@/core/base/BaseEdge";5import * as $G from "@/core/base/BaseGraph";6import { TypedGraph } from "@/core/typed/TypedGraph";7import { DegreeDistribution, DegreeCentrality } from "@/centralities/Degree";8import { DFS } from "@/traversal/DFS";9import { CSVInput, ICSVInConfig } from "@/io/input/CSVInput";10import { JSONInput } from "@/io/input/JSONInput";11import { Logger } from "@/utils/Logger";12const logger = new Logger();13const degCent = new DegreeCentrality();14const Node = $N.BaseNode;15const Edge = $E.BaseEdge;16const Graph = $G.BaseGraph;17// let social_net_config: ICSVInConfig = {18// separator: ' ',19// explicit_direction: false,20// direction_mode: false21// };22const small_graph_file = `${JSON_DATA_PATH}/small_graph.json`,23 search_graph_file = `${JSON_DATA_PATH}/search_graph.json`,24 neg_cycle_multi_component_file = `${JSON_DATA_PATH}/negative_cycle_multi_component.json`,25 SMALL_GRAPH_NR_NODES = 4,26 SMALL_GRAPH_NR_UND_EDGES = 2,27 SMALL_GRAPH_NR_DIR_EDGES = 5;28/**29 *30 */31describe("GRAPH TESTS: ", () => {32 let graph: $G.IGraph,33 clone_graph: $G.IGraph,34 node_a: $N.IBaseNode,35 node_b: $N.IBaseNode,36 edge_ab: $E.IBaseEdge,37 edge_2: $E.IBaseEdge,38 stats: GraphStats,39 csv: CSVInput = new CSVInput();40 describe("Basic graph instantiation - ", () => {41 beforeEach(() => {42 graph = new Graph("Test graph");43 clone_graph = new Graph("Clone graph");44 expect(graph).toBeInstanceOf($G.BaseGraph);45 expect(graph.nrNodes()).toBe(0);46 expect(graph.nrDirEdges()).toBe(0);47 expect(graph.nrUndEdges()).toBe(0);48 });49 test("should correctly instantiate a graph with GraphMode INIT (no edges added)", () => {50 graph = new Graph("Test graph");51 expect(graph.getMode()).toBe(GraphMode.INIT);52 });53 test("should get mode via getter", () => {54 graph = new Graph("Test graph");55 expect(graph.mode).toBe(GraphMode.INIT);56 });57 test("should get stats either via getStats() or stats getter", () => {58 expect(graph.getStats()).toEqual(graph.stats);59 });60 it("should report a BaseGraph to be NOT typed", function () {61 expect($G.BaseGraph.isTyped(graph)).toBe(false);62 });63 it("should report a TypedGraph to be TYPED", function () {64 expect($G.BaseGraph.isTyped(new TypedGraph("typeee"))).toBe(true);65 });66 describe("adding nodes and edges -", () => {67 test("should correctly add a node", () => {68 stats = graph.getStats();69 expect(stats.nr_nodes).toBe(0);70 const addNode = new $N.BaseNode("A");71 expect(graph.addNode(addNode)).toBe(addNode);72 stats = graph.getStats();73 expect(stats.nr_nodes).toBe(1);74 });75 test("should correctly add a node by ID", () => {76 stats = graph.getStats();77 expect(stats.nr_nodes).toBe(0);78 expect(graph.addNodeByID("A")).toBeInstanceOf(Node);79 stats = graph.getStats();80 expect(stats.nr_nodes).toBe(1);81 });82 test("should refuse to add a node with same ID as existing node", () => {83 stats = graph.getStats();84 expect(stats.nr_nodes).toBe(0);85 const addNode = new $N.BaseNode("A");86 expect(graph.addNode(addNode)).toBe(addNode);87 expect(graph.addNode.bind(graph, addNode)).toThrowError("Won't add node with duplicate ID.");88 stats = graph.getStats();89 expect(stats.nr_nodes).toBe(1);90 });91 test("should refuse to add a node by ID with same ID as existing node", () => {92 stats = graph.getStats();93 expect(stats.nr_nodes).toBe(0);94 expect(graph.addNodeByID("A")).toBeInstanceOf(Node);95 expect(graph.addNodeByID.bind(graph, "A")).toThrowError("Won't add node with duplicate ID.");96 stats = graph.getStats();97 expect(stats.nr_nodes).toBe(1);98 });99 test("nid is alias to getNodeByID", () => {100 graph.addNodeByID("A");101 expect(graph.n("A")).toEqual(graph.getNodeById("A"));102 });103 test("should correctly clone and add a node from another graph without adding its edges", () => {104 let n_a = graph.addNodeByID("A");105 let n_b = graph.addNodeByID("B");106 let e_1 = graph.addEdgeByID("1", n_a, n_b);107 expect(graph.getEdgeById("1")).toBeDefined();108 expect(n_a.getEdge("1")).toBeDefined();109 expect(n_b.getEdge("1")).toBeDefined();110 clone_graph.addNode(n_a.clone());111 clone_graph.addNode(n_b.clone());112 expect(clone_graph.getEdgeById.bind(clone_graph, "1")).toThrowError(113 "cannot retrieve edge with non-existing ID."114 );115 expect(Object.keys(clone_graph.getNodeById("A").allEdges())).toHaveLength(0);116 expect(Object.keys(clone_graph.getNodeById("B").allEdges())).toHaveLength(0);117 });118 test("should refuse to add an edge if one of the nodes does not exist in the graph", () => {119 node_a = new $N.BaseNode("floating_node_a");120 node_b = graph.addNodeByID("B_in_graph");121 expect(graph.addEdgeByID.bind(graph, "edge_to_nirvana", node_a, node_b)).toThrowError(122 "can only add edge between two nodes existing in graph"123 );124 });125 test("should refuse to add an edge if one of the nodes does not exist in the graph", () => {126 node_b = new $N.BaseNode("floating_node_b");127 node_a = graph.addNodeByID("A_in_graph");128 expect(graph.addEdgeByID.bind(graph, "edge_to_nirvana", node_a, node_b)).toThrowError(129 "can only add edge between two nodes existing in graph"130 );131 });132 test("should refuse to add an edge if one of the nodes does not exist in the graph", () => {133 node_a = new $N.BaseNode("floating_node_a");134 node_b = new $N.BaseNode("floating_node_b");135 expect(graph.addEdgeByID.bind(graph, "edge_to_nirvana", node_a, node_b)).toThrowError(136 "can only add edge between two nodes existing in graph"137 );138 });139 /**140 * edge has to be undirected141 * node_a has in_degree 0, out_degree 0, degree 1142 * node_b has in_degree 0, out_degree 0, degree 1143 * graph has 2 nodes, 1 undirected edge144 * graph is in UNDIRECTED _mode145 */146 test("should correctly add an undirected edge between two nodes", () => {147 node_a = graph.addNodeByID("A");148 node_b = graph.addNodeByID("B");149 edge_ab = graph.addEdgeByID("und_a_b", node_a, node_b); // undirected edge150 expect(edge_ab.isDirected()).toBe(false);151 expect(node_a.in_deg).toBe(0);152 expect(node_a.out_deg).toBe(0);153 expect(node_a.deg).toBe(1);154 expect(node_b.in_deg).toBe(0);155 expect(node_b.out_deg).toBe(0);156 expect(node_b.deg).toBe(1);157 stats = graph.getStats();158 expect(stats.nr_nodes).toBe(2);159 expect(stats.nr_dir_edges).toBe(0);160 expect(stats.nr_und_edges).toBe(1);161 expect(graph.getMode()).toBe(GraphMode.UNDIRECTED);162 });163 /**164 * edge has to be directed165 * node_a has in_degree 0, out_degree 1, degree 1166 * node_b has in_degree 1, out_degree 0, degree 1167 * graph has 2 nodes, 1 undirected edge, 1 directed edge168 * graph is in DIRECTED _mode169 */170 test("should correctly add a directed edge between two nodes", () => {171 graph = new Graph("Test graph");172 node_a = graph.addNodeByID("A");173 node_b = graph.addNodeByID("B");174 edge_ab = graph.addEdgeByID("dir_a_b", node_a, node_b, { directed: true });175 expect(edge_ab.isDirected()).toBe(true);176 expect(node_a.in_deg).toBe(0);177 expect(node_a.out_deg).toBe(1);178 expect(node_a.deg).toBe(0);179 expect(node_b.in_deg).toBe(1);180 expect(node_b.out_deg).toBe(0);181 expect(node_b.deg).toBe(0);182 stats = graph.getStats();183 expect(stats.nr_nodes).toBe(2);184 expect(stats.nr_dir_edges).toBe(1);185 expect(stats.nr_und_edges).toBe(0);186 expect(graph.getMode()).toBe(GraphMode.DIRECTED);187 });188 /**189 * edge has to be undirected and a loop190 * node_a has in_degree 0, out_degree 0, degree 1191 * graph has 1 node, 1 undirected edge192 * graph is in UNDIRECTED _mode193 */194 test("should correctly add an undirected loop", () => {195 graph = new Graph("Test graph");196 node_a = graph.addNodeByID("A");197 edge_ab = graph.addEdgeByID("und_a_a", node_a, node_a, { directed: false });198 expect(edge_ab.isDirected()).toBe(false);199 expect(node_a.in_deg).toBe(0);200 expect(node_a.out_deg).toBe(0);201 expect(node_a.deg).toBe(1);202 stats = graph.getStats();203 expect(stats.nr_nodes).toBe(1);204 expect(stats.nr_dir_edges).toBe(0);205 expect(stats.nr_und_edges).toBe(1);206 expect(graph.getMode()).toBe(GraphMode.UNDIRECTED);207 });208 /**209 * edge has to be directed and a loop210 * node_a has in_degree 1, out_degree 1, degree 0211 * graph has 1 node, 1 directed edge212 * graph is in DIRECTED _mode213 */214 test("should correctly add a directed loop", () => {215 graph = new Graph("Test graph");216 node_a = graph.addNodeByID("A");217 edge_ab = graph.addEdgeByID("und_a_a", node_a, node_a, { directed: true });218 expect(edge_ab.isDirected()).toBe(true);219 expect(node_a.in_deg).toBe(1);220 expect(node_a.out_deg).toBe(1);221 expect(node_a.deg).toBe(0);222 stats = graph.getStats();223 expect(stats.nr_nodes).toBe(1);224 expect(stats.nr_dir_edges).toBe(1);225 expect(stats.nr_und_edges).toBe(0);226 expect(graph.getMode()).toBe(GraphMode.DIRECTED);227 });228 test("should refuse to add an edge if node A does not exist", () => {229 graph = new Graph("Test graph");230 expect(graph.addEdgeByNodeIDs.bind(graph, "dontaddme", "A", "B")).toThrowError(231 "Cannot add edge. Node A does not exist"232 );233 });234 test("should refuse to add an edge if node B does not exist", () => {235 graph = new Graph("Test graph");236 node_a = graph.addNodeByID("A");237 expect(graph.addEdgeByNodeIDs.bind(graph, "dontaddme", "A", "B")).toThrowError(238 "Cannot add edge. Node B does not exist"239 );240 });241 test("should correctly add an edge to existing nodes specified by ID", () => {242 graph = new Graph("Test graph");243 node_a = graph.addNodeByID("A");244 node_b = graph.addNodeByID("B");245 let edge = graph.addEdgeByNodeIDs("Edgy", "A", "B");246 expect(edge).not.toBeUndefined();247 expect(edge).toBeInstanceOf($E.BaseEdge);248 expect(edge.getNodes().a).toBe(node_a);249 expect(edge.getNodes().b).toBe(node_b);250 });251 test("should check if given node IDs are just coincidentally present in the graph but point to invalid node objects", () => {252 node_a = graph.addNodeByID("A");253 node_b = graph.addNodeByID("B");254 edge_ab = graph.addEdgeByID("1", node_a, node_b);255 let new_node_a = clone_graph.addNodeByID("A");256 let new_node_b = clone_graph.addNodeByID("B");257 expect(clone_graph.addEdge.bind(clone_graph, edge_ab)).toThrowError(258 "can only add edge between two nodes existing in graph"259 );260 });261 test("should check if just one (A) of the given node IDs is just coincidentally present in the graph but points to an invalid node object", () => {262 node_a = graph.addNodeByID("A");263 node_b = graph.addNodeByID("B");264 edge_ab = graph.addEdgeByID("1", node_a, node_b);265 clone_graph.addNode(node_a.clone());266 let new_node_b = clone_graph.addNodeByID("B");267 expect(clone_graph.addEdge.bind(clone_graph, edge_ab)).toThrowError(268 "can only add edge between two nodes existing in graph"269 );270 });271 test("should check if just one (B) of the given node IDs is just coincidentally present in the graph but points to an invalid node object", () => {272 node_a = graph.addNodeByID("A");273 node_b = graph.addNodeByID("B");274 edge_ab = graph.addEdgeByID("1", node_a, node_b);275 let new_node_a = clone_graph.addNodeByID("A");276 clone_graph.addNode(node_b.clone());277 expect(clone_graph.addEdge.bind(clone_graph, edge_ab)).toThrowError(278 "can only add edge between two nodes existing in graph"279 );280 });281 /**282 * MIXED MODE GRAPH283 * edge_1 is undirected and goes from a to b284 * edge_2 is directed and a loop from b to b285 * node_a has in_degree 0, out_degree 0, degree 1286 * node_b has in_degree 1, out_degree 1, degree 1287 * graph has 2 node, 1 directed edge, 1 undirected edge288 * graph is in MIXED _mode289 */290 test("should correctly instantiate a mixed graph", () => {291 graph = new Graph("Test graph");292 node_a = graph.addNodeByID("A");293 node_b = graph.addNodeByID("B");294 edge_ab = graph.addEdgeByID("und_a_b", node_a, node_b, { directed: false });295 expect(edge_ab.isDirected()).toBe(false);296 edge_2 = graph.addEdgeByID("dir_b_b", node_b, node_b, { directed: true });297 expect(edge_2.isDirected()).toBe(true);298 expect(node_a.in_deg).toBe(0);299 expect(node_a.out_deg).toBe(0);300 expect(node_a.deg).toBe(1);301 expect(node_b.in_deg).toBe(1);302 expect(node_b.out_deg).toBe(1);303 expect(node_b.deg).toBe(1);304 stats = graph.getStats();305 expect(stats.nr_nodes).toBe(2);306 expect(stats.nr_dir_edges).toBe(1);307 expect(stats.nr_und_edges).toBe(1);308 expect(graph.getMode()).toBe(GraphMode.MIXED);309 });310 });311 });312 /**313 * @todo check graph traveral algorithms on loose end edges !!!314 * @todo maybe split those tests for graph edges, loose edges and out edges315 */316 describe("finding nodes and edges by ID and Label", () => {317 const graph = new $G.BaseGraph("nodeEdgeIDLabelHasGetTestGraph");318 const node_a = graph.addNodeByID("A");319 const node_b = graph.addNodeByID("B");320 const node_c = new $N.BaseNode("C");321 const node_d = new $N.BaseNode("D");322 const edge_abu = graph.addEdgeByID("edge_ab", node_a, node_b);323 const edge_bad = graph.addEdgeByID("edge_bad", node_b, node_a, { directed: true });324 const loose_edge = new $E.BaseEdge("loosey", node_a, node_c);325 const out_edge = new $E.BaseEdge("outty", node_d, node_c);326 beforeAll(() => {});327 test("should report the existence of a node by ID", () => {328 expect(graph.hasNodeID("IDontExistInGraph")).toBe(false);329 expect(graph.hasNodeID(node_a.getID())).toBe(true);330 });331 test("should return undefined when trying to retrieve a non-existing node by ID", () => {332 expect(graph.getNodeById("idontexist")).toBeUndefined();333 });334 test("should return a node by existing ID", () => {335 expect(graph.getNodeById(node_a.getID())).toBe(node_a);336 expect(graph.getNodeById(node_b.getID())).toBe(node_b);337 });338 test("should report the number of nodes currently in the graph", () => {339 expect(graph.nrNodes()).toBe(2);340 });341 test("should report the existence of an edge by ID", () => {342 expect(graph.hasEdgeID("IdontExist")).toBe(false);343 expect(graph.hasEdgeID(loose_edge.getID())).toBe(false);344 expect(graph.hasEdgeID(out_edge.getID())).toBe(false);345 expect(graph.hasEdgeID(edge_abu.getID())).toBe(true);346 expect(graph.hasEdgeID(edge_bad.getID())).toBe(true);347 });348 test("should throw an error upon trying to retrieve a non-existing edge by ID", () => {349 expect(graph.getEdgeById.bind(graph, undefined)).toThrowError("cannot retrieve edge with non-existing ID.");350 expect(graph.getEdgeById.bind(graph, loose_edge.getID())).toThrowError(351 "cannot retrieve edge with non-existing ID."352 );353 expect(graph.getEdgeById.bind(graph, out_edge.getID())).toThrowError(354 "cannot retrieve edge with non-existing ID."355 );356 });357 test("should return an edge by ID", () => {358 expect(graph.getEdgeById(edge_abu.getID())).toBe(edge_abu);359 });360 test("should report the number of directed edges currently in the graph", () => {361 expect(graph.nrDirEdges()).toBe(1);362 });363 test("should report the number of edges currently in the graph", () => {364 expect(graph.nrUndEdges()).toBe(1);365 });366 test("should give you a random node currently existing in the graph", () => {367 let rand_node = graph.getRandomNode();368 expect(rand_node).toBeInstanceOf(Node);369 expect(graph.hasNodeID(rand_node.getID())).toBe(true);370 });371 test("should give you a random directed edge currently existing in the graph", () => {372 let rand_dir_edge = graph.getRandomDirEdge();373 expect(rand_dir_edge.isDirected()).toBe(true);374 expect(rand_dir_edge).toBeInstanceOf(Edge);375 expect(graph.hasEdgeID(rand_dir_edge.getID())).toBe(true);376 });377 test("should give you a random undirected edge currently existing in the graph", () => {378 let rand_und_edge = graph.getRandomUndEdge();379 expect(rand_und_edge.isDirected()).toBe(false);380 expect(rand_und_edge).toBeInstanceOf(Edge);381 expect(graph.hasEdgeID(rand_und_edge.getID())).toBe(true);382 });383 /**384 * @todo We're just checking for 1st edge right now - what about multiple edges?385 *386 */387 test("should throw an error retrieving an edge by Node IDs if node_a does not exist", () => {388 expect(graph.getDirEdgeByNodeIDs.bind(graph, undefined, node_b.getID())).toThrowError(389 "Cannot find edge. Node A does not exist (in graph)."390 );391 });392 test("should throw an error retrieving an edge by Node IDs if node_b does not exist", () => {393 expect(graph.getDirEdgeByNodeIDs.bind(graph, node_b.getID(), undefined)).toThrowError(394 "Cannot find edge. Node B does not exist (in graph)."395 );396 });397 test("should throw an error retrieving a non-existing edge between two valid graph nodes", () => {398 const node_extra = graph.addNodeByID("extraaaaaa");399 expect(graph.getDirEdgeByNodeIDs.bind(graph, node_a.getID(), node_extra.getID())).toThrowError(400 `Cannot find edge. There is no edge between Node ${node_a.getID()} and ${node_extra.getID()}.`401 );402 });403 test("should correctly return the UNdirected A->B edge", () => {404 expect(graph.getUndEdgeByNodeIDs(node_a.getID(), node_b.getID())).toBe(edge_abu);405 });406 test("should correctly return the UNdirected B->A edge", () => {407 expect(graph.getUndEdgeByNodeIDs(node_b.getID(), node_a.getID())).toBe(edge_abu);408 });409 test("should correctly return the directed B->A edge", () => {410 expect(graph.getDirEdgeByNodeIDs(node_b.getID(), node_a.getID())).toBe(edge_bad);411 });412 });413 describe("A little more complex scenario with 4 nodes and 7 edges, mixed _mode", () => {414 let graph, n_a, n_b, n_c, n_d, node_vana, e_1, e_2, e_3, e_4, e_5, e_6, e_7;415 beforeEach(() => {416 graph = new Graph("Edge and node deletion test graph");417 n_a = graph.addNodeByID("A");418 n_b = graph.addNodeByID("B");419 n_c = graph.addNodeByID("C");420 n_d = graph.addNodeByID("D");421 e_1 = graph.addEdgeByID("1", n_a, n_b);422 e_2 = graph.addEdgeByID("2", n_a, n_c);423 e_3 = graph.addEdgeByID("3", n_a, n_a, { directed: true });424 e_4 = graph.addEdgeByID("4", n_a, n_b, { directed: true });425 e_5 = graph.addEdgeByID("5", n_a, n_d, { directed: true });426 e_6 = graph.addEdgeByID("6", n_c, n_a, { directed: true });427 e_7 = graph.addEdgeByID("7", n_d, n_a, { directed: true });428 node_vana = new Node("42", { label: "IAmNotInGraph" });429 expect(graph.nrNodes()).toBe(4);430 expect(graph.nrDirEdges()).toBe(5);431 expect(graph.nrUndEdges()).toBe(2);432 expect(graph.getMode()).toBe(GraphMode.MIXED);433 });434 test("should return the nodes list", () => {435 let nodes = graph.getNodes();436 expect(Object.keys(nodes).length).toBe(4);437 expect(nodes[n_a.getID()]).toBe(n_a);438 expect(nodes[n_b.getID()]).toBe(n_b);439 expect(nodes[n_c.getID()]).toBe(n_c);440 expect(nodes[n_d.getID()]).toBe(n_d);441 });442 test("should return the Dict of undirected edges", () => {443 let edges = graph.getUndEdges();444 expect(Object.keys(edges).length).toBe(2);445 expect(edges[e_1.getID()]).toBe(e_1);446 expect(edges[e_2.getID()]).toBe(e_2);447 });448 test("should return the Dict of directed edges", () => {449 let edges = graph.getDirEdges();450 expect(Object.keys(edges).length).toBe(5);451 expect(edges[e_3.getID()]).toBe(e_3);452 expect(edges[e_4.getID()]).toBe(e_4);453 expect(edges[e_5.getID()]).toBe(e_5);454 expect(edges[e_6.getID()]).toBe(e_6);455 expect(edges[e_7.getID()]).toBe(e_7);456 });457 test("should return the Array of undirected edges", () => {458 let edges = graph.getUndEdgesArray();459 expect(edges.length).toBe(2);460 expect(edges).toEqual(expect.arrayContaining([e_1]));461 expect(edges).toEqual(expect.arrayContaining([e_2]));462 });463 test("should return the Array of directed edges", () => {464 let edges = graph.getDirEdgesArray();465 expect(edges.length).toBe(5);466 expect(edges).toEqual(expect.arrayContaining([e_3]));467 expect(edges).toEqual(expect.arrayContaining([e_4]));468 expect(edges).toEqual(expect.arrayContaining([e_5]));469 expect(edges).toEqual(expect.arrayContaining([e_6]));470 expect(edges).toEqual(expect.arrayContaining([e_7]));471 });472 test("should return the correct graph density w.r.t. directed edges", () => {473 const stats: GraphStats = graph.getStats();474 expect(stats.density_dir).toBe(5 / 12);475 });476 test("should return the correct graph density w.r.t. UNdirected edges", () => {477 const stats: GraphStats = graph.getStats();478 expect(stats.density_und).toBe(4 / 12);479 });480 test("should output the correct degree distribution", () => {481 let deg_dist: DegreeDistribution = degCent.degreeDistribution(graph);482 expect(deg_dist.und).toEqual(new Uint32Array([1, 2, 1, 0, 0, 0, 0, 0, 0]));483 expect(deg_dist.in).toEqual(new Uint32Array([1, 2, 0, 1, 0, 0, 0, 0, 0]));484 expect(deg_dist.out).toEqual(new Uint32Array([1, 2, 0, 1, 0, 0, 0, 0, 0]));485 expect(deg_dist.dir).toEqual(new Uint32Array([0, 2, 1, 0, 0, 0, 1, 0, 0]));486 expect(deg_dist.all).toEqual(new Uint32Array([0, 0, 3, 0, 0, 0, 0, 0, 1]));487 });488 test("should throw an error when trying to remove a non-existing edge", () => {489 let loose_edge = new Edge("IdontExistInGraph", n_a, n_b);490 expect(graph.deleteEdge.bind(graph, loose_edge)).toThrowError("cannot remove non-existing edge.");491 });492 /**493 * delete UNDIRECTED edge494 * e_1 is deleted495 * n_a has degree of one less than before496 * n_a inDegree and outDegree stay the same497 * n_b has degree of one less than before498 * n_b inDegree and outDegree stay the same499 * graph still has 4 nodes500 * graph has same number of directed edges501 * graph has one less undirected edge502 * graph is still in MIXED _mode503 */504 test("should remove an existing undirected edge, updating graph and node stats", () => {505 let graph_nr_nodes = graph.nrNodes(),506 graph_nr_dir_edges = graph.nrDirEdges(),507 graph_nr_und_edges = graph.nrUndEdges(),508 n_a_deg = n_a.deg,509 n_a_in_deg = n_a.in_deg,510 n_a_out_deg = n_a.out_deg,511 n_b_deg = n_b.deg,512 n_b_in_deg = n_b.in_deg,513 n_b_out_deg = n_b.out_deg;514 graph.deleteEdge(e_1);515 expect(graph.nrNodes()).toBe(graph_nr_nodes);516 expect(graph.nrDirEdges()).toBe(graph_nr_dir_edges);517 expect(graph.nrUndEdges()).toBe(graph_nr_und_edges - 1);518 expect(n_a.deg).toBe(n_a_deg - 1);519 expect(n_a.out_deg).toBe(n_a_out_deg);520 expect(n_a.in_deg).toBe(n_a_in_deg);521 expect(n_b.deg).toBe(n_b_deg - 1);522 expect(n_b.out_deg).toBe(n_b_out_deg);523 expect(n_b.in_deg).toBe(n_b_in_deg);524 expect(graph.getMode()).toBe(GraphMode.MIXED);525 });526 /**527 * delete DIRECTED edge528 * e_4 (A->B) is deleted529 * n_a has outDegree of one less than before530 * n_a inDegree and degree stay the same531 * n_b has inDegree of one less than before532 * n_b outDegree and degree stay the same533 * graph still has 4 nodes534 * graph has same number of undirected edges535 * graph has one less directed edge536 * graph is still in MIXED _mode537 */538 test("should remove an existing directed edge, updating graph and node stats", () => {539 let graph_nr_nodes = graph.nrNodes(),540 graph_nr_dir_edges = graph.nrDirEdges(),541 graph_nr_und_edges = graph.nrUndEdges(),542 n_a_deg = n_a.deg,543 n_a_in_deg = n_a.in_deg,544 n_a_out_deg = n_a.out_deg,545 n_b_deg = n_b.deg,546 n_b_in_deg = n_b.in_deg,547 n_b_out_deg = n_b.out_deg;548 graph.deleteEdge(e_4);549 expect(graph.nrNodes()).toBe(graph_nr_nodes);550 expect(graph.nrDirEdges()).toBe(graph_nr_dir_edges - 1);551 expect(graph.nrUndEdges()).toBe(graph_nr_und_edges);552 expect(n_a.out_deg).toBe(n_a_out_deg - 1);553 expect(n_a.in_deg).toBe(n_a_in_deg);554 expect(n_a.deg).toBe(n_a_deg);555 expect(n_b.out_deg).toBe(n_b_out_deg);556 expect(n_b.in_deg).toBe(n_b_in_deg - 1);557 expect(n_b.deg).toBe(n_b_deg);558 expect(graph.getMode()).toBe(GraphMode.MIXED);559 });560 /**561 * delete ALL UNDIRECTED edges562 * e_1 + e_2 deleted563 * we trust node degrees as per earlier examples564 * graph still has 4 nodes565 * graph has same number of directed edges566 * graph has 0 undirected edges567 * graph is now in DIRECTED _mode568 */569 test("should remove ALL undirected edges, bringing the graph into DIRECTED _mode", () => {570 let graph_nr_dir_edges = graph.nrDirEdges();571 graph.deleteEdge(e_1);572 graph.deleteEdge(e_2);573 expect(graph.nrDirEdges()).toBe(graph_nr_dir_edges);574 expect(graph.nrUndEdges()).toBe(0);575 expect(graph.getMode()).toBe(GraphMode.DIRECTED);576 });577 /**578 * delete ALL DIRECTED edges579 * e_3 - e_7 deleted580 * we trust node stats as per earlier examples581 * graph has same number of undirected edges582 * graph has 0 directed edges583 * graph is now in UNDIRECTED _mode584 */585 test("should remove ALL directed edges, bringing the graph into UNDIRECTED _mode", () => {586 let graph_nr_und_edges = graph.nrUndEdges();587 graph.deleteEdge(e_3);588 graph.deleteEdge(e_4);589 graph.deleteEdge(e_5);590 graph.deleteEdge(e_6);591 graph.deleteEdge(e_7);592 expect(graph.nrUndEdges()).toBe(graph_nr_und_edges);593 expect(graph.nrDirEdges()).toBe(0);594 expect(graph.getMode()).toBe(GraphMode.UNDIRECTED);595 });596 /**597 * delete ALL edges598 * e_1 - e_7 deleted599 * we trust node stats as per earlier examples600 * graph has 0 undirected edges601 * graph has 0 directed edges602 * graph is now in INIT _mode603 */604 test("should remove ALL directed edges, bringing the graph into UNDIRECTED _mode", () => {605 graph.deleteEdge(e_1);606 graph.deleteEdge(e_2);607 graph.deleteEdge(e_3);608 graph.deleteEdge(e_4);609 graph.deleteEdge(e_5);610 graph.deleteEdge(e_6);611 graph.deleteEdge(e_7);612 expect(graph.nrUndEdges()).toBe(0);613 expect(graph.nrDirEdges()).toBe(0);614 expect(graph.getMode()).toBe(GraphMode.INIT);615 });616 /**617 * Node deletion of un-added node618 */619 test("should throw an error when trying to remove an a foreign node", () => {620 expect(graph.deleteNode.bind(graph, node_vana)).toThrowError("Cannot remove a foreign node.");621 });622 /**623 * Node deletion WITHOUT edges624 */625 test("should simply delete an unconnected node", () => {626 let node = graph.addNodeByID("IAmInGraph");627 let nr_nodes = graph.nrNodes();628 graph.deleteNode(node);629 expect(graph.nrNodes()).toBe(nr_nodes - 1);630 });631 /**632 * Node outgoing edge deletion on NODE_VANA633 */634 test("should throw an error when trying to delete outgoing edges of a foreign node", () => {635 expect(graph.deleteOutEdgesOf.bind(graph, node_vana)).toThrowError(636 "Cowardly refusing to delete edges of a foreign node."637 );638 });639 /**640 * Node edge deletion => outgoing edges641 */642 test("should correctly delete all outgoing edges of a node", () => {643 graph.deleteOutEdgesOf(n_a);644 expect(n_a.out_deg).toBe(0);645 expect(n_a.in_deg).toBe(2);646 expect(n_b.in_deg).toBe(0);647 expect(n_d.in_deg).toBe(0);648 expect(graph.nrDirEdges()).toBe(2);649 expect(graph.getMode()).toBe(GraphMode.MIXED);650 });651 /**652 * Node incoming edge deletion on NODE_VANA653 */654 test("should throw an error when trying to delete incoming edges of a foreign node", () => {655 expect(graph.deleteInEdgesOf.bind(graph, node_vana)).toThrowError(656 "Cowardly refusing to delete edges of a foreign node."657 );658 });659 /**660 * Node edge deletion => incoming edges661 */662 test("should correctly delete all incoming edges of a node", () => {663 graph.deleteInEdgesOf(n_a);664 expect(n_a.in_deg).toBe(0);665 expect(n_a.out_deg).toBe(2);666 expect(n_c.out_deg).toBe(0);667 expect(n_d.out_deg).toBe(0);668 expect(graph.nrDirEdges()).toBe(2);669 expect(graph.getMode()).toBe(GraphMode.MIXED);670 });671 /**672 * Node directed edge deletion on NODE_VANA673 */674 test("should throw an error when trying to delete directed edges of a foreign node", () => {675 expect(graph.deleteDirEdgesOf.bind(graph, node_vana)).toThrowError(676 "Cowardly refusing to delete edges of a foreign node."677 );678 });679 /**680 * Node edge deletion => directed edges681 */682 test("should correctly delete all directed edges of a node", () => {683 graph.deleteDirEdgesOf(n_a);684 expect(n_a.in_deg).toBe(0);685 expect(n_a.out_deg).toBe(0);686 expect(n_b.in_deg).toBe(0);687 expect(n_c.out_deg).toBe(0);688 expect(n_d.in_deg).toBe(0);689 expect(n_d.out_deg).toBe(0);690 expect(graph.nrDirEdges()).toBe(0);691 expect(graph.nrUndEdges()).toBe(2);692 expect(graph.getMode()).toBe(GraphMode.UNDIRECTED);693 });694 /**695 * Node undirected edge deletion on NODE_VANA696 */697 test("should throw an error when trying to delete undirected edges of a foreign node", () => {698 expect(graph.deleteUndEdgesOf.bind(graph, node_vana)).toThrowError(699 "Cowardly refusing to delete edges of a foreign node."700 );701 });702 /**703 * Node edge deletion => undirected edges704 */705 test("should correctly delete all undirected edges of a node", () => {706 graph.deleteUndEdgesOf(n_a);707 expect(n_a.deg).toBe(0);708 expect(n_b.deg).toBe(0);709 expect(n_c.deg).toBe(0);710 expect(graph.nrUndEdges()).toBe(0);711 expect(graph.nrDirEdges()).toBe(5);712 expect(graph.getMode()).toBe(GraphMode.DIRECTED);713 });714 /**715 * Node ALL edge deletion on NODE_VANA716 */717 test("should throw an error when trying to delete all edges of a foreign node", () => {718 expect(graph.deleteAllEdgesOf.bind(graph, node_vana)).toThrowError(719 "Cowardly refusing to delete edges of a foreign node."720 );721 });722 /**723 * Node edge deletion => all edges724 */725 test("should correctly delete all edges of a node", () => {726 graph.deleteAllEdgesOf(n_a);727 expect(graph.nrDirEdges()).toBe(0);728 expect(graph.nrUndEdges()).toBe(0);729 expect(graph.getMode()).toBe(GraphMode.INIT);730 });731 /**732 * Node deletion WITH edges733 * Delete C node -> only 2 edges, 1 undirected and 1 directed734 * A node should have 1 less undirected and 1 less incoming735 * graph should still be in mixed _mode736 */737 test("should correctly delete a node including edges, test case 1", () => {738 graph.deleteNode(n_c);739 expect(n_a.deg).toBe(1);740 expect(n_a.in_deg).toBe(2);741 expect(graph.nrNodes()).toBe(3);742 expect(graph.nrDirEdges()).toBe(4);743 expect(graph.nrUndEdges()).toBe(1);744 expect(graph.getMode()).toBe(GraphMode.MIXED);745 });746 /**747 * Node deletion WITH edges748 * Delete A node -> connected to ALL edges749 * graph and all remaining nodes should be left without edges750 * graph should be in INIT _mode...751 */752 test("should correctly delete a node including edges, test case 2", () => {753 graph.deleteNode(n_a);754 expect(graph.nrDirEdges()).toBe(0);755 expect(graph.nrUndEdges()).toBe(0);756 expect(graph.nrNodes()).toBe(3);757 expect(graph.getMode()).toBe(GraphMode.INIT);758 });759 });760 describe("Clearing ALL (un)directed edges from a graph", () => {761 let test_graph_file = `${CSV_DATA_PATH}/small_graph_adj_list_def_sep.csv`;762 test("should delete all directed edges from a graph", () => {763 graph = csv.readFromAdjacencyListFile(test_graph_file);764 expect(graph.nrDirEdges()).toBe(5);765 expect(graph.nrUndEdges()).toBe(2);766 graph.clearAllDirEdges();767 expect(graph.nrDirEdges()).toBe(0);768 expect(graph.nrUndEdges()).toBe(2);769 });770 test("should delete all undirected edges from a graph", () => {771 graph = csv.readFromAdjacencyListFile(test_graph_file);772 expect(graph.nrDirEdges()).toBe(5);773 expect(graph.nrUndEdges()).toBe(2);774 graph.clearAllUndEdges();775 expect(graph.nrDirEdges()).toBe(5);776 expect(graph.nrUndEdges()).toBe(0);777 });778 test("should delete ALL edges from a graph", () => {779 graph = csv.readFromAdjacencyListFile(test_graph_file);780 expect(graph.nrDirEdges()).toBe(5);781 expect(graph.nrUndEdges()).toBe(2);782 graph.clearAllEdges();783 expect(graph.nrDirEdges()).toBe(0);784 expect(graph.nrUndEdges()).toBe(0);785 });786 });787 describe("Graph cloning - ", () => {788 let clone_graph: $G.IGraph = null;789 let json_in: JSONInput;790 beforeEach(() => {791 expect(clone_graph).toBeNull();792 });793 afterEach(() => {794 clone_graph = null;795 });796 test("should successfully clone an empty graph", () => {797 const label = "attackOfTheCloneGraph";798 graph = new $G.BaseGraph(label);799 clone_graph = graph.cloneStructure();800 expect(clone_graph.label).toBe(label);801 expect(clone_graph.nrNodes()).toBe(0);802 expect(clone_graph.nrUndEdges()).toBe(0);803 expect(clone_graph.nrDirEdges()).toBe(0);804 expect(clone_graph.getMode()).toBe(GraphMode.INIT);805 expect(clone_graph.getNodes()).toEqual({});806 expect(clone_graph.getUndEdges()).toEqual({});807 expect(clone_graph.getDirEdges()).toEqual({});808 });809 test("should successfully clone an graph with a node plus nested feature vector", () => {810 graph = new $G.BaseGraph("two_node_graph");811 let n_a = graph.addNodeByID("A");812 n_a.setFeatures({813 bla: "hoo",814 number: 42,815 true: false,816 array: [1, 2, 3, [4, 5]],817 object: {818 nested: true,819 },820 });821 clone_graph = graph.cloneStructure();822 expect(clone_graph.label).toBe(graph.label);823 expect(clone_graph.nrNodes()).toBe(1);824 expect(clone_graph.nrUndEdges()).toBe(0);825 expect(clone_graph.nrDirEdges()).toBe(0);826 expect(clone_graph.getMode()).toBe(GraphMode.INIT);827 expect(clone_graph.getNodeById("A")).toEqual(n_a);828 });829 test("should successfully clone an graph with two nodes and one undirected edge", () => {830 graph = new $G.BaseGraph("two_node_graph");831 let n_a = graph.addNodeByID("A");832 let n_b = graph.addNodeByID("B");833 let edgy = graph.addEdgeByID("edgy", n_a, n_b, { directed: false });834 clone_graph = graph.cloneStructure();835 expect(clone_graph.label).toBe(graph.label);836 expect(clone_graph.nrNodes()).toBe(2);837 expect(clone_graph.nrUndEdges()).toBe(1);838 expect(clone_graph.nrDirEdges()).toBe(0);839 expect(clone_graph.getMode()).toBe(GraphMode.UNDIRECTED);840 });841 test("should successfully clone an graph with two nodes and one directed edge", () => {842 graph = new $G.BaseGraph("two_node_graph");843 let n_a = graph.addNodeByID("A");844 let n_b = graph.addNodeByID("B");845 let edgy = graph.addEdgeByID("edgy", n_a, n_b, { directed: true });846 clone_graph = graph.cloneStructure();847 expect(clone_graph.label).toBe(graph.label);848 expect(clone_graph.nrNodes()).toBe(2);849 expect(clone_graph.nrUndEdges()).toBe(0);850 expect(clone_graph.nrDirEdges()).toBe(1);851 expect(clone_graph.getMode()).toBe(GraphMode.DIRECTED);852 });853 /**854 * The toy graph example855 */856 test("should successfully clone a toy graph in explicit mode including weights", () => {857 json_in = new JSONInput({ explicit_direction: true, directed: false, weighted: true });858 graph = json_in.readFromJSONFile(small_graph_file);859 let deg_dist_all = degCent.degreeDistribution(graph).all;860 clone_graph = graph.cloneStructure();861 let clone_deg_dist_all = degCent.degreeDistribution(clone_graph).all;862 expect(clone_graph.nrNodes()).toBe(SMALL_GRAPH_NR_NODES);863 expect(clone_graph.nrUndEdges()).toBe(SMALL_GRAPH_NR_UND_EDGES);864 expect(clone_graph.nrDirEdges()).toBe(SMALL_GRAPH_NR_DIR_EDGES);865 expect(clone_deg_dist_all).toEqual(deg_dist_all);866 expect(clone_graph).toEqual(graph);867 });868 });869 describe("negative cycle checks - ", () => {870 let graph: $G.IGraph,871 graph_bernd: $G.IGraph,872 graph_negcycle_multicomp: $G.IGraph,873 json: JSONInput,874 n_a: $N.IBaseNode,875 n_b: $N.IBaseNode,876 n_c: $N.IBaseNode,877 e_1: $E.IBaseEdge,878 e_2: $E.IBaseEdge,879 e_3: $E.IBaseEdge,880 e_4: $E.IBaseEdge,881 e_5: $E.IBaseEdge,882 e_6: $E.IBaseEdge;883 let isWeightedSpy_e1, isWeightedSpy_e5;884 beforeEach(() => {885 json = new JSONInput({ explicit_direction: true, directed: false, weighted: true });886 graph = new $G.BaseGraph("positive weight graph");887 graph_negcycle_multicomp = json.readFromJSONFile(neg_cycle_multi_component_file);888 n_a = graph.addNodeByID("A");889 n_b = graph.addNodeByID("B");890 n_c = graph.addNodeByID("C");891 e_1 = graph.addEdgeByID("1", n_a, n_b, { directed: true, weighted: true, weight: 1 });892 e_2 = graph.addEdgeByID("2", n_b, n_c, { directed: true, weighted: true, weight: 2 });893 e_3 = graph.addEdgeByID("3", n_c, n_a, { directed: true, weighted: true, weight: 3 });894 e_4 = graph.addEdgeByID("4", n_a, n_c, { directed: false, weighted: true, weight: 42 });895 e_5 = graph.addEdgeByID("5", n_a, n_b, { directed: false, weighted: false });896 e_6 = graph.addEdgeByID("6", n_a, n_c, { directed: true, weighted: false });897 isWeightedSpy_e1 = jest.spyOn(e_1, "isWeighted");898 isWeightedSpy_e5 = jest.spyOn(e_5, "isWeighted");899 });900 afterEach(() => {901 /** This is used to restore the original isWeighted function902 *@todo figure out if necessary...903 */904 jest.restoreAllMocks();905 });906 test("should have called isWeighted on e_1 and e_6 once each and returned true and false, respectively", () => {907 graph.hasNegativeEdge();908 expect(isWeightedSpy_e1).toHaveBeenCalledTimes(1);909 expect(isWeightedSpy_e1).toHaveReturnedWith(true);910 expect(isWeightedSpy_e5).toHaveBeenCalledTimes(1);911 expect(isWeightedSpy_e5).toHaveReturnedWith(false);912 });913 test("should correclty detect a graph with solely positive edges via hasNegativeEdge method", () => {914 expect(graph.hasNegativeEdge()).toBe(false);915 });916 test("should correclty detect a graph with a negative UNdirected edge", () => {917 e_4.setWeight(-42);918 expect(graph.hasNegativeEdge()).toBe(true);919 });920 test("should correclty detect a graph with a negative directed edge", () => {921 e_1.setWeight(-42);922 expect(graph.hasNegativeEdge()).toBe(true);923 });924 test("should correclty detect a graph with solely positive edges via hasNegativeCycle method", () => {925 expect(graph.hasNegativeCycles(n_a)).toBe(false);926 });927 test("should correctly detect a graph with negative edges but no negative cycle", () => {928 e_2.setWeight(-2);929 expect(graph.hasNegativeCycles(n_a)).toBe(false);930 });931 test("should correctly detect a graph with negative cycle", () => {932 e_2.setWeight(-5);933 expect(graph.hasNegativeCycles(n_a)).toBe(true);934 });935 test("should correctly detect a negative undirected edge as negative cycle", () => {936 e_2.setWeight(5);937 graph.addEdgeByID("Negative Undie", n_a, n_b, { weighted: true, weight: -1 });938 expect(graph.hasNegativeCycles()).toBe(true);939 });940 test("negative cycle multi-component graph should have 2 components", () => {941 expect(DFS(graph_negcycle_multicomp, graph_negcycle_multicomp.getNodeById("S")).length).toBe(2);942 });943 test("should correctly detect a negative cycle in a multi-component graph", () => {944 expect(graph_negcycle_multicomp.hasNegativeCycles(graph_negcycle_multicomp.getNodeById("S"))).toBe(true);945 });946 });947 describe.skip("Graph PROJECTIONS - ", () => {948 const jsonReader = new JSONInput();949 describe("empty and trivial graphs - ", () => {950 beforeEach(() => {951 graph = new $G.BaseGraph("emptinius");952 expect(graph).toBeDefined();953 expect(graph.getMode()).toBe(GraphMode.INIT);954 expect(graph.nrNodes()).toBe(0);955 expect(graph.nrDirEdges()).toBe(0);956 expect(graph.nrUndEdges()).toBe(0);957 });958 test("should throw an error if we hand it an empty graph", () => {959 // graph is emptinius...960 expect(graph.toDirectedGraph.bind(graph)).toThrowError("Cowardly refusing to re-interpret an empty graph.");961 });962 test("should return the same directed graph if all edges were directed before", () => {963 let digraph_file = "./test/data/search_graph_pfs.json";964 let json = new JSONInput({ explicit_direction: true, directed: true, weighted: false });965 let digraph = json.readFromJSONFile(digraph_file);966 expect(digraph).toBeDefined();967 expect(digraph.nrNodes()).toBe(6);968 expect(digraph.nrDirEdges()).toBe(9);969 expect(digraph.nrUndEdges()).toBe(0);970 expect(digraph.toDirectedGraph()).toBe(digraph);971 });972 test("should return a copy of the same directed graph if all edges were directed before", () => {973 let digraph_file = "./test/data/search_graph_pfs.json";974 let json = new JSONInput({ explicit_direction: true, directed: true, weighted: false });975 let digraph = json.readFromJSONFile(digraph_file);976 expect(digraph).toBeDefined();977 expect(digraph.nrNodes()).toBe(6);978 expect(digraph.nrDirEdges()).toBe(9);979 expect(digraph.nrUndEdges()).toBe(0);980 let res_graph = digraph.toDirectedGraph(true);981 expect(res_graph).not.toBe(digraph); // refs982 expect(res_graph).toEqual(digraph); // content983 });984 test.skip("should return the same UNdirected graph if all edges were UNdirected before", () => {});985 // test('should return a directed graph when all edges were UNdirected before', () => {986 // });987 test.skip("should return an UNdirected graph when all edges were directed before", () => {});988 });989 describe("MIXED graph", () => {990 beforeEach(() => {991 graph = jsonReader.readFromJSONFile(small_graph_file);992 expect(graph).toBeDefined();993 expect(graph.getMode()).toBe(GraphMode.MIXED);994 expect(graph.nrNodes()).toBe(4);995 expect(graph.nrDirEdges()).toBe(5);996 expect(graph.nrUndEdges()).toBe(2);997 });998 test.skip("should correctly project all directed edges as UNdirected", () => {});999 test.skip("should correctly project all UNdirected edges as directed", () => {});1000 });1001 });1002 describe("testing node histogram sets - ", () => {1003 let g: $G.IGraph = null;1004 const json = new JSONInput();1005 beforeAll(() => {1006 g = json.readFromJSONFile(search_graph_file);1007 logger.log(g.stats);1008 });1009 /* degrees 0-2 */1010 it("should show the correct IN-histogram for the small graph", () => {1011 expect(g.inHist).toEqual([1012 new Set([g.n("G")]),1013 new Set([g.n("A"), g.n("B"), g.n("C"), g.n("D"), g.n("E")]),1014 new Set([g.n("F")]),1015 ]);1016 });1017 /* degrees 0-3 */1018 it("should show the correct OUT-histogram for the small graph", () => {1019 expect(g.outHist).toEqual([1020 new Set([g.n("B"), g.n("F"), g.n("G")]),1021 new Set([g.n("C"), g.n("E")]),1022 new Set([g.n("D")]),1023 new Set([g.n("A")]),1024 ]);1025 });1026 /* degrees 0-1 */1027 it("should show the correct CONN-histogram for the small graph", () => {1028 expect(g.connHist).toEqual([1029 new Set([g.n("B"), g.n("E"), g.n("F"), g.n("G")]),1030 new Set([g.n("A"), g.n("C"), g.n("D")]),1031 ]);1032 });1033 });...

Full Screen

Full Screen

N__DEV__PDE__2DMesh_8h.js

Source:N__DEV__PDE__2DMesh_8h.js Github

copy

Full Screen

1var N__DEV__PDE__2DMesh_8h =2[3 [ "PDE_2DMesh", "classXyce_1_1Device_1_1PDE__2DMesh.html", "classXyce_1_1Device_1_1PDE__2DMesh" ],4 [ "mNode", "classXyce_1_1Device_1_1mNode.html", "classXyce_1_1Device_1_1mNode" ],5 [ "mEdge", "classXyce_1_1Device_1_1mEdge.html", "classXyce_1_1Device_1_1mEdge" ],6 [ "mCell", "classXyce_1_1Device_1_1mCell.html", "classXyce_1_1Device_1_1mCell" ],7 [ "mLabel", "classXyce_1_1Device_1_1mLabel.html", "classXyce_1_1Device_1_1mLabel" ],8 [ "mEdgeInfo", "classXyce_1_1Device_1_1mEdgeInfo.html", "classXyce_1_1Device_1_1mEdgeInfo" ],9 [ "mNodeInfo", "classXyce_1_1Device_1_1mNodeInfo.html", "classXyce_1_1Device_1_1mNodeInfo" ],10 [ "NADJ", "classXyce_1_1Device_1_1NADJ.html", "classXyce_1_1Device_1_1NADJ" ],11 [ "MESHHEAD", "classXyce_1_1Device_1_1MESHHEAD.html", "classXyce_1_1Device_1_1MESHHEAD" ],12 [ "XLATCONST", "classXyce_1_1Device_1_1XLATCONST.html", "classXyce_1_1Device_1_1XLATCONST" ],13 [ "XLATLABEL", "classXyce_1_1Device_1_1XLATLABEL.html", "classXyce_1_1Device_1_1XLATLABEL" ],14 [ "NODE", "classXyce_1_1Device_1_1NODE.html", "classXyce_1_1Device_1_1NODE" ],15 [ "EDGE", "classXyce_1_1Device_1_1EDGE.html", "classXyce_1_1Device_1_1EDGE" ],16 [ "TRI", "classXyce_1_1Device_1_1TRI.html", "classXyce_1_1Device_1_1TRI" ],17 [ "EDGEINFO", "classXyce_1_1Device_1_1EDGEINFO.html", "classXyce_1_1Device_1_1EDGEINFO" ],18 [ "NODEINFO", "classXyce_1_1Device_1_1NODEINFO.html", "classXyce_1_1Device_1_1NODEINFO" ],19 [ "mInterpAreaHelp", "classXyce_1_1Device_1_1mInterpAreaHelp.html", "classXyce_1_1Device_1_1mInterpAreaHelp" ],20 [ "mInterpEdgeHelp", "classXyce_1_1Device_1_1mInterpEdgeHelp.html", "classXyce_1_1Device_1_1mInterpEdgeHelp" ],21 [ "EDGE_AB", "N__DEV__PDE__2DMesh_8h.html#a2c661c694001060626a52fdf2d979aba", null ],22 [ "EDGE_AC", "N__DEV__PDE__2DMesh_8h.html#a4a5015fe4887ecde6df032c8be49fe47", null ],23 [ "EDGE_AD", "N__DEV__PDE__2DMesh_8h.html#a7bd833e31d40ad9b3e09877b43daf43d", null ],24 [ "EDGE_BC", "N__DEV__PDE__2DMesh_8h.html#abc2214e1ada6ad407474a9e7a6ff6d08", null ],25 [ "EDGE_CD", "N__DEV__PDE__2DMesh_8h.html#a85d8fb7020123422661f9a67e56fc578", null ],26 [ "EDGESTATUS_BOUNDARY", "N__DEV__PDE__2DMesh_8h.html#adc9245878fc250682d0cab9178c32ce0", null ],27 [ "EDGESTATUS_EXTERIOR", "N__DEV__PDE__2DMesh_8h.html#abacf983590a2e5f3f0a8e76e19877fe7", null ],28 [ "EDGESTATUS_INTERIOR", "N__DEV__PDE__2DMesh_8h.html#a0c1026ec8a168edfe3f0f1834599c492", null ],29 [ "LEN_IDENT", "N__DEV__PDE__2DMesh_8h.html#a41b71318778d998fd64ea920e0fddc8f", null ],30 [ "TAG12", "N__DEV__PDE__2DMesh_8h.html#ab57069d23de588edfeb8fe768c8fbb8b", null ],31 [ "TAG13", "N__DEV__PDE__2DMesh_8h.html#adbf03389b8e7634ac88d5a72a66da96e", null ],32 [ "TAG23", "N__DEV__PDE__2DMesh_8h.html#acaf0d861bd4f7ffd8b6061e337c5a996", null ],33 [ "TYPE_EDGE", "N__DEV__PDE__2DMesh_8h.html#a8e054fa25161a629434f4d0f5ce9279c", null ],34 [ "TYPE_REGION", "N__DEV__PDE__2DMesh_8h.html#ab1d0b1c287397206db4dcc16791fb4f1", null ],35 [ "VERTEX_A", "N__DEV__PDE__2DMesh_8h.html#af950bd933f7471805c8fd9a01044e3d9", null ],36 [ "VERTEX_B", "N__DEV__PDE__2DMesh_8h.html#a1e05b6864620927f5af89a6cbbfb5f97", null ],37 [ "VERTEX_C", "N__DEV__PDE__2DMesh_8h.html#aeed47bcbe766f30c7ea8a7c9508ffd7e", null ],38 [ "VERTEX_D", "N__DEV__PDE__2DMesh_8h.html#ac988846e8a4c19c6178bd72cd4bb49df", null ],39 [ "N_DEV_PDE_2DMesh", "N__DEV__PDE__2DMesh_8h.html#abf0cf16febafe9139f003fe93a487308", null ],40 [ "meshType", "N__DEV__PDE__2DMesh_8h.html#a260cf67de5a8a35f375e91e0895f4b11", [41 [ "INTERNAL", "N__DEV__PDE__2DMesh_8h.html#a260cf67de5a8a35f375e91e0895f4b11adb089f64ac12ccd140789aa0274262d7", null ],42 [ "EXTERNAL", "N__DEV__PDE__2DMesh_8h.html#a260cf67de5a8a35f375e91e0895f4b11aa0ecf4f140b4650f10f3ec4fc67dadc5", null ],43 [ "NUMTYPE", "N__DEV__PDE__2DMesh_8h.html#a260cf67de5a8a35f375e91e0895f4b11a73c20b31e168f716ac3978dfd16b9e0c", null ]44 ] ],45 [ "operator<<", "N__DEV__PDE__2DMesh_8h.html#aed2c75ce3ba92ac9ba56f0919474b200", null ],46 [ "sq", "N__DEV__PDE__2DMesh_8h.html#a9366ac9239f6f0e0e5e4efc38c607850", null ]...

Full Screen

Full Screen

defines_65.js

Source:defines_65.js Github

copy

Full Screen

1var searchData=2[3 ['edge_5fab',['EDGE_AB',['../N__DEV__PDE__2DMesh_8h.html#a2c661c694001060626a52fdf2d979aba',1,'N_DEV_PDE_2DMesh.h']]],4 ['edge_5fac',['EDGE_AC',['../N__DEV__PDE__2DMesh_8h.html#a4a5015fe4887ecde6df032c8be49fe47',1,'N_DEV_PDE_2DMesh.h']]],5 ['edge_5fad',['EDGE_AD',['../N__DEV__PDE__2DMesh_8h.html#a7bd833e31d40ad9b3e09877b43daf43d',1,'N_DEV_PDE_2DMesh.h']]],6 ['edge_5fbc',['EDGE_BC',['../N__DEV__PDE__2DMesh_8h.html#abc2214e1ada6ad407474a9e7a6ff6d08',1,'N_DEV_PDE_2DMesh.h']]],7 ['edge_5fcd',['EDGE_CD',['../N__DEV__PDE__2DMesh_8h.html#a85d8fb7020123422661f9a67e56fc578',1,'N_DEV_PDE_2DMesh.h']]],8 ['edgestatus_5fboundary',['EDGESTATUS_BOUNDARY',['../N__DEV__PDE__2DMesh_8h.html#adc9245878fc250682d0cab9178c32ce0',1,'N_DEV_PDE_2DMesh.h']]],9 ['edgestatus_5fexterior',['EDGESTATUS_EXTERIOR',['../N__DEV__PDE__2DMesh_8h.html#abacf983590a2e5f3f0a8e76e19877fe7',1,'N_DEV_PDE_2DMesh.h']]],10 ['edgestatus_5finterior',['EDGESTATUS_INTERIOR',['../N__DEV__PDE__2DMesh_8h.html#a0c1026ec8a168edfe3f0f1834599c492',1,'N_DEV_PDE_2DMesh.h']]],11 ['eta',['ETA',['../N__DEV__VDMOS_8C.html#af77edc1f833593caecfc032dcc5953a6',1,'ETA():&#160;N_DEV_VDMOS.C'],['../N__DEV__VDMOS_8C.html#af77edc1f833593caecfc032dcc5953a6',1,'ETA():&#160;N_DEV_VDMOS.C'],['../N__DEV__VDMOS_8C.html#af77edc1f833593caecfc032dcc5953a6',1,'ETA():&#160;N_DEV_VDMOS.C']]],12 ['exp_5fmax',['EXP_MAX',['../N__DEV__VDMOS_8C.html#ae6274263cb5a5f7b997ba8470a89a34f',1,'N_DEV_VDMOS.C']]],13 ['expl_5fthreshold',['EXPL_THRESHOLD',['../N__DEV__MOSFET__B3SOI_8C.html#adc74b12e495ca20f8ef821160b3de0e4',1,'N_DEV_MOSFET_B3SOI.C']]]...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3var options = {4};5 if (err) return console.error(err);6 console.log('Test Results: ' + data.data.testUrl);7 console.log('View Test: ' + data.data.userUrl);8 console.log('Test ID: ' + data.data.testId);9});10var wpt = require('webpagetest');11var wpt = new WebPageTest('www.webpagetest.org');12var options = {13};14 if (err) return console.error(err);15 console.log('Test Results: ' + data.data.testUrl);16 console.log('View Test: ' + data.data.userUrl);17 console.log('Test ID: ' + data.data.testId);18});19var wpt = require('webpagetest');20var wpt = new WebPageTest('www.webpagetest.org');21var options = {22};23 if (err) return console.error(err);24 console.log('Test Results: ' + data.data.testUrl);25 console.log('View Test: ' + data.data.userUrl);26 console.log('Test ID: ' + data.data.testId);27});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt=require('wpt');2var p1=new wpt(0,0);3var p2=new wpt(3,4);4var d=p1.edge_AB(p2);5console.log(d);6var wpt=require('wpt');7var p1=new wpt(0,0);8var p2=new wpt(3,4);9var d=p1.edge_AB(p2);10console.log(d);

Full Screen

Using AI Code Generation

copy

Full Screen

1var edge_AB = require('wptoolkit').edge_AB;2var point = edge_AB(1, 2, 3, 4, 5, 6);3console.log(point);4var edge_AB = require('wptoolkit').edge_AB;5var point = edge_AB(1, 2, 3, 4, 5, 6, 7, 8);6console.log(point);7var edge_AB = require('wptoolkit').edge_AB;8var point = edge_AB(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);9console.log(point);10var edge_AB = require('wptoolkit').edge_AB;11var point = edge_AB(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);12console.log(point);13var edge_AB = require('wptoolkit').edge_AB;14var point = edge_AB(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);15console.log(point);16var edge_AB = require('wptoolkit').edge_AB;17var point = edge_AB(1, 2, 3, 4, 5, 6, 7, 8, 9,

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var page = wptools.page('Albert Einstein');3page.get(function(err, resp) {4 console.log(resp);5});6{ title: 'Albert Einstein',

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2var edge_AB = new wpt.edge_AB("edge_A", "edge_B", 1, 2, 3, 4, 5);3edge_AB.print();4edge_AB.print2();5var wpt = require('wpt');6var edge_AB = new wpt.edge_AB("edge_A", "edge_B", 1, 2, 3, 4, 5);7edge_AB.print();8edge_AB.print2();9var wpt = require('wpt');10var edge_AB = new wpt.edge_AB("edge_A", "edge_B", 1, 2, 3, 4, 5);11edge_AB.print();12edge_AB.print2();13var wpt = require('wpt');14var edge_AB = new wpt.edge_AB("edge_A", "edge_B", 1, 2, 3, 4, 5);15edge_AB.print();16edge_AB.print2();17var wpt = require('wpt');18var edge_AB = new wpt.edge_AB("edge_A", "edge_B", 1, 2, 3, 4, 5);19edge_AB.print();20edge_AB.print2();21var wpt = require('wpt');22var edge_AB = new wpt.edge_AB("edge_A", "edge_B", 1, 2, 3, 4, 5);23edge_AB.print();24edge_AB.print2();25var wpt = require('wpt');26var edge_AB = new wpt.edge_AB("edge_A", "edge_B", 1, 2, 3, 4, 5);27edge_AB.print();28edge_AB.print2();29var wpt = require('wpt');

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful