pub struct Workspace {Show 31 fields
pub tmp1: Vec<S>,
pub tmp2: Vec<S>,
pub pipelined_w: Vec<S>,
pub pipelined_wtmp: Vec<S>,
pub pipelined_payload: Vec<R>,
pub bridge: BridgeScratch,
pub bridge_tmp: Vec<S>,
pub q_s: Vec<Vec<S>>,
pub z_s: Vec<Vec<S>>,
pub h_s: Vec<Vec<S>>,
pub q: Vec<Vec<S>>,
pub z: Vec<Vec<S>>,
pub h: Vec<Vec<S>>,
pub v_mem: Vec<S>,
pub z_mem: Vec<S>,
pub h_mem: Vec<S>,
pub givens_col_scratch: Vec<S>,
pub cs: Vec<R>,
pub sn: Vec<S>,
pub g: Vec<S>,
pub blk_scratch: Vec<S>,
pub blk_payload: Vec<R>,
pub block_buf: Option<BlockVec>,
pub tsqr: Option<TsqrWorkspace>,
pub gmres_sstep: Option<GmresSStepWorkspace>,
pub gmres_recycle: RecyclingSpace,
pub reduction: ReductOptions,
pub reduction_engine: Option<Arc<dyn ReductionEngine>>,
pub send_arena: BufferPool<u8>,
pub recv_arena: BufferPool<u8>,
pub packet_arena: BufferPool<u8>,
/* private fields */
}Fields§
§tmp1: Vec<S>§tmp2: Vec<S>§pipelined_w: Vec<S>§pipelined_wtmp: Vec<S>§pipelined_payload: Vec<R>§bridge: BridgeScratch§bridge_tmp: Vec<S>§q_s: Vec<Vec<S>>§z_s: Vec<Vec<S>>§h_s: Vec<Vec<S>>§q: Vec<Vec<S>>§z: Vec<Vec<S>>§h: Vec<Vec<S>>§v_mem: Vec<S>§z_mem: Vec<S>§h_mem: Vec<S>§givens_col_scratch: Vec<S>§cs: Vec<R>§sn: Vec<S>§g: Vec<S>§blk_scratch: Vec<S>§blk_payload: Vec<R>§block_buf: Option<BlockVec>§tsqr: Option<TsqrWorkspace>§gmres_sstep: Option<GmresSStepWorkspace>§gmres_recycle: RecyclingSpace§reduction: ReductOptions§reduction_engine: Option<Arc<dyn ReductionEngine>>§send_arena: BufferPool<u8>§recv_arena: BufferPool<u8>§packet_arena: BufferPool<u8>Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn new(n: usize) -> Self
pub fn new(n: usize) -> Self
Examples found in repository?
examples/complex_matrix_market_demo.rs (line 2503)
2440 fn run_once(
2441 problem: &Problem,
2442 spec: &RunSpec,
2443 bench_cfg: &BenchmarkConfig,
2444 ) -> Result<ResultRow, KError> {
2445 let b_unscaled = &problem.rhs;
2446 let (row_scaling, op_scaled): (Option<Vec<R>>, Arc<dyn KLinOp<Scalar = S>>) =
2447 if bench_cfg.row_scale {
2448 let d = compute_row_scaling(problem.csr_for_pc.as_ref(), bench_cfg.row_scale_tiny);
2449 (
2450 Some(d.clone()),
2451 Arc::new(RowScaledOp {
2452 base: problem.op.clone(),
2453 d,
2454 }),
2455 )
2456 } else {
2457 (None, problem.op.clone())
2458 };
2459 let pc_csr: Arc<SparseCsrMatrix<S>> = if bench_cfg.row_scale {
2460 let row_scale = row_scaling.as_ref().ok_or_else(|| {
2461 KError::InvalidInput("row scaling requested but factors were not computed".into())
2462 })?;
2463 Arc::new(scale_csr_rows(problem.csr_for_pc.as_ref(), row_scale))
2464 } else {
2465 problem.csr_for_pc.clone()
2466 };
2467 let global_pc_csr: Arc<SparseCsrMatrix<S>> = if bench_cfg.row_scale {
2468 let row_scale = row_scaling.as_ref().ok_or_else(|| {
2469 KError::InvalidInput("row scaling requested but factors were not computed".into())
2470 })?;
2471 Arc::new(scale_csr_rows(problem.global_csr.as_ref(), row_scale))
2472 } else {
2473 problem.global_csr.clone()
2474 };
2475 let b_scaled: Vec<S> = if let Some(d) = &row_scaling {
2476 b_unscaled
2477 .iter()
2478 .zip(d.iter())
2479 .map(|(bi, di)| *bi * S::from_real(*di))
2480 .collect()
2481 } else {
2482 b_unscaled.clone()
2483 };
2484 let b = &b_scaled;
2485 let effective_pc_side = normalized_fgmres_side(spec.pc_side);
2486 let csr_pc_diag = csr_for_pc_diagnostics(
2487 pc_csr.as_ref(),
2488 problem.local_rows_nnz,
2489 problem.zero_global_rows_local,
2490 );
2491 let setup_start = Instant::now();
2492 let mut pc = setup_preconditioner_for_run_once(
2493 problem,
2494 spec,
2495 bench_cfg,
2496 &pc_csr,
2497 &global_pc_csr,
2498 &csr_pc_diag,
2499 )?;
2500 let setup_secs = setup_start.elapsed().as_secs_f64();
2501 for _ in 0..bench_cfg.warmup_runs {
2502 let mut x = vec![S::zero(); problem.local_n];
2503 let mut workspace = Workspace::new(problem.local_n);
2504 let _ = solve_with_selected_ksp(
2505 spec,
2506 bench_cfg,
2507 problem,
2508 op_scaled.as_ref(),
2509 pc.as_mut().map(PcHandle::as_kpc_mut),
2510 b,
2511 &mut x,
2512 effective_pc_side,
2513 None,
2514 Some(&mut workspace),
2515 )?;
2516 }
2517
2518 let mut solve_times = Vec::with_capacity(bench_cfg.measured_runs);
2519 let mut x_last = vec![S::zero(); problem.local_n];
2520 let mut final_stats = None;
2521 let mut residual_history_last = RunResidualHistory::default();
2522 for _ in 0..bench_cfg.measured_runs {
2523 let mut x = vec![S::zero(); problem.local_n];
2524 problem.comm.barrier();
2525 let start = Instant::now();
2526 let mut workspace = Workspace::new(problem.local_n);
2527 let mut run_history = RunResidualHistory::default();
2528 let mut monitors: Vec<Box<MonitorCallback<R>>> = Vec::new();
2529 if bench_cfg.residual_history {
2530 monitors.push(Box::new(|it, res, _| {
2531 let _ = (it, res);
2532 MonitorAction::Continue
2533 }));
2534 }
2535 let history_ref = std::sync::Arc::new(std::sync::Mutex::new(Vec::<(usize, R)>::new()));
2536 if bench_cfg.residual_history {
2537 let history_ref_c = history_ref.clone();
2538 monitors.clear();
2539 monitors.push(Box::new(move |it, res, _| {
2540 if let Ok(mut h) = history_ref_c.lock() {
2541 h.push((it, res));
2542 }
2543 MonitorAction::Continue
2544 }));
2545 }
2546 let stats = solve_with_selected_ksp(
2547 spec,
2548 bench_cfg,
2549 problem,
2550 op_scaled.as_ref(),
2551 pc.as_mut().map(PcHandle::as_kpc_mut),
2552 b,
2553 &mut x,
2554 effective_pc_side,
2555 if monitors.is_empty() {
2556 None
2557 } else {
2558 Some(&monitors)
2559 },
2560 Some(&mut workspace),
2561 )?;
2562 if bench_cfg.residual_history {
2563 if let Ok(h) = history_ref.lock() {
2564 run_history.entries = h
2565 .iter()
2566 .map(|(it, res)| ResidualHistoryEntry {
2567 iter: *it,
2568 recurrence_residual: *res,
2569 true_residual: None,
2570 checkpoint: false,
2571 })
2572 .collect();
2573 }
2574 residual_history_last = run_history;
2575 }
2576 problem.comm.barrier();
2577 let solve_secs = start.elapsed().as_secs_f64();
2578 solve_times.push(solve_secs);
2579 x_last = x;
2580 final_stats = Some(stats);
2581 }
2582 let stats = final_stats
2583 .ok_or_else(|| KError::InvalidInput("no measured solve run executed".into()))?;
2584 // Row scaling changes only equations (D_r A x = D_r b), so x is unchanged.
2585 // Keep an explicit "map-back" step so optional future column scaling can hook here.
2586 let x_unscaled = x_last;
2587 let min_solve_secs = solve_times.iter().copied().fold(f64::INFINITY, f64::min);
2588 let median_solve_secs = median(&mut solve_times);
2589
2590 let reductions = stats.counters.num_global_reductions;
2591 let overlapped_reduction_waits = stats.counters.overlap_global_reductions;
2592 let model_predicted_reductions = stats
2593 .reduction_model
2594 .as_ref()
2595 .map(|model| model.estimate_total(stats.iterations));
2596 let (explicit_true_residual, explicit_true_residual_rel) =
2597 if bench_cfg.run_mode == RunMode::Correctness {
2598 let mut ax = vec![S::zero(); b.len()];
2599 let mut scratch = BridgeScratch::default();
2600 problem.op.matvec_s(&x_unscaled, &mut ax, &mut scratch);
2601 for (ri, bi) in ax.iter_mut().zip(b_unscaled.iter().copied()) {
2602 *ri = bi - *ri;
2603 }
2604 let r2_local = ax.iter().map(|v| v.abs2()).sum::<f64>();
2605 let true_res = problem.comm.all_reduce_f64(r2_local).sqrt();
2606 let rhs_norm2_local = b_unscaled.iter().map(|v| v.abs2()).sum::<f64>();
2607 let rhs_norm = problem.comm.all_reduce_f64(rhs_norm2_local).sqrt();
2608 let rel_true = true_res / rhs_norm.max(f64::MIN_POSITIVE);
2609 (Some(true_res), Some(rel_true))
2610 } else {
2611 (None, None)
2612 };
2613 if bench_cfg.residual_history && bench_cfg.measured_runs > 0 && problem.comm.rank() == 0 {
2614 let mut checkpoint_count = 0usize;
2615 // mark restart boundaries based on effective restart interval and policy
2616 let restart = stats.effective_restart.unwrap_or(spec.restart).max(1);
2617 for e in &mut residual_history_last.entries {
2618 if e.iter > 0 && e.iter % restart == 0 {
2619 e.checkpoint = true;
2620 if matches!(
2621 spec.residual_check_policy,
2622 ResidualCheckPolicy::RestartOnly
2623 | ResidualCheckPolicy::OnConvergence
2624 | ResidualCheckPolicy::EveryIteration
2625 | ResidualCheckPolicy::Debug
2626 ) {
2627 e.true_residual = explicit_true_residual;
2628 }
2629 checkpoint_count += 1;
2630 }
2631 }
2632 println!(
2633 "[history][rank0] {}: {} points, {} restart checkpoints",
2634 format!(
2635 "{} [row-scale={}]",
2636 spec.method_label(),
2637 if bench_cfg.row_scale { "on" } else { "off" }
2638 ),
2639 residual_history_last.entries.len(),
2640 checkpoint_count
2641 );
2642 if let Some(path) = &bench_cfg.residual_history_file {
2643 dump_residual_history(path, &residual_history_last)?;
2644 println!("[history][rank0] wrote {}", path.display());
2645 }
2646 }
2647
2648 let x_error_rel = if bench_cfg.run_mode == RunMode::Correctness
2649 && problem.rhs_source == RhsSource::GeneratedAOnes
2650 && problem.solution_reference.valid_for_x_error()
2651 {
2652 let err2_local = x_unscaled
2653 .iter()
2654 .map(|xi| (*xi - S::one()).abs2())
2655 .sum::<f64>();
2656 let one2_local = x_unscaled.iter().map(|_| S::one().abs2()).sum::<f64>();
2657 let err = problem.comm.all_reduce_f64(err2_local).sqrt();
2658 let one_norm = problem.comm.all_reduce_f64(one2_local).sqrt();
2659 Some(err / one_norm.max(f64::MIN_POSITIVE))
2660 } else {
2661 None
2662 };
2663 let global_reference_check = if bench_cfg.run_mode == RunMode::Correctness {
2664 Some(global_reference_residual(problem, &x_unscaled, b_unscaled)?)
2665 } else {
2666 None
2667 };
2668 let verdict_tol = correctness_verdict_tolerance(bench_cfg);
2669 let dist_ok = explicit_true_residual_rel.map(|rel| rel <= verdict_tol);
2670 let global_ok = global_reference_check
2671 .as_ref()
2672 .map(|check| check.true_residual_rel <= verdict_tol);
2673 let x_ok = if bench_cfg.run_mode == RunMode::Correctness
2674 && problem.rhs_source == RhsSource::GeneratedAOnes
2675 && problem.solution_reference.valid_for_x_error()
2676 {
2677 global_reference_check
2678 .as_ref()
2679 .and_then(|check| check.x_error_rel)
2680 .map(|rel| rel <= verdict_tol)
2681 } else {
2682 None
2683 };
2684 let dof_per_sec = if matches!(
2685 problem.backend,
2686 CsrBackend::Serial | CsrBackend::Distributed
2687 ) && median_solve_secs > 0.0
2688 {
2689 Some(problem.global_n as f64 / median_solve_secs)
2690 } else {
2691 None
2692 };
2693
2694 Ok(ResultRow {
2695 operator_storage: operator_storage_label(problem),
2696 execution_backend: execution_backend_label(problem),
2697 pc_domain: pc_domain_label(spec.pc, problem),
2698 pc_apply: pc_apply_label(spec.pc, problem),
2699 method: format!(
2700 "{} [row-scale={}]",
2701 spec.method_label(),
2702 if bench_cfg.row_scale { "on" } else { "off" }
2703 ),
2704 requested_policy: spec.requested_policy_label(),
2705 effective_policy: format!(
2706 "ksp={}, variant={}, restart={}, residual-check={}",
2707 spec.ksp.label(),
2708 stats
2709 .effective_variant
2710 .as_deref()
2711 .unwrap_or(variant_label(spec.variant)),
2712 stats.effective_restart.unwrap_or(spec.restart),
2713 stats
2714 .effective_residual_check_policy
2715 .as_deref()
2716 .unwrap_or(residual_check_policy_label(spec.residual_check_policy))
2717 ) + if bench_cfg.run_mode == RunMode::Correctness
2718 && bench_cfg.mark_replicated_check
2719 {
2720 " [replicated-check=enabled]"
2721 } else {
2722 ""
2723 },
2724 setup_secs,
2725 median_solve_secs,
2726 min_solve_secs,
2727 iterations: stats.iterations,
2728 reductions,
2729 overlapped_reduction_waits,
2730 model_predicted_reductions,
2731 restart_count: stats.fgmres_counters.as_ref().map(|c| c.restart_count),
2732 inner_iterations_last_cycle: stats
2733 .fgmres_counters
2734 .as_ref()
2735 .map(|c| c.inner_iterations_last_cycle),
2736 pipeline_fallbacks: stats.fgmres_counters.as_ref().map(|c| c.pipeline_fallbacks),
2737 reported_residual: stats.final_residual,
2738 explicit_true_residual,
2739 explicit_true_residual_rel,
2740 x_error_rel,
2741 global_true_residual: global_reference_check
2742 .as_ref()
2743 .map(|check| check.true_residual),
2744 global_true_residual_rel: global_reference_check
2745 .as_ref()
2746 .map(|check| check.true_residual_rel),
2747 global_x_error_rel: global_reference_check.and_then(|check| check.x_error_rel),
2748 dist_ok,
2749 global_ok,
2750 x_ok,
2751 reason: stats.reason,
2752 dof_per_sec,
2753 })
2754 }Sourcepub fn ensure_comm_bytes(&mut self, max_send: usize, max_recv: usize)
pub fn ensure_comm_bytes(&mut self, max_send: usize, max_recv: usize)
Ensure communication buffers have enough bytes for upcoming operations.
Sourcepub fn ensure_block(&mut self, n: usize, p: usize)
pub fn ensure_block(&mut self, n: usize, p: usize)
Ensure the reusable block vector has capacity n x p.
Sourcepub fn ensure_tsqr(&mut self, w_max: usize)
pub fn ensure_tsqr(&mut self, w_max: usize)
Ensure the TSQR workspace supports panels up to width w_max.
pub fn ensure_sstep(&mut self, n: usize, s: usize, m: usize)
pub fn sstep_mut(&mut self) -> Option<&mut GmresSStepWorkspace>
pub fn n(&self) -> usize
Sourcepub fn local_work_estimate(&self) -> usize
pub fn local_work_estimate(&self) -> usize
Lightweight estimate of local work used by adaptive execution policy.
pub fn m(&self) -> usize
pub fn has_z(&self) -> bool
pub fn ld_h(&self) -> usize
Sourcepub fn acquire_gmres(&mut self, spec: GmresSpec)
pub fn acquire_gmres(&mut self, spec: GmresSpec)
Ensure capacity for a (F)GMRES run. Idempotent and allocation-friendly.
Sourcepub fn clear_gmres_restart_state(&mut self)
pub fn clear_gmres_restart_state(&mut self)
Clear per-restart GMRES/FGMRES state while preserving allocation capacity.
Sourcepub fn clear_gmres_global_scratch(&mut self)
pub fn clear_gmres_global_scratch(&mut self)
Clear solve-global scratch vectors used by GMRES/FGMRES without releasing memory.
pub fn set_reduction_options(&mut self, opt: ReductOptions)
pub fn set_reduction_engine(&mut self, engine: Arc<dyn ReductionEngine>)
pub fn clear_reduction_engine(&mut self)
pub fn reduction_engine(&self) -> Option<&Arc<dyn ReductionEngine>>
pub fn set_reduction_mode(&mut self, mode: ReproMode)
pub fn reduction_options(&self) -> &ReductOptions
pub fn v_col(&mut self, j: usize) -> &mut [S] ⓘ
pub fn z_col(&mut self, j: usize) -> &mut [S] ⓘ
pub fn h_at(&self, i: usize, j: usize) -> S
pub fn h_at_mut(&mut self, i: usize, j: usize) -> &mut S
pub fn v_cols2(&mut self, a: usize, b: usize) -> (&mut [S], &mut [S])
pub fn z_cols2(&mut self, a: usize, b: usize) -> (&mut [S], &mut [S])
pub fn v_and_z_mut(&mut self, j: usize) -> (&[S], &mut [S])
pub fn tmp1_and_z_mut(&mut self, j: usize) -> (&[S], &mut [S])
pub fn tmp2_and_z_mut(&mut self, j: usize) -> (&[S], &mut [S])
pub fn z_and_tmp2_mut(&mut self, j: usize) -> (&[S], &mut [S])
pub fn copy_tmp2_into_vcol(&mut self, j: usize)
pub fn copy_tmp1_into_vcol(&mut self, j: usize)
pub fn copy_vcol_into_zcol(&mut self, j: usize)
pub fn copy_vcol_into_tmp1(&mut self, j: usize)
pub fn apply_prev_givens_to_col(&mut self, j: usize, upto: usize)
pub fn apply_final_givens_and_update_g(&mut self, j: usize)
pub fn finish_pipelined_arnoldi( &mut self, k: usize, n: usize, red: &dyn ReductionEngine, policy: ReorthPolicy, tol: R, glob: Vec<R>, ) -> Result<usize, KError>
Available on crate feature
complex only.pub fn finalize_pipelined_arnoldi( &mut self, pipe: PipeReduct, k: usize, n: usize, red: &dyn ReductionEngine, policy: ReorthPolicy, tol: R, ) -> Result<usize, KError>
Available on crate feature
complex only.pub fn launch_pipelined_arnoldi_reduction( &mut self, k: usize, n: usize, red: &dyn ReductionEngine, ) -> Result<PipeReduct, KError>
Available on crate feature
complex only.pub fn pipelined_arnoldi_step( &mut self, k: usize, n: usize, red: &dyn ReductionEngine, policy: ReorthPolicy, tol: R, ) -> Result<PipeReduct, KError>
Available on crate feature
complex only.pub fn pipelined_payload_len_for_k(k: usize) -> usize
Available on crate feature
complex only.Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Workspace
impl !UnwindSafe for Workspace
impl Freeze for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> ShellContext for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.