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

Function row

src/core/index.rs:295–306  ·  view source on GitHub ↗

Extract `row_num` row from `input` Array # Examples ```rust use arrayfire::{Dim4, randu, row, print}; let dims = Dim4::new(&[5, 5, 1, 1]); let a = randu:: (dims); println!("Grab last row of the random matrix"); print(&a); print(&row(&a, 4)); ```

(input: &Array<T>, row_num: i64)

Source from the content-addressed store, hash-verified

293/// print(&row(&a, 4));
294/// ```
295pub fn row<T>(input: &Array<T>, row_num: i64) -> Array<T>
296where
297 T: HasAfEnum,
298{
299 index(
300 input,
301 &[
302 Seq::new(row_num as f64, row_num as f64, 1.0),
303 Seq::default(),
304 ],
305 )
306}
307
308/// Set `row_num`^th row in `inout` Array to a new Array `new_row`
309pub fn set_row<T>(inout: &mut Array<T>, new_row: &Array<T>, row_num: i64)

Callers 3

setrowFunction · 0.85
get_rowFunction · 0.85
mainFunction · 0.85

Calls 1

indexFunction · 0.85

Tested by 2

setrowFunction · 0.68
get_rowFunction · 0.68