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

Function col

src/core/index.rs:354–365  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

352/// print(&col(&a, 4));
353/// ```
354pub fn col<T>(input: &Array<T>, col_num: i64) -> Array<T>
355where
356 T: HasAfEnum,
357{
358 index(
359 input,
360 &[
361 Seq::default(),
362 Seq::new(col_num as f64, col_num as f64, 1.0),
363 ],
364 )
365}
366
367/// Set `col_num`^th col in `inout` Array to a new Array `new_col`
368pub fn set_col<T>(inout: &mut Array<T>, new_col: &Array<T>, col_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