Commits

committed f35cc25

• Participants
• Parent commits 56977ed

File doxygen/demos.dox

`+/*! \page demos Description of demo files`
`+`
`+*/`

File matlab/demo_reembo.m

` `
` `
` global MATRIX_A`
`+global truei`
`+`
`+truei = [150,237];`
` `
` lb = ones(n,1)*-sqrt(n);`
` ub = ones(n,1)*sqrt(n);`
` `
`     values(i) = braninhighdim(result);`
`     hd_res = MATRIX_A*result';`
`-    points(i,:) = hd_res(1:2)';`
`-    disp(hd_res(1)); disp(hd_res(2)); disp(values(i));`
`+    points(i,:) = hd_res(truei)';`
`+    disp(hd_res(truei)); disp(values(i));`
` end;`
` `
` [foo,id] = min(values);`

File matlab/testfunctions/braninhighdim.m

` % Min = 0.9617 0.1650`
` `
` global MATRIX_A`
`+global truei`
`+`
` z = MATRIX_A*x';`
` `
`-if (z(1) < 0) z(1) = 0; end;`
`-if (z(2) < 0) z(2) = 0; end;`
`-if (z(1) > 1) z(1) = 1; end;`
`-if (z(2) > 1) z(2) = 1; end;`
`+if (z(truei(1)) < 0) z(truei(1)) = 0; end;`
`+if (z(truei(2)) < 0) z(truei(2)) = 0; end;`
`+if (z(truei(1)) > 1) z(truei(1)) = 1; end;`
`+if (z(truei(2)) > 1) z(truei(2)) = 1; end;`
` `
` % Trick: We assume the function has 1000 dims, but in reality, it is just`
` % the traditional 2D branin.`
` `
`-a = z(1) * 15 - 5;`
`-b = z(2) * 15;`
`+a = z(truei(1)) * 15 - 5;`
`+b = z(truei(2)) * 15;`
` `
` y = (b-(5.1/(4*pi^2))*a^2+5*a/pi-6)^2+10*(1-1/(8*pi))*cos(a)+10;`