pub struct MinCut { /* private fields */ }Expand description
Node.js wrapper for DynamicMinCut
Implementations§
Source§impl MinCut
impl MinCut
pub fn into_reference(val: MinCut, env: Env) -> Result<Reference<MinCut>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<MinCut>>
Source§impl MinCut
impl MinCut
Sourcepub fn new(config: Option<JsMinCutConfig>) -> Result<Self>
pub fn new(config: Option<JsMinCutConfig>) -> Result<Self>
Create a new empty minimum cut structure
Sourcepub fn from_edges(
edges: Vec<(u32, u32, f64)>,
config: Option<JsMinCutConfig>,
) -> Result<Self>
pub fn from_edges( edges: Vec<(u32, u32, f64)>, config: Option<JsMinCutConfig>, ) -> Result<Self>
Create from edges array
Sourcepub fn insert_edge(&self, u: u32, v: u32, weight: f64) -> Result<f64>
pub fn insert_edge(&self, u: u32, v: u32, weight: f64) -> Result<f64>
Insert an edge (returns new min cut value)
Sourcepub fn delete_edge(&self, u: u32, v: u32) -> Result<f64>
pub fn delete_edge(&self, u: u32, v: u32) -> Result<f64>
Delete an edge (returns new min cut value)
Sourcepub fn min_cut_value(&self) -> f64
pub fn min_cut_value(&self) -> f64
Get minimum cut value
Sourcepub fn min_cut(&self) -> JsMinCutResult
pub fn min_cut(&self) -> JsMinCutResult
Get detailed minimum cut result
Sourcepub fn partition(&self) -> Result<JsPartition>
pub fn partition(&self) -> Result<JsPartition>
Get partition: returns { s: number[], t: number[] }
Sourcepub fn num_vertices(&self) -> u32
pub fn num_vertices(&self) -> u32
Get number of vertices
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if graph is connected
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset statistics
Trait Implementations§
Source§impl FromNapiMutRef for MinCut
impl FromNapiMutRef for MinCut
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for MinCut
impl FromNapiRef for MinCut
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &MinCut
impl FromNapiValue for &MinCut
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut MinCut
impl FromNapiValue for &mut MinCut
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ToNapiValue for MinCut
impl ToNapiValue for MinCut
Source§unsafe fn to_napi_value(env: napi_env, val: MinCut) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: MinCut) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &MinCut
impl ValidateNapiValue for &MinCut
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut MinCut
impl ValidateNapiValue for &mut MinCut
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for MinCut
impl RefUnwindSafe for MinCut
impl Send for MinCut
impl Sync for MinCut
impl Unpin for MinCut
impl UnsafeUnpin for MinCut
impl UnwindSafe for MinCut
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more