This repository has been archived on 2021-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
NC/mp3/Project_3_Maggioni_Claudio/src/Initialize_case.m
2020-10-21 15:21:51 +02:00

18 lines
No EOL
464 B
Matlab
Executable file

function [params] = Initialize_case(SM_case)
% Adjacency
params.Adj = SM_case.Problem.A;
% Incidence
params.Inc = adjacency_to_incidence(params.Adj);
% Edges
params.numberOfEdges = size(params.Inc,1);
% Vertices
params.numberOfVertices = size(params.Inc,2);
% coords (if exist)
if isfield(SM_case, 'Problem') && isfield(SM_case.Problem, 'aux') && ...
isfield(SM_case.Problem.aux, 'coord')
params.coords = SM_case.Problem.aux.coord;
end
end