% Input:
% tau: double (stepsize/ sampling time)
% A: Matrix A (of the continuous dynamics)
% B: Matrix B (of the continuous dynamics)
% pU: function handle (Support function of free input)
% pX0: function handle (Support Function of initial set)
% L: Matrix (containing row-wise direction vectors)
% normv: 1/2/Inf (determines the norm to use)
% pB: function handle (Support function of a unit ball)

% Output:
% PhiTau: Matrix (expm(t*A))
% pOmega0: function handle (Support function overapproximating the initial set)
% pW: function handle (Support function overapproximating BU)
% Alpha: double
% Beta: double
% pV: function handle (Support function of BU)
% Rx0: double
% Rv: double

% Description:
% Computes all values, needed to start algo1. 

function [PhiTau,pOmega0,pW,Alpha,Beta,pV,Rx0,Rv] = calcAll(tau,A,B,pU,pX0,L,normv,pB)

sL = size(L);
startv = zeros(sL(2),1);

pV = calcpV(B,pU);

Rv = calcR(startv,normv,pV,L,'Active-set',-1,-1);
Rx0 = calcR(startv,normv,pX0,L,'Active-set',-1,-1);

Beta = calcBetaTau(tau,A,Rv,normv);
Alpha = calcAlphaTau(tau,A,Rx0,Rv,normv);

PhiTau = expm(tau*A);
pW = calcPw(tau,pV,Beta,pB);

pOmega0 = calcPinit2(pX0,PhiTau,pV,Alpha,pB,tau);