pub struct GesvdjInfo { /* private fields */ }Implementations§
Source§impl GesvdjInfo
impl GesvdjInfo
Sourcepub fn create() -> Result<Self>
pub fn create() -> Result<Self>
Creates gesvdj and gesvdjBatched parameter storage with default values.
§Errors
Returns an error if cuSOLVER cannot allocate the parameter storage or if it does not return a valid handle.
Sourcepub fn set_tolerance(&mut self, tolerance: f64) -> Result<()>
pub fn set_tolerance(&mut self, tolerance: f64) -> Result<()>
Sourcepub fn set_max_sweeps(&mut self, max_sweeps: i32) -> Result<()>
pub fn set_max_sweeps(&mut self, max_sweeps: i32) -> Result<()>
Configures the maximum number of gesvdj sweeps.
The default value is 100.
§Errors
Returns an error if cuSOLVER rejects max_sweeps.
Sourcepub fn set_sort_eigenvalues(&mut self, sort_eigenvalues: bool) -> Result<()>
pub fn set_sort_eigenvalues(&mut self, sort_eigenvalues: bool) -> Result<()>
If sort_eigenvalues is false, the singular values are not sorted.
This setting only applies to gesvdjBatched.
gesvdj always sorts singular values in descending order.
By default, singular values are always sorted in descending order.
§Errors
Returns an error if cuSOLVER rejects the sort setting.
Sourcepub fn residual(&self, ctx: &Context) -> Result<f64>
pub fn residual(&self, ctx: &Context) -> Result<f64>
Returns the Frobenius norm of the internal residual reported by gesvdj.
Not the Frobenius norm of the exact residual.
This accessor does not support gesvdjBatched.
Calling this after gesvdjBatched returns crate::error::Status::NotSupported.
§Errors
Returns an error if the info handle was used with gesvdjBatched,
which does not report a residual.
Sourcepub fn executed_sweeps(&self, ctx: &Context) -> Result<i32>
pub fn executed_sweeps(&self, ctx: &Context) -> Result<i32>
Returns the number of executed gesvdj sweeps.
This accessor does not support gesvdjBatched.
Calling this after gesvdjBatched returns crate::error::Status::NotSupported.
§Errors
Returns an error if the info handle was used with gesvdjBatched,
which does not report a sweep count.
pub fn as_raw(&self) -> gesvdjInfo_t
Sourcepub unsafe fn from_raw(handle: gesvdjInfo_t) -> Result<Self>
pub unsafe fn from_raw(handle: gesvdjInfo_t) -> Result<Self>
Takes ownership of a raw cuSOLVER gesvdj info handle.
§Safety
handle must be a valid gesvdjInfo_t created by cuSOLVER. The
returned wrapper takes ownership and will destroy it with
cusolverDnDestroyGesvdjInfo; no other owner may destroy or keep using it.
Sourcepub fn into_raw(self) -> gesvdjInfo_t
pub fn into_raw(self) -> gesvdjInfo_t
Releases ownership and returns the raw cuSOLVER gesvdj info handle.
The caller becomes responsible for destroying the handle.