vec_neg

Purpose

Returns a vector containing the negated value of the corresponding elements in the given vector.

Syntax

d=vec_neg(a)

Result and argument types

The following table describes the types of the returned value and the function arguments.

d a
vector4double vector4double

Result value

This function multiplies the value of each element in the given vector by -1.0 and then assigns the result to the corresponding elements in the result vector.

Formula

d[0] = -a[0]
d[1] = -a[1]
d[2] = -a[2]
d[3] = -a[3]

Example

a =  ( 10.0, -20.0,  30.0, -40.0)
d: (-10.0,  20.0, -30.0,  40.0)