-
Notifications
You must be signed in to change notification settings - Fork 0
/
GraphXFunction.m
33 lines (26 loc) · 1.15 KB
/
GraphXFunction.m
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
32
33
classdef GraphXFunction
properties (SetAccess = private)
nNodes; % # nodes in parent graph
parentGraph; % parent graphX object
nodeData; % function values at each node
fourierData; % coefficients of function in Laplacian eigenbasis
end
methods(Static)
end
methods
%% Simple constructor method that auto-populates either fourier data or node data
function graphFunction = GraphXFunction(domain, data, parentGraph)
graphFunction.parentGraph = parentGraph;
graphFunction.nNodes = parentGraph.nNodes;
if domain == "nodes"
graphFunction.nodeData = data;
graphFunction.fourierData = parentGraph.eigenvectors.' * data;
elseif domain == "fourier"
graphFunction.fourierData = data;
graphFunction.nodeData = parentGraph.eigenvectors * data;
else
fprintf("<ERROR:GraphXFunction> Invalid node data specification method. Acceptable options are 'nodes' and 'fourier'.\n ")
end
end
end
end