pub struct Matrix<N: CddNumber = DefaultNumber> { /* private fields */ }Implementations§
Source§impl<N: CddNumber> Matrix<N>
impl<N: CddNumber> Matrix<N>
pub fn new( rows: usize, cols: usize, repr: Representation, num_type: NumberType, ) -> CddResult<Self>
pub fn rows(&self) -> usize
pub fn cols(&self) -> usize
pub fn representation(&self) -> Representation
pub fn number_type(&self) -> NumberType
pub fn as_raw(&self) -> *mut c_void
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Self
pub unsafe fn from_raw(ptr: *mut c_void) -> Self
§Safety
ptrmust be a non-nulldd_MatrixPtrcompatible with the backendN.- The pointer must be valid for the lifetime of this wrapper and must be owned by this wrapper (it will be freed on drop).
pub fn clone_cdd(&self) -> CddResult<Self>
pub fn set(&mut self, row: usize, col: usize, value: &N)
pub fn get(&self, row: usize, col: usize) -> N
pub fn set_real(&mut self, row: usize, col: usize, value: f64)
pub fn get_real(&self, row: usize, col: usize) -> f64
pub fn set_generator_type(&mut self, row: usize, is_vertex: bool)
pub fn set_objective_real(&mut self, coeffs: &[f64])
pub fn from_vertices<const D: usize>(vertices: &[[N; D]]) -> CddResult<Self>
Sourcepub fn from_vertex_rows(vertices: &[Vec<N>]) -> CddResult<Self>
pub fn from_vertex_rows(vertices: &[Vec<N>]) -> CddResult<Self>
Build a generator matrix from a dynamic list of vertices.
The ambient dimension is determined from the first vertex. All vertices must have the same length.
pub fn append_rows_in_place(&mut self, rows: &Matrix<N>) -> CddResult<()>
pub fn append_rows(&self, rows: &Matrix<N>) -> CddResult<Self>
pub fn append_row(&self, coords: &[N], is_vertex: bool) -> CddResult<Self>
pub fn remove_row(&mut self, row: usize) -> CddResult<()>
pub fn is_row_redundant(&self, row: usize) -> CddResult<bool>
pub fn redundant_rows(&self) -> CddResult<Vec<usize>>
pub fn canonicalize(&self) -> CddResult<CanonicalForm<N>>
Trait Implementations§
Source§impl From<Matrix<CddFloat>> for Matrix<CddRational>
Available on crate features gmp and gmprational only.
impl From<Matrix<CddFloat>> for Matrix<CddRational>
Available on crate features
gmp and gmprational only.Source§impl From<Matrix<CddRational>> for Matrix<f64>
Available on crate features f64 and gmprational only.
impl From<Matrix<CddRational>> for Matrix<f64>
Available on crate features
f64 and gmprational only.Source§fn from(value: Matrix<CddRational>) -> Self
fn from(value: Matrix<CddRational>) -> Self
Converts to this type from the input type.
Source§impl From<Matrix<CddRational>> for Matrix<CddFloat>
Available on crate features gmp and gmprational only.
impl From<Matrix<CddRational>> for Matrix<CddFloat>
Available on crate features
gmp and gmprational only.Source§fn from(value: Matrix<CddRational>) -> Self
fn from(value: Matrix<CddRational>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<N> Freeze for Matrix<N>
impl<N> RefUnwindSafe for Matrix<N>where
N: RefUnwindSafe,
impl<N = f64> !Send for Matrix<N>
impl<N = f64> !Sync for Matrix<N>
impl<N> Unpin for Matrix<N>where
N: Unpin,
impl<N> UnwindSafe for Matrix<N>where
N: 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