File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,11 +82,9 @@ num = "0.4"
8282# Our own stuff - L-BFGS: limited-memory BFGS directions
8383lbfgs = " 0.3"
8484
85- # Instant is a generic timer that works on Wasm ( with wasm-bindgen)
86- instant = { version = " 0.1 " }
85+ # Cross-platform time primitives with WebAssembly support
86+ web-time = " 1 "
8787
88- # Wasm-bindgen is only activated if OpEn is compiled with `--features wasm`
89- wasm-bindgen = { version = " 0.2" , optional = true }
9088
9189# sc-allocator provides an implementation of a bump allocator
9290rpmalloc = { version = " 0.2" , features = [
@@ -116,9 +114,6 @@ jem = ["jemallocator"]
116114# RPMalloc
117115rp = [" rpmalloc" ]
118116
119- # WebAssembly
120- wasm = [" wasm-bindgen" , " instant/wasm-bindgen" , " instant/inaccurate" ]
121-
122117# --------------------------------------------------------------------------
123118# T.E.S.T. D.E.P.E.N.D.E.N.C.I.E.S
124119# --------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -914,7 +914,7 @@ where
914914 pub fn solve ( & mut self , u : & mut [ f64 ] ) -> Result < AlmOptimizerStatus , SolverError > {
915915 let mut num_outer_iterations = 0 ;
916916 // let tic = std::time::Instant::now();
917- let tic = instant :: Instant :: now ( ) ;
917+ let tic = web_time :: Instant :: now ( ) ;
918918 let mut exit_status = ExitStatus :: Converged ;
919919 self . alm_cache . reset ( ) ; // first, reset the cache
920920 self . alm_cache . available_time = self . max_duration ;
Original file line number Diff line number Diff line change 9999 ConstraintType : constraints:: Constraint + ' life ,
100100{
101101 fn solve ( & mut self , u : & mut [ f64 ] ) -> Result < SolverStatus , SolverError > {
102- let now = instant :: Instant :: now ( ) ;
102+ let now = web_time :: Instant :: now ( ) ;
103103
104104 // Initialize - propagate error upstream, if any
105105 self . fbs_engine . init ( u) ?;
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ where
123123 ConstraintType : constraints:: Constraint + ' life ,
124124{
125125 fn solve ( & mut self , u : & mut [ f64 ] ) -> Result < SolverStatus , SolverError > {
126- let now = instant :: Instant :: now ( ) ;
126+ let now = web_time :: Instant :: now ( ) ;
127127
128128 /*
129129 * Initialise [call panoc_engine.init()]
@@ -218,7 +218,7 @@ mod tests {
218218 let mut panoc_cache = PANOCCache :: new ( n_dimension, tolerance, lbfgs_memory) ;
219219 let problem = Problem :: new ( & bounds, cost_gradient, cost_function) ;
220220 let mut panoc = PANOCOptimizer :: new ( problem, & mut panoc_cache) . with_max_iter ( max_iters) ;
221- let now = instant :: Instant :: now ( ) ;
221+ let now = web_time :: Instant :: now ( ) ;
222222 let status = panoc. solve ( & mut u_solution) . unwrap ( ) ;
223223
224224 println ! ( "{} iterations" , status. iterations( ) ) ;
You can’t perform that action at this time.
0 commit comments