pub struct IndexSchurData { /* private fields */ }Expand description
Specialization for B matrices whose non-zero entries are ±1
(the parametric / reduced-Hessian common case). Storage is two
parallel arrays mirroring upstream’s idx_ and val_
(SensIndexSchurData.hpp:127-128).
Implementations§
Source§impl IndexSchurData
impl IndexSchurData
Sourcepub fn new() -> Self
pub fn new() -> Self
Empty / uninitialized instance. Must be populated via one of
the set_from_* methods before being read.
Sourcepub fn from_parts(
idx: Vec<Index>,
val: Vec<Index>,
) -> Result<Self, SchurDataError>
pub fn from_parts( idx: Vec<Index>, val: Vec<Index>, ) -> Result<Self, SchurDataError>
Construct directly from pre-built (idx, val) arrays. val
must contain only ±1 entries. Mirrors upstream’s two-arg
constructor
(SensIndexSchurData.cpp:24-36).
Sourcepub fn col_indices(&self) -> &[Index] ⓘ
pub fn col_indices(&self) -> &[Index] ⓘ
Column indices the rows refer to (one index per row). Upstream
GetColIndices()
(SensIndexSchurData.hpp:114).
Trait Implementations§
Source§impl Clone for IndexSchurData
impl Clone for IndexSchurData
Source§fn clone(&self) -> IndexSchurData
fn clone(&self) -> IndexSchurData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IndexSchurData
impl Debug for IndexSchurData
Source§impl Default for IndexSchurData
impl Default for IndexSchurData
Source§fn default() -> IndexSchurData
fn default() -> IndexSchurData
Returns the “default value” for a type. Read more
Source§impl PartialEq for IndexSchurData
impl PartialEq for IndexSchurData
Source§fn eq(&self, other: &IndexSchurData) -> bool
fn eq(&self, other: &IndexSchurData) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl SchurData for IndexSchurData
impl SchurData for IndexSchurData
Source§fn nrows(&self) -> Index
fn nrows(&self) -> Index
Number of rows the schur matrix has, i.e. the row count of
B.
Upstream GetNRowsAdded()
(SensSchurData.hpp:77-80).Source§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
true if one of the set_* methods has been called and the
rest of the surface is safe to call. Upstream Is_Initialized()
(SensSchurData.hpp:82-85).Source§fn set_from_flags(
&mut self,
flags: &[Index],
v: Number,
) -> Result<(), SchurDataError>
fn set_from_flags( &mut self, flags: &[Index], v: Number, ) -> Result<(), SchurDataError>
Set rows from a 0/1 flag array of length
dim. For each i
with flags[i] == 1, add a row whose only non-zero column is
i with sign sign(v). The magnitude of v is collapsed to
±1 — this trait only ever stores signs, mirroring upstream’s
SetData_Flag(dim, flags, v)
(SensSchurData.hpp:45-49,
SensIndexSchurData.cpp:51-78). Read moreSource§fn set_from_list(
&mut self,
cols: &[Index],
v: Number,
) -> Result<(), SchurDataError>
fn set_from_list( &mut self, cols: &[Index], v: Number, ) -> Result<(), SchurDataError>
Set rows from a list of column indices. Each
cols[k] becomes
row k of B, with the single non-zero entry at column
cols[k] carrying sign sign(v). Upstream SetData_List
(SensSchurData.hpp:64-67,
SensIndexSchurData.cpp:149-167). Read moreSource§fn multiplying_row(
&self,
i: Index,
) -> Result<(Vec<Index>, Vec<Number>), SchurDataError>
fn multiplying_row( &self, i: Index, ) -> Result<(Vec<Index>, Vec<Number>), SchurDataError>
Row-
i access: return the parallel arrays (indices, factors)
such that row i of B has non-zero column entries
factors[j] at columns indices[j]. For IndexSchurData
indices has length 1 and factors[0] == ±1.0. Upstream
GetMultiplyingVectors
(SensSchurData.hpp:93-104,
SensIndexSchurData.cpp:199-212).Source§fn multiply(&self, v: &[Number], u: &mut [Number]) -> Result<(), SchurDataError>
fn multiply(&self, v: &[Number], u: &mut [Number]) -> Result<(), SchurDataError>
Apply
u = B v for a v of length n_full and pre-sized
u buffer (length must equal self.nrows()). Upstream
Multiply(IteratesVector, Vector)
(SensSchurData.hpp:106-110,
SensIndexSchurData.cpp:214-251). Read moreSource§fn trans_multiply(
&self,
u: &[Number],
v: &mut [Number],
) -> Result<(), SchurDataError>
fn trans_multiply( &self, u: &[Number], v: &mut [Number], ) -> Result<(), SchurDataError>
Apply
v = Bᵀ u for a u of length self.nrows() and a
pre-sized v buffer (length n_full). Upstream
TransMultiply
(SensSchurData.hpp:112-116,
SensIndexSchurData.cpp:253-307).impl Eq for IndexSchurData
impl StructuralPartialEq for IndexSchurData
Auto Trait Implementations§
impl Freeze for IndexSchurData
impl RefUnwindSafe for IndexSchurData
impl Send for IndexSchurData
impl Sync for IndexSchurData
impl Unpin for IndexSchurData
impl UnsafeUnpin for IndexSchurData
impl UnwindSafe for IndexSchurData
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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