Module scarecrow::utils [] [src]

Miscellaneous utility functions.

Functions

add

Element-wise addition of two vectors. They must be of equal length.

add_mut

Element-wise addition of two vectors in-place. They must be of equal length.

add_scalar

Addition of vector and scalar.

dot

Perform an element-wise product and sum of two vectors. The two vectors must be of equal length.

normal_vector

Returns a vector with the given size where each element is a random gaussian number, with mean 0 and standard deviation 1.0.

product

Element-wise product of two vectors. They must be of equal length.

product_mut

Element-wise product of two vectors. They must be of equal length.

sum

Sum up a vector.