Contents

la_sum(_:_:)

Declaration

func la_sum(_ obj_left: la_object_t, _ obj_right: la_object_t) -> la_object_t

Discussion

Compute the element-wise sum of two vectors or matrices.

If either source operand is not a vector or matrix or splat, or if both operands are splats, the result has status LA_INVALID_PARAMETER_ERROR.

The two operands must have the same dimensions. If they do not, the result will have status LA_DIMENSION_MISMATCH_ERROR. For simplicity, a vector of length n, a 1xn matrix, and an nx1 matrix are all treated as having the same dimensions. If 1xn and nx1 or nx1 and 1xn vectors are passed, an nx1 vector will be created, otherwise orientation matches input.

The result has the same dimensions as the operands, and each element in the result is the sum of the corresponding elements in the source operands.

See Also

Functions