Skip to main content

ComplexSparseMatrix

Struct ComplexSparseMatrix 

Source
pub struct ComplexSparseMatrix<T: ComplexScalar> { /* private fields */ }
Expand description

RAII wrapper for a complex aoclsparse_matrix in CSR format.

Implementations§

Source§

impl<T: ComplexScalar> ComplexSparseMatrix<T>

Source

pub fn from_csr( base: IndexBase, m: usize, n: usize, row_ptr: &[aoclsparse_int], col_ind: &[aoclsparse_int], val: &[T], ) -> Result<Self>

Build from CSR arrays. Values are copied into the wrapper.

Source

pub unsafe fn from_library_owned(raw: aoclsparse_matrix) -> Result<Self>

Adopt a library-allocated matrix handle (e.g. the result of spmmd).

§Safety

raw must be a valid aoclsparse_matrix whose precision matches T and whose internal storage is library-owned.

Source

pub fn dims(&self) -> (usize, usize)

(m, n) dimensions.

Source

pub fn nnz(&self) -> usize

Number of explicitly stored non-zeros.

Source

pub fn base(&self) -> IndexBase

Index base for row-pointer / column-index arrays.

Source

pub fn as_raw(&self) -> aoclsparse_matrix

Borrow the raw aoclsparse_matrix handle. Do not call aoclsparse_destroy on it; the wrapper does.

Source

pub fn export_csr( &self, ) -> Result<(IndexBase, Vec<aoclsparse_int>, Vec<aoclsparse_int>, Vec<T>)>

Read out the CSR contents as freshly allocated Vecs.

Trait Implementations§

Source§

impl<T: ComplexScalar> Debug for ComplexSparseMatrix<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: ComplexScalar> Drop for ComplexSparseMatrix<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.