pub fn z_set<T>(
za: &mut [T],
z: T,
i: usize,
j: usize,
xlen: usize,
ylen: usize,
) -> Result<(), DomainError>where
T: Num,
Expand description
Sets the value z
of grid point (i
, j
) of the array za
to z
.
§Important
The
za
array is indexed in column-major style (Fortran style), so it must be defined accordingly.
§Example
let xa = [0.0, 1.0];
let ya = [0.0, 2.0];
let mut za = [
0.0, 1.0, // <- We set this one
2.0, 3.0,
];
z_set(&mut za, 10.0, 0, 1, xa.len(), ya.len())?;
assert_eq!(za[2], 10.0);
}