Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alfonso matlab code comparison #23

Closed
chriscoey opened this issue Aug 6, 2018 · 4 comments
Closed

Alfonso matlab code comparison #23

chriscoey opened this issue Aug 6, 2018 · 4 comments

Comments

@chriscoey
Copy link
Collaborator

chriscoey commented Aug 6, 2018

running Alfonso 75cba5f with default options against the following Alfonso.m Matlab code with (the same) default options:

seed = 2017;
tol = 1e-06;
results = random_lp(500, 1000, tol, seed);
seed = 2017;
tol = 1e-06;
intParams = ChebInterval(5); 
results = polyEnv(intParams, 2, 5, tol, seed);
tol = 1e-06;
intParams = FeketeCube(6, 2); 
results = polyOpt(intParams, 'butcher', tol);
intParams = FeketeCube(4, 4); 
results = polyOpt(intParams, 'caprasse', tol);
intParams = FeketeCube(4, 3);
results = polyOpt(intParams, 'lotka-volterra', tol);
intParams = PaduaSquare(7); 
results = polyOpt(intParams, 'motzkin', tol);
intParams = FeketeCube(3, 4); 
results = polyOpt(intParams, 'reaction-diffusion', tol);
intParams = PaduaSquare(8);
results = polyOpt(intParams, 'robinson', tol);

primal and dual objectives for the Julia code and Matlab code match. the iteration counts (very similar) and timings (in seconds) are:

test iters Matlab 75cba5f c9f1eb5 133b422
dense lp 65 5.8 4.1 2.03 1.25
envelope 30 0.085 0.043 0.020 x
butcher 32/30 0.63 0.41 0.357 0.136
caprasse 31/30 1.38 1.87 1.80 0.530
lotka-volt 31/30 0.47 0.38 0.37 0.104
motzkin 41/42 0.35 0.24 x 0.054
reac-diff 29/30 0.32 0.23 0.19 0.075
robinson 29 0.34 0.23 0.17 0.034
@chriscoey chriscoey changed the title Matlab code comparison [info] Matlab code comparison Aug 6, 2018
@blegat
Copy link
Member

blegat commented Aug 6, 2018

Looks good, so Alfonso.jl is faster in all examples ! What do you mean by 32/30 does it mean 32 in Matlab and 30 in Julia ?

@chriscoey
Copy link
Collaborator Author

The Julia code was slower on Caprasse only. Yes 32/30 means 32 on Matlab and 30 on Alfonso. There shouldn't be a difference at this point as the algorithms (modulo some linear algebra) are currently the same (this will change), so it comes down to different numerical procedures in Matlab vs Julia.

@chriscoey chriscoey changed the title [info] Matlab code comparison Alfonso matlab code comparison Aug 21, 2018
@chriscoey
Copy link
Collaborator Author

chriscoey commented Aug 28, 2018

the LP might be faster after JuliaLang/julia#29296 is merged. but we are currently using views so maybe not - it's worth investigating.

@chriscoey
Copy link
Collaborator Author

things are pretty tough to compare now since the package has diverged significantly. if anyone is very interested we can try to compare again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants