% Input:
% results: matrix (containing the results of a flowpipe computation)
% omegas: cell arry or function handles (containing the support functions generated by flowpipe computation)
% time: double (time passed before visiting the actual location)
% iteration: number of taken transitions
% Ijump: matrix (containing the indices of the sets intersecting a guards)
% transitiontotake: vector (containing at position x the id of the
%                           transition which has to be taken for the sets in Ijump(x,:)
% qd: matrix (containing column-wise all outgoing transitions from the
%             active location

% Output:
% store_id: integer (id of the stored computation state)

% Description:
% stored the via parameters specified computation state in a global
% variable stored_states

function [store_id] = store_state(results,omegas,time,iteration,Ijump,transitiontotake,qd)

global stored_states;
store_id = length(stored_states)+1;

stored_states{store_id}.results = results;
stored_states{store_id}.omegas = omegas;
stored_states{store_id}.time = time;
stored_states{store_id}.iteration = iteration;
if ~isempty(results)
    stored_states{store_id}.number_of_sets = size(results,2);
else
    stored_states{store_id}.number_of_sets = length(omegas);
end;

stored_states{store_id}.Ijump = Ijump;
stored_states{store_id}.transitiontotake = transitiontotake;
stored_states{store_id}.qd = qd;