Function dot

Source
pub unsafe extern "C" fn dot(
    n: c_int,
    x: *const c_double,
    inc_x: c_int,
    y: *const c_double,
    inc_y: c_int,
) -> c_double
Expand description

Computes the dot product of two double-precision vectors X and Y.

§Precision

This function operates on f64 (double-precision) numbers.

§Parameters

  • n: The number of elements in the vectors X and Y.
  • x: A pointer to the first input vector of f64 numbers.
  • inc_x: The increment (stride) between elements in x. For example, if inc_x = 7, every 7th element is used.
  • y: A pointer to the second input vector of f64 numbers.
  • inc_y: The increment (stride) between elements in y. For example, if inc_y = 7, every 7th element is used.

§Returns

  • The dot product of x and y as a f64.

§Safety

This is an unsafe C function. The caller must ensure that the memory regions accessed by x and y (up to n * inc_x and n * inc_y) are valid and within bounds.