full

Function full 

Source
pub fn full<T>(rows: usize, cols: usize, value: T) -> Array<T, Ix2>
where T: Clone,
Expand description

Create a matrix filled with a given value

§Arguments

  • rows - Number of rows
  • cols - Number of columns
  • value - Value to fill the matrix with

§Returns

A matrix filled with the specified value

§Examples

use scirs2_core::ndarray_ext::matrix::full;

let filled = full(2, 3, 7);
assert_eq!(filled.shape(), &[2, 3]);
assert_eq!(filled[[0, 0]], 7);
assert_eq!(filled[[1, 2]], 7);