## File: Vector-operations.html

package info (click to toggle)
gsl-ref-html 2.3-1
• area: non-free
• in suites: buster, sid
• size: 6,876 kB
• ctags: 4,574
• sloc: makefile: 35
 file content (123 lines) | stat: -rw-r--r-- 6,276 bytes parent folder | download
 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 GNU Scientific Library – Reference Manual: Vector operations

8.3.8 Vector operations

Function: int gsl_vector_add (gsl_vector * a, const gsl_vector * b)

This function adds the elements of vector b to the elements of vector a. The result a_i \leftarrow a_i + b_i is stored in a and b remains unchanged. The two vectors must have the same length.

Function: int gsl_vector_sub (gsl_vector * a, const gsl_vector * b)

This function subtracts the elements of vector b from the elements of vector a. The result a_i \leftarrow a_i - b_i is stored in a and b remains unchanged. The two vectors must have the same length.

Function: int gsl_vector_mul (gsl_vector * a, const gsl_vector * b)

This function multiplies the elements of vector a by the elements of vector b. The result a_i \leftarrow a_i * b_i is stored in a and b remains unchanged. The two vectors must have the same length.

Function: int gsl_vector_div (gsl_vector * a, const gsl_vector * b)

This function divides the elements of vector a by the elements of vector b. The result a_i \leftarrow a_i / b_i is stored in a and b remains unchanged. The two vectors must have the same length.

Function: int gsl_vector_scale (gsl_vector * a, const double x)

This function multiplies the elements of vector a by the constant factor x. The result a_i \leftarrow x a_i is stored in a.

Function: int gsl_vector_add_constant (gsl_vector * a, const double x)

This function adds the constant value x to the elements of the vector a. The result a_i \leftarrow a_i + x is stored in a.