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

Function lu

src/lapack/mod.rs:150–167  ·  view source on GitHub ↗

Perform LU decomposition # Parameters - `input` is the input matrix # Return Values A triplet of Arrays. The first Array will contain the lower triangular matrix of the LU decomposition. The second Array will contain the lower triangular matrix of the LU decomposition. The third Array will contain the permutation indices to map the input to the decomposition.

(input: &Array<T>)

Source from the content-addressed store, hash-verified

148///
149/// The third Array will contain the permutation indices to map the input to the decomposition.
150pub fn lu<T>(input: &Array<T>) -> (Array<T>, Array<T>, Array<i32>)
151where
152 T: HasAfEnum + FloatingPoint,
153{
154 unsafe {
155 let mut lower: af_array = std::ptr::null_mut();
156 let mut upper: af_array = std::ptr::null_mut();
157 let mut pivot: af_array = std::ptr::null_mut();
158 let err_val = af_lu(
159 &mut lower as *mut af_array,
160 &mut upper as *mut af_array,
161 &mut pivot as *mut af_array,
162 input.get(),
163 );
164 HANDLE_ERROR(AfError::from(err_val));
165 (lower.into(), upper.into(), pivot.into())
166 }
167}
168
169/// Perform inplace LU decomposition
170///

Callers

nothing calls this directly

Calls 3

HANDLE_ERRORFunction · 0.85
intoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected