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

Function range

src/core/data.rs:308–322  ·  view source on GitHub ↗

Create a Range of values Creates an array with [0, n] values along the `seq_dim` which is tiled across other dimensions. # Parameters - `dims` is the size of Array - `seq_dim` is the dimension along which range values are populated, all values along other dimensions are just repeated # Return Values Array

(dims: Dim4, seq_dim: i32)

Source from the content-addressed store, hash-verified

306/// # Return Values
307/// Array
308pub fn range<T: HasAfEnum>(dims: Dim4, seq_dim: i32) -> Array<T> {
309 let aftype = T::get_af_dtype();
310 unsafe {
311 let mut temp: af_array = std::ptr::null_mut();
312 let err_val = af_range(
313 &mut temp as *mut af_array,
314 dims.ndims() as c_uint,
315 dims.get().as_ptr() as *const dim_t,
316 seq_dim as c_int,
317 aftype as c_uint,
318 );
319 HANDLE_ERROR(AfError::from(err_val));
320 temp.into()
321 }
322}
323
324/// Create a range of values
325///

Callers

nothing calls this directly

Calls 4

HANDLE_ERRORFunction · 0.85
ndimsMethod · 0.80
intoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected