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

Function qr

src/lapack/mod.rs:208–225  ·  view source on GitHub ↗

Perform QR decomposition # Parameters - `input` is the input matrix # Return Values A triplet of Arrays. The first Array is the orthogonal matrix from QR decomposition The second Array is the upper triangular matrix from QR decomposition The third Array will contain additional information needed for solving a least squares problem using q and r

(input: &Array<T>)

Source from the content-addressed store, hash-verified

206/// The third Array will contain additional information needed for solving a least squares problem
207/// using q and r
208pub fn qr<T>(input: &Array<T>) -> (Array<T>, Array<T>, Array<T>)
209where
210 T: HasAfEnum + FloatingPoint,
211{
212 unsafe {
213 let mut q: af_array = std::ptr::null_mut();
214 let mut r: af_array = std::ptr::null_mut();
215 let mut tau: af_array = std::ptr::null_mut();
216 let err_val = af_qr(
217 &mut q as *mut af_array,
218 &mut r as *mut af_array,
219 &mut tau as *mut af_array,
220 input.get(),
221 );
222 HANDLE_ERROR(AfError::from(err_val));
223 (q.into(), r.into(), tau.into())
224 }
225}
226
227/// Perform inplace QR decomposition
228///

Callers

nothing calls this directly

Calls 3

HANDLE_ERRORFunction · 0.85
intoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected