pub struct LocalKCut { /* private fields */ }Expand description
Deterministic local k-cut algorithm
Implementations§
Source§impl LocalKCut
impl LocalKCut
pub fn into_reference(val: LocalKCut, env: Env) -> Result<Reference<LocalKCut>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<LocalKCut>>
Source§impl LocalKCut
impl LocalKCut
Sourcepub fn new(lambda_max: i64, volume_bound: u32, beta: u32) -> Self
pub fn new(lambda_max: i64, volume_bound: u32, beta: u32) -> Self
Create new LocalKCut structure
§Arguments
lambda_max- Maximum cut valuevolume_bound- Maximum volume (nu parameter)beta- Cut depth parameter
Sourcepub fn insert_edge(&mut self, u: u32, v: u32, weight: f64)
pub fn insert_edge(&mut self, u: u32, v: u32, weight: f64)
Insert an edge
Sourcepub fn delete_edge(&mut self, u: u32, v: u32)
pub fn delete_edge(&mut self, u: u32, v: u32)
Delete an edge
Sourcepub fn query(&self, source: u32) -> Vec<JsLocalCut>
pub fn query(&self, source: u32) -> Vec<JsLocalCut>
Query local cuts from a source
Sourcepub fn num_vertices(&self) -> u32
pub fn num_vertices(&self) -> u32
Get number of vertices
Trait Implementations§
Source§impl FromNapiMutRef for LocalKCut
impl FromNapiMutRef for LocalKCut
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 LocalKCut
impl FromNapiRef for LocalKCut
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 &LocalKCut
impl FromNapiValue for &LocalKCut
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 LocalKCut
impl FromNapiValue for &mut LocalKCut
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 LocalKCut
impl ToNapiValue for LocalKCut
Source§unsafe fn to_napi_value(env: napi_env, val: LocalKCut) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: LocalKCut) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &LocalKCut
impl ValidateNapiValue for &LocalKCut
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 LocalKCut
impl ValidateNapiValue for &mut LocalKCut
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 LocalKCut
impl RefUnwindSafe for LocalKCut
impl Send for LocalKCut
impl Sync for LocalKCut
impl Unpin for LocalKCut
impl UnwindSafe for LocalKCut
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