pub struct Executor<O: ArgminOp, S> {
pub op: OpWrapper<O>,
/* private fields */
}
Expand description
Executes a solver
Fields§
§op: OpWrapper<O>
operator
Implementations§
Source§impl<O, S> Executor<O, S>
impl<O, S> Executor<O, S>
Sourcepub fn new(op: O, solver: S, init_param: O::Param) -> Self
pub fn new(op: O, solver: S, init_param: O::Param) -> Self
Create a new executor with a solver
and an initial parameter init_param
Sourcepub fn from_checkpoint<P: AsRef<Path>>(path: P, op: O) -> Result<Self, Error>where
Self: Sized + DeserializeOwned,
pub fn from_checkpoint<P: AsRef<Path>>(path: P, op: O) -> Result<Self, Error>where
Self: Sized + DeserializeOwned,
Create a new executor from a checkpoint
Sourcepub fn run(self) -> Result<ArgminResult<O>, Error>
pub fn run(self) -> Result<ArgminResult<O>, Error>
Run the executor
Sourcepub fn add_observer<OBS: Observe<O> + 'static>(
self,
observer: OBS,
mode: ObserverMode,
) -> Self
pub fn add_observer<OBS: Observe<O> + 'static>( self, observer: OBS, mode: ObserverMode, ) -> Self
Attaches a observer which implements ArgminLog
to the solver.
Sourcepub fn target_cost(self, cost: O::Float) -> Self
pub fn target_cost(self, cost: O::Float) -> Self
Set target cost value
Sourcepub fn checkpoint_dir(self, dir: &str) -> Self
pub fn checkpoint_dir(self, dir: &str) -> Self
Set checkpoint directory
Sourcepub fn checkpoint_name(self, dir: &str) -> Self
pub fn checkpoint_name(self, dir: &str) -> Self
Set checkpoint name
Sourcepub fn checkpoint_mode(self, mode: CheckpointMode) -> Self
pub fn checkpoint_mode(self, mode: CheckpointMode) -> Self
Set the checkpoint mode
Trait Implementations§
Source§impl<'de, O, S> Deserialize<'de> for Executor<O, S>
impl<'de, O, S> Deserialize<'de> for Executor<O, S>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<O, S> Freeze for Executor<O, S>
impl<O, S> RefUnwindSafe for Executor<O, S>where
S: RefUnwindSafe,
<O as ArgminOp>::Param: RefUnwindSafe,
<O as ArgminOp>::Float: RefUnwindSafe,
O: RefUnwindSafe,
<O as ArgminOp>::Hessian: RefUnwindSafe,
<O as ArgminOp>::Jacobian: RefUnwindSafe,
impl<O, S> !Send for Executor<O, S>
impl<O, S> !Sync for Executor<O, S>
impl<O, S> Unpin for Executor<O, S>
impl<O, S> UnwindSafe for Executor<O, S>where
S: UnwindSafe,
<O as ArgminOp>::Param: UnwindSafe,
<O as ArgminOp>::Float: UnwindSafe,
O: UnwindSafe,
<O as ArgminOp>::Hessian: UnwindSafe,
<O as ArgminOp>::Jacobian: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more