MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / svd_inplace

Function svd_inplace

src/lapack/mod.rs:115–133  ·  view source on GitHub ↗

Perform Singular Value Decomposition inplace This function factorizes a matrix A into two unitary matrices U and Vt, and a diagonal matrix S such that A = U∗S∗Vt If A has M rows and N columns, U is of the size M x M , V is of size N x N, and S is of size M x N # Parameters - `in` is the input/output matrix. This will contain random data after the function call is complete. # Return Values A

(input: &mut Array<T>)

Source from the content-addressed store, hash-verified

113///
114/// The third Array is the output array containing V ^ H
115pub fn svd_inplace<T>(input: &mut Array<T>) -> (Array<T>, Array<T::BaseType>, Array<T>)
116where
117 T: HasAfEnum + FloatingPoint,
118 T::BaseType: HasAfEnum,
119{
120 unsafe {
121 let mut u: af_array = std::ptr::null_mut();
122 let mut s: af_array = std::ptr::null_mut();
123 let mut vt: af_array = std::ptr::null_mut();
124 let err_val = af_svd_inplace(
125 &mut u as *mut af_array,
126 &mut s as *mut af_array,
127 &mut vt as *mut af_array,
128 input.get(),
129 );
130 HANDLE_ERROR(AfError::from(err_val));
131 (u.into(), s.into(), vt.into())
132 }
133}
134
135/// Perform LU decomposition
136///

Callers

nothing calls this directly

Calls 3

HANDLE_ERRORFunction · 0.85
intoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected