diff --git a/argmin_testfunctions/all.html b/argmin_testfunctions/all.html index 386927806..0b0afcbba 100644 --- a/argmin_testfunctions/all.html +++ b/argmin_testfunctions/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/argmin_testfunctions/easom/fn.easom_derivative.html b/argmin_testfunctions/easom/fn.easom_derivative.html new file mode 100644 index 000000000..a6855479d --- /dev/null +++ b/argmin_testfunctions/easom/fn.easom_derivative.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../argmin_testfunctions/fn.easom_derivative.html...

+ + + \ No newline at end of file diff --git a/argmin_testfunctions/easom/fn.easom_hessian.html b/argmin_testfunctions/easom/fn.easom_hessian.html new file mode 100644 index 000000000..5ecab62b7 --- /dev/null +++ b/argmin_testfunctions/easom/fn.easom_hessian.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../argmin_testfunctions/fn.easom_hessian.html...

+ + + \ No newline at end of file diff --git a/argmin_testfunctions/fn.easom_derivative.html b/argmin_testfunctions/fn.easom_derivative.html new file mode 100644 index 000000000..e9f6a5357 --- /dev/null +++ b/argmin_testfunctions/fn.easom_derivative.html @@ -0,0 +1,3 @@ +easom_derivative in argmin_testfunctions - Rust
pub fn easom_derivative<T>(param: &[T; 2]) -> [T; 2]where
+    T: Float + FromPrimitive,
Expand description

Derivative of Easom test function

+
\ No newline at end of file diff --git a/argmin_testfunctions/fn.easom_hessian.html b/argmin_testfunctions/fn.easom_hessian.html new file mode 100644 index 000000000..612ac0387 --- /dev/null +++ b/argmin_testfunctions/fn.easom_hessian.html @@ -0,0 +1,3 @@ +easom_hessian in argmin_testfunctions - Rust
pub fn easom_hessian<T>(param: &[T; 2]) -> [[T; 2]; 2]where
+    T: Float + FromPrimitive,
Expand description

Hessian of Easom test function

+
\ No newline at end of file diff --git a/argmin_testfunctions/index.html b/argmin_testfunctions/index.html index fed319e91..c2f3c2fb8 100644 --- a/argmin_testfunctions/index.html +++ b/argmin_testfunctions/index.html @@ -1,2 +1,2 @@ argmin_testfunctions - Rust
Expand description

Functions

\ No newline at end of file +
  • All Items
  • Expand description

    Functions

    \ No newline at end of file diff --git a/argmin_testfunctions/sidebar-items.js b/argmin_testfunctions/sidebar-items.js index f533a2bcb..359fc558a 100644 --- a/argmin_testfunctions/sidebar-items.js +++ b/argmin_testfunctions/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"fn":["ackley","ackley_abc","beale","beale_derivative","beale_hessian","booth","booth_derivative","booth_hessian","bukin_n6","bukin_n6_derivative","bukin_n6_hessian","cross_in_tray","easom","eggholder","goldsteinprice","himmelblau","holder_table","levy","levy_n13","matyas","mccorminck","picheny","rastrigin","rastrigin_a","rastrigin_a_derivative","rastrigin_a_derivative_const","rastrigin_a_hessian","rastrigin_a_hessian_const","rastrigin_derivative","rastrigin_derivative_const","rastrigin_hessian","rastrigin_hessian_const","rosenbrock","rosenbrock_derivative","rosenbrock_derivative_const","rosenbrock_hessian","rosenbrock_hessian_const","schaffer_n2","schaffer_n4","sphere","sphere_derivative","sphere_derivative_const","sphere_hessian","sphere_hessian_const","styblinski_tang","threehumpcamel","zero","zero_derivative"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"fn":["ackley","ackley_abc","beale","beale_derivative","beale_hessian","booth","booth_derivative","booth_hessian","bukin_n6","bukin_n6_derivative","bukin_n6_hessian","cross_in_tray","easom","easom_derivative","easom_hessian","eggholder","goldsteinprice","himmelblau","holder_table","levy","levy_n13","matyas","mccorminck","picheny","rastrigin","rastrigin_a","rastrigin_a_derivative","rastrigin_a_derivative_const","rastrigin_a_hessian","rastrigin_a_hessian_const","rastrigin_derivative","rastrigin_derivative_const","rastrigin_hessian","rastrigin_hessian_const","rosenbrock","rosenbrock_derivative","rosenbrock_derivative_const","rosenbrock_hessian","rosenbrock_hessian_const","schaffer_n2","schaffer_n4","sphere","sphere_derivative","sphere_derivative_const","sphere_hessian","sphere_hessian_const","styblinski_tang","threehumpcamel","zero","zero_derivative"]}; \ No newline at end of file diff --git a/search-index.js b/search-index.js index 911230ef5..c61a9bfb1 100644 --- a/search-index.js +++ b/search-index.js @@ -5,7 +5,7 @@ var searchIndex = JSON.parse('{\ "argmin_observer_paramwriter":{"doc":"Write parameter vectors to a file during optimization.","t":"NNDELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["Binary","JSON","ParamWriter","ParamWriterFormat","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","default","eq","eq","extension","fmt","fmt","from","from","from_subset","from_subset","into","into","is_in_subset","is_in_subset","new","observe_iter","to_owned","to_owned","to_subset","to_subset","to_subset_unchecked","to_subset_unchecked","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip"],"q":[[0,"argmin_observer_paramwriter"],[42,"core::fmt"],[43,"core::fmt"],[44,"argmin::core::kv"],[45,"anyhow"],[46,"core::result"],[47,"argmin::core::state"],[48,"core::option"],[49,"core::any"]],"d":["Use bincode for creating binary files","Use serde_json for creating JSON files","Write parameter vectors to a file during optimization.","Available serializers for ParamWriter.","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","","","Create a new instance of ParamWriter.","","","","","","","","","","","","","","",""],"i":[2,2,0,0,1,2,1,2,1,2,1,2,2,1,2,2,1,2,1,2,1,2,1,2,1,2,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2],"f":[0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[2,2],[[-1,-2],3,[],[]],[[-1,-2],3,[],[]],[[],2],[[1,1],4],[[2,2],4],[2,5],[[1,6],7],[[2,6],7],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,4,[]],[-1,4,[]],[[-1,-1,2],1,[[8,[5]]]],[[1,-1,9],[[11,[3,10]]],12],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[13,[-2]]],[],[]],[-1,[[13,[-2]]],[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,14,[]],[-1,14,[]],[-1,-2,[],[]],[-1,-2,[],[]]],"c":[],"p":[[3,"ParamWriter",0],[4,"ParamWriterFormat",0],[15,"tuple"],[15,"bool"],[15,"str"],[3,"Formatter",42],[6,"Result",42],[8,"AsRef",43],[3,"KV",44],[3,"Error",45],[4,"Result",46],[8,"State",47],[4,"Option",48],[3,"TypeId",49]],"b":[]},\ "argmin_observer_slog":{"doc":"Loggers based on the slog crate","t":"DLLLLLLLLLLLLLLLLLLL","n":["SlogLogger","borrow","borrow_mut","clone","clone_into","from","from_subset","into","is_in_subset","observe_init","observe_iter","term","term_noblock","to_owned","to_subset","to_subset_unchecked","try_from","try_into","type_id","vzip"],"q":[[0,"argmin_observer_slog"],[20,"argmin::core::kv"],[21,"anyhow"],[22,"core::result"],[23,"argmin::core::state"],[24,"core::option"],[25,"core::any"]],"d":["A logger using the slog crate as backend.","","","","","Returns the argument unchanged.","","Calls U::from(self).","","Log basic information about the optimization after …","Logs information about the progress of the optimization …","Log to the terminal.","Log to the terminal without blocking execution.","","","","","","",""],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"f":[0,[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[[-1,-2],2,[],[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,3,[]],[[1,4,-1,5],[[7,[2,6]]],8],[[1,-1,5],[[7,[2,6]]],8],[[],1],[[],1],[-1,-2,[],[]],[-1,[[9,[-2]]],[],[]],[-1,-2,[],[]],[-1,[[7,[-2]]],[],[]],[-1,[[7,[-2]]],[],[]],[-1,10,[]],[-1,-2,[],[]]],"c":[],"p":[[3,"SlogLogger",0],[15,"tuple"],[15,"bool"],[15,"str"],[3,"KV",20],[3,"Error",21],[4,"Result",22],[8,"State",23],[4,"Option",24],[3,"TypeId",25]],"b":[]},\ "argmin_observer_spectator":{"doc":"Observer for Spectator","t":"DLLLLLLLLLLLLLLLLLLLLLLLLL","n":["SpectatorBuilder","borrow","borrow_mut","build","channel_capacity","default","from","from_subset","host","into","is_in_subset","name","new","port","select","selected","to_subset","to_subset_unchecked","try_from","try_into","type_id","vzip","with_channel_capacity","with_host","with_name","with_port"],"q":[[0,"argmin_observer_spectator"],[26,"alloc::string"],[27,"core::convert"],[28,"std::collections::hash::set"],[29,"core::option"],[30,"core::result"],[31,"core::any"]],"d":["Builder for the Spectator observer","","","Build a Spectator instance from the builder","Returns the channel capacity","","Returns the argument unchanged.","","Returns the host this observer will connect to","Calls U::from(self).","","Returns the name of the optimization run","Creates a new SpectatorBuilder","Returns the port this observer will connect to","Define which metrics will be selected in Spectator by …","Returns the selected metrics","","","","","","","Set the channel capacity","Set the host argmin spectator is running on.","Set a name the optimization run will be identified with","Set the port Spectator is running on."],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"f":[0,[-1,-2,[],[]],[-1,-2,[],[]],0,[1,2],[[],1],[-1,-1,[]],[-1,-2,[],[]],[1,3],[-1,-2,[],[]],[-1,4,[]],[1,3],[[],1],[1,5],[[1,[6,[-1]]],1,[[8,[7]]]],[1,[[9,[3]]]],[-1,[[10,[-2]]],[],[]],[-1,-2,[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,12,[]],[-1,-2,[],[]],[[1,2],1],[[1,-1],1,[[8,[7]]]],[[1,-1],1,[[8,[7]]]],[[1,5],1]],"c":[],"p":[[3,"SpectatorBuilder",0],[15,"usize"],[3,"String",26],[15,"bool"],[15,"u16"],[15,"slice"],[15,"str"],[8,"AsRef",27],[3,"HashSet",28],[4,"Option",29],[4,"Result",30],[3,"TypeId",31]],"b":[]},\ -"argmin_testfunctions":{"doc":"Test functions for optimization algorithms","t":"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","n":["ackley","ackley_abc","beale","beale_derivative","beale_hessian","booth","booth_derivative","booth_hessian","bukin_n6","bukin_n6_derivative","bukin_n6_hessian","cross_in_tray","easom","eggholder","goldsteinprice","himmelblau","holder_table","levy","levy_n13","matyas","mccorminck","picheny","rastrigin","rastrigin_a","rastrigin_a_derivative","rastrigin_a_derivative_const","rastrigin_a_hessian","rastrigin_a_hessian_const","rastrigin_derivative","rastrigin_derivative_const","rastrigin_hessian","rastrigin_hessian_const","rosenbrock","rosenbrock_derivative","rosenbrock_derivative_const","rosenbrock_hessian","rosenbrock_hessian_const","schaffer_n2","schaffer_n4","sphere","sphere_derivative","sphere_derivative_const","sphere_hessian","sphere_hessian_const","styblinski_tang","threehumpcamel","zero","zero_derivative"],"q":[[0,"argmin_testfunctions"],[48,"num_traits::float"],[49,"num_traits::cast"],[50,"core::iter::traits::accum"],[51,"core::convert"],[52,"alloc::vec"],[53,"core::ops::arith"]],"d":["Ackley test function","Ackley test function","Beale test function","Derivative of Beale test function","Derivative of Beale test function","Booth test function","Derivative of Booth test function","Hessian of Booth test function","Bukin test function No. 6","Derivative of Bukin test function No. 6","Hessian of Bukin test function No. 6","Cross-in-tray test function","Easom test function","Eggholder test function","Goldstein-Price test function","Himmelblau test function","Holder table test function","Levy test function","Levy test function No. 13","Matyas test function","McCorminck test function","Picheny test function","Rastrigin test function","Rastrigin test function","Derivative of Rastrigin test function where a can be …","Derivative of Rastrigin test function where a can be …","Hessian of Rastrigin test function where a can be chosen …","Hessian of Rastrigin test function where a can be chosen …","Derivative of Rastrigin test function","Derivative of Rastrigin test function","Hessian of Rastrigin test function","Hessian of Rastrigin test function","Multidimensional Rosenbrock test function","Derivative of the multidimensional Rosenbrock test function","Derivative of the multidimensional Rosenbrock test function","Hessian of the multidimensional Rosenbrock test function","Hessian of the multidimensional Rosenbrock test function","Schaffer test function No. 2","Schaffer test function No. 4","Sphere test function","Derivative of sphere test function","Derivative of sphere test function","Hessian of sphere test function","Hessian of sphere test function","Styblinski-Tang test function","Three-hump camel test function","Zero test function","Derivative of zero test function"],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[[[[1,[-1]]],-1,[2,3,4]],[[[1,[-1]],-1,-1,-1],-1,[2,3,4]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],[[5,[-1]]],[2,3]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],[[5,[-1]]],[2,3]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],[[5,[-1]]],[2,3]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3]],[[[5,[-1]]],-1,[2,[7,[6]],3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[1,[-1]]],-1,[2,3,4]],[[[5,[-1]]],-1,[2,3,4]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[1,[-1]]],-1,[2,3,4]],[[[1,[-1]],-1],-1,[2,3,4]],[[[1,[-1]],-1],[[8,[-1]]],[2,3,4,[7,[6]]]],[[[5,[-1]],-1],[[5,[-1]]],[2,3,4,[7,[6]]]],[[[1,[-1]],-1],[[8,[[8,[-1]]]]],[2,3,4,[7,[6]]]],[[[1,[-1]],-1],[[5,[[5,[-1]]]]],[2,3,4,[7,[6]]]],[[[1,[-1]]],[[8,[-1]]],[2,3,4,[7,[6]]]],[[[5,[-1]]],[[5,[-1]]],[2,3,4,[7,[6]]]],[[[1,[-1]]],[[8,[[8,[-1]]]]],[2,3,4,[7,[6]]]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3,4,[7,[6]]]],[[[1,[-1]],-1,-1],-1,[2,3,4]],[[[1,[-1]],-1,-1],[[8,[-1]]],[2,3,9]],[[[5,[-1]],-1,-1],[[5,[-1]]],[2,3,9]],[[[1,[-1]],-1,-1],[[8,[[8,[-1]]]]],[2,3,9]],[[[5,[-1]],-1,-1],[[5,[[5,[-1]]]]],[2,3,9]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[1,[-1]]],-1,[2,3,4]],[[[1,[-1]]],[[8,[-1]]],[2,3]],[[[5,[-1]]],[[5,[-1]]],[2,3]],[[[1,[-1]]],[[8,[[8,[-1]]]]],[2,3]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3]],[[[1,[-1]]],-1,[2,3,4]],[[[5,[-1]]],-1,[2,3]],[[[1,[-1]]],-1,[2,3]],[[[1,[-1]]],[[8,[-1]]],[2,3]]],"c":[],"p":[[15,"slice"],[8,"Float",48],[8,"FromPrimitive",49],[8,"Sum",50],[15,"array"],[15,"f64"],[8,"Into",51],[3,"Vec",52],[8,"AddAssign",53]],"b":[]},\ +"argmin_testfunctions":{"doc":"Test functions for optimization algorithms","t":"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","n":["ackley","ackley_abc","beale","beale_derivative","beale_hessian","booth","booth_derivative","booth_hessian","bukin_n6","bukin_n6_derivative","bukin_n6_hessian","cross_in_tray","easom","easom_derivative","easom_hessian","eggholder","goldsteinprice","himmelblau","holder_table","levy","levy_n13","matyas","mccorminck","picheny","rastrigin","rastrigin_a","rastrigin_a_derivative","rastrigin_a_derivative_const","rastrigin_a_hessian","rastrigin_a_hessian_const","rastrigin_derivative","rastrigin_derivative_const","rastrigin_hessian","rastrigin_hessian_const","rosenbrock","rosenbrock_derivative","rosenbrock_derivative_const","rosenbrock_hessian","rosenbrock_hessian_const","schaffer_n2","schaffer_n4","sphere","sphere_derivative","sphere_derivative_const","sphere_hessian","sphere_hessian_const","styblinski_tang","threehumpcamel","zero","zero_derivative"],"q":[[0,"argmin_testfunctions"],[50,"num_traits::float"],[51,"num_traits::cast"],[52,"core::iter::traits::accum"],[53,"core::convert"],[54,"alloc::vec"],[55,"core::ops::arith"]],"d":["Ackley test function","Ackley test function","Beale test function","Derivative of Beale test function","Derivative of Beale test function","Booth test function","Derivative of Booth test function","Hessian of Booth test function","Bukin test function No. 6","Derivative of Bukin test function No. 6","Hessian of Bukin test function No. 6","Cross-in-tray test function","Easom test function","Derivative of Easom test function","Hessian of Easom test function","Eggholder test function","Goldstein-Price test function","Himmelblau test function","Holder table test function","Levy test function","Levy test function No. 13","Matyas test function","McCorminck test function","Picheny test function","Rastrigin test function","Rastrigin test function","Derivative of Rastrigin test function where a can be …","Derivative of Rastrigin test function where a can be …","Hessian of Rastrigin test function where a can be chosen …","Hessian of Rastrigin test function where a can be chosen …","Derivative of Rastrigin test function","Derivative of Rastrigin test function","Hessian of Rastrigin test function","Hessian of Rastrigin test function","Multidimensional Rosenbrock test function","Derivative of the multidimensional Rosenbrock test function","Derivative of the multidimensional Rosenbrock test function","Hessian of the multidimensional Rosenbrock test function","Hessian of the multidimensional Rosenbrock test function","Schaffer test function No. 2","Schaffer test function No. 4","Sphere test function","Derivative of sphere test function","Derivative of sphere test function","Hessian of sphere test function","Hessian of sphere test function","Styblinski-Tang test function","Three-hump camel test function","Zero test function","Derivative of zero test function"],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[[[[1,[-1]]],-1,[2,3,4]],[[[1,[-1]],-1,-1,-1],-1,[2,3,4]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],[[5,[-1]]],[2,3]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],[[5,[-1]]],[2,3]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],[[5,[-1]]],[2,3]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3]],[[[5,[-1]]],-1,[2,[7,[6]],3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],[[5,[-1]]],[2,3]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[1,[-1]]],-1,[2,3,4]],[[[5,[-1]]],-1,[2,3,4]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[1,[-1]]],-1,[2,3,4]],[[[1,[-1]],-1],-1,[2,3,4]],[[[1,[-1]],-1],[[8,[-1]]],[2,3,4,[7,[6]]]],[[[5,[-1]],-1],[[5,[-1]]],[2,3,4,[7,[6]]]],[[[1,[-1]],-1],[[8,[[8,[-1]]]]],[2,3,4,[7,[6]]]],[[[1,[-1]],-1],[[5,[[5,[-1]]]]],[2,3,4,[7,[6]]]],[[[1,[-1]]],[[8,[-1]]],[2,3,4,[7,[6]]]],[[[5,[-1]]],[[5,[-1]]],[2,3,4,[7,[6]]]],[[[1,[-1]]],[[8,[[8,[-1]]]]],[2,3,4,[7,[6]]]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3,4,[7,[6]]]],[[[1,[-1]],-1,-1],-1,[2,3,4]],[[[1,[-1]],-1,-1],[[8,[-1]]],[2,3,9]],[[[5,[-1]],-1,-1],[[5,[-1]]],[2,3,9]],[[[1,[-1]],-1,-1],[[8,[[8,[-1]]]]],[2,3,9]],[[[5,[-1]],-1,-1],[[5,[[5,[-1]]]]],[2,3,9]],[[[5,[-1]]],-1,[2,3]],[[[5,[-1]]],-1,[2,3]],[[[1,[-1]]],-1,[2,3,4]],[[[1,[-1]]],[[8,[-1]]],[2,3]],[[[5,[-1]]],[[5,[-1]]],[2,3]],[[[1,[-1]]],[[8,[[8,[-1]]]]],[2,3]],[[[5,[-1]]],[[5,[[5,[-1]]]]],[2,3]],[[[1,[-1]]],-1,[2,3,4]],[[[5,[-1]]],-1,[2,3]],[[[1,[-1]]],-1,[2,3]],[[[1,[-1]]],[[8,[-1]]],[2,3]]],"c":[],"p":[[15,"slice"],[8,"Float",50],[8,"FromPrimitive",51],[8,"Sum",52],[15,"array"],[15,"f64"],[8,"Into",53],[3,"Vec",54],[8,"AddAssign",55]],"b":[]},\ "spectator":{"doc":"spectator","t":"NRNENNNNLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMM","n":["BestParam","DEFAULT_PORT","FuncCounts","Message","NewRun","Param","Samples","Termination","borrow","borrow_mut","clone","clone_into","deserialize","eq","fmt","from","from_subset","into","is_in_subset","pack","serialize","to_owned","to_subset","to_subset_unchecked","try_from","try_into","type_id","unpack","vzip","init_param","iter","iter","iter","iter","kv","kv","max_iter","name","name","name","name","name","name","param","param","selected","settings","solver","target_cost","termination_status","termination_status","time"],"q":[[0,"spectator"],[29,"spectator::Message"],[52,"core::result"],[53,"serde::de"],[54,"core::fmt"],[55,"core::fmt"],[56,"anyhow"],[57,"serde::ser"],[58,"core::option"],[59,"core::any"],[60,"bytes::bytes_mut"]],"d":["Current best parameter vector","Default port used by spectator","Function evaluation counts (Cost function, gradient, …","Enum used to encode information sent to spectator.","Register a new run","Parameter vector","A set of metrics samples sent after an iteration","Termination","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","Serialize message","","","","","","","","Deserialize message","","Initial parameter vector","Current iteration","Current iteration","Current iteration","Current iteration","Solver-specific metrics","Function counts","Maximum number of iterations","Name of the run","Name of the run","Name of the run","Name of the run","Name of the run","Name of the run","Current parameter vector","Current best parameter vector","Preselected metrics","Solver-specific settings (returned by the init method of …","Name of the solver","Target cost function value","Current termination_status","Termination status","Time needed for this iteration"],"i":[1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,14,15,16,17,18,15,16,14,14,15,16,17,18,19,17,18,14,14,14,14,15,19,15],"f":[0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[1,1],[[-1,-2],2,[],[]],[-1,[[3,[1]]],4],[[1,1],5],[[1,6],7],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,5,[]],[1,[[3,[8,9]]]],[[1,-1],3,10],[-1,-2,[],[]],[-1,[[11,[-2]]],[],[]],[-1,-2,[],[]],[-1,[[3,[-2]]],[],[]],[-1,[[3,[-2]]],[],[]],[-1,12,[]],[13,[[3,[1,9]]]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[4,"Message",0],[15,"tuple"],[4,"Result",52],[8,"Deserializer",53],[15,"bool"],[3,"Formatter",54],[6,"Result",54],[3,"Bytes",55],[3,"Error",56],[8,"Serializer",57],[4,"Option",58],[3,"TypeId",59],[3,"BytesMut",60],[13,"NewRun",29],[13,"Samples",29],[13,"FuncCounts",29],[13,"Param",29],[13,"BestParam",29],[13,"Termination",29]],"b":[]}\ }'); if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; diff --git a/src/argmin_testfunctions/easom.rs.html b/src/argmin_testfunctions/easom.rs.html index 325208911..734d9130d 100644 --- a/src/argmin_testfunctions/easom.rs.html +++ b/src/argmin_testfunctions/easom.rs.html @@ -48,6 +48,98 @@ 48 49 50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142
    // Copyright 2018-2024 argmin developers
     //
     // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
    @@ -86,16 +178,108 @@
         -x1.cos() * x2.cos() * (-(x1 - pi).powi(2) - (x2 - pi).powi(2)).exp()
     }
     
    +/// Derivative of Easom test function
    +pub fn easom_derivative<T>(param: &[T; 2]) -> [T; 2]
    +where
    +    T: Float + FromPrimitive,
    +{
    +    let [x1, x2] = *param;
    +
    +    let pi = T::from_f64(PI).unwrap();
    +    let n2 = T::from_f64(2.0).unwrap();
    +
    +    let factor = (-(x1 - pi).powi(2) - (x2 - pi).powi(2)).exp();
    +
    +    [
    +        factor * x2.cos() * (x1.sin() + n2 * x1 * x1.cos() - n2 * pi * x1.cos()),
    +        factor * x1.cos() * (x2.sin() + n2 * x2 * x2.cos() - n2 * pi * x2.cos()),
    +    ]
    +}
    +
    +/// Hessian of Easom test function
    +pub fn easom_hessian<T>(param: &[T; 2]) -> [[T; 2]; 2]
    +where
    +    T: Float + FromPrimitive,
    +{
    +    let [x1, x2] = *param;
    +
    +    let pi = T::from_f64(PI).unwrap();
    +    let n2 = T::from_f64(2.0).unwrap();
    +    let n4 = T::from_f64(4.0).unwrap();
    +    let n3 = T::from_f64(3.0).unwrap();
    +    let n8 = T::from_f64(8.0).unwrap();
    +
    +    let x1cos = x1.cos();
    +    let x1sin = x1.sin();
    +    let x2cos = x2.cos();
    +    let x2sin = x2.sin();
    +    let factor = (-(x1 - pi).powi(2) - (x2 - pi).powi(2)).exp();
    +    let offdiag = factor * (x1sin + n2 * (x1 - pi) * x1cos) * (n2 * (pi - x2) * x2cos - x2sin);
    +
    +    [
    +        [
    +            factor
    +                * x2cos
    +                * (n4 * (pi - x1) * x1sin
    +                    + (-n4 * x1.powi(2) + n8 * pi * x1 - n4 * pi.powi(2) + n3) * x1cos),
    +            offdiag,
    +        ],
    +        [
    +            offdiag,
    +            factor
    +                * x1cos
    +                * (n4 * (pi - x2) * x2sin
    +                    + (-n4 * x2.powi(2) + n8 * pi * x2 - n4 * pi.powi(2) + n3) * x2cos),
    +        ],
    +    ]
    +}
    +
     #[cfg(test)]
     mod tests {
         use super::*;
         use approx::assert_relative_eq;
    +    use finitediff::FiniteDiff;
    +    use proptest::prelude::*;
         use std::{f32, f32::consts::PI as PI32, f64, f64::consts::PI as PI64};
     
         #[test]
         fn test_easom_optimum() {
             assert_relative_eq!(easom(&[PI32, PI32]), -1.0_f32, epsilon = f32::EPSILON);
             assert_relative_eq!(easom(&[PI64, PI64]), -1.0_f64, epsilon = f64::EPSILON);
    +
    +        let deriv = easom_derivative(&[PI64, PI64]);
    +        for i in 0..2 {
    +            assert_relative_eq!(deriv[i], 0.0_f64, epsilon = f64::EPSILON);
    +        }
    +    }
    +
    +    proptest! {
    +        #[test]
    +        fn test_easom_derivative_finitediff(a in -100.0..100.0, b in -100.0..100.0) {
    +            let param = [a, b];
    +            let derivative = easom_derivative(&param);
    +            let derivative_fd = Vec::from(param).central_diff(&|x| easom(&[x[0], x[1]]));
    +            for i in 0..derivative.len() {
    +                assert_relative_eq!(derivative[i], derivative_fd[i], epsilon = 1e-5);
    +            }
    +        }
    +    }
    +
    +    proptest! {
    +        #[test]
    +        fn test_easom_hessian_finitediff(a in -100.0..100.0, b in -100.0..100.0) {
    +            let param = [a, b];
    +            let hessian = easom_hessian(&param);
    +            let hessian_fd =
    +                Vec::from(param).forward_hessian(&|x| easom_derivative(&[x[0], x[1]]).to_vec());
    +            let n = hessian.len();
    +            for i in 0..n {
    +                assert_eq!(hessian[i].len(), n);
    +                for j in 0..n {
    +                    assert_relative_eq!(hessian[i][j], hessian_fd[i][j], epsilon = 1e-5);
    +                }
    +            }
    +        }
         }
     }
     
    \ No newline at end of file