Perform Singular Value Decomposition 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 matrix # Return Values A triplet of Arrays. The first Array is the output array containing U The second A
(input: &Array<T>)
| 69 | /// |
| 70 | /// The third Array is the output array containing V ^ H |
| 71 | pub fn svd<T>(input: &Array<T>) -> (Array<T>, Array<T::BaseType>, Array<T>) |
| 72 | where |
| 73 | T: HasAfEnum + FloatingPoint, |
| 74 | T::BaseType: HasAfEnum, |
| 75 | { |
| 76 | unsafe { |
| 77 | let mut u: af_array = std::ptr::null_mut(); |
| 78 | let mut s: af_array = std::ptr::null_mut(); |
| 79 | let mut vt: af_array = std::ptr::null_mut(); |
| 80 | let err_val = af_svd( |
| 81 | &mut u as *mut af_array, |
| 82 | &mut s as *mut af_array, |
| 83 | &mut vt as *mut af_array, |
| 84 | input.get(), |
| 85 | ); |
| 86 | HANDLE_ERROR(AfError::from(err_val)); |
| 87 | (u.into(), s.into(), vt.into()) |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | /// Perform Singular Value Decomposition inplace |
| 92 | /// |
nothing calls this directly
no test coverage detected