Integer vector operations

SYNOPSIS

#include "matrix.h"
IVEC     *iv_add(IVEC *iv1,IVEC *iv2, IVEC *out)
IVEC     *iv_sub(IVEC *iv1, IVEC *iv2, IVEC *out)

DESCRIPTION

The two arithmetic operations implemented for integer vectors are addition \hfill\break (iv_add()) and subtraction (iv_sub()). In each of these routines, out is resized to be of the correct size if it does not have the same dimension as iv1 and iv2. This dearth of operations is because it is envisaged that the main purpose for using integer vectors is to hold indexes or to represent combinatorial objects.

EXAMPLE

IVEC *x, *y, *z;
  ......
x = ...;
y = ...;
/* z = x+y, allocate z */
z = iv_add(x,y,IVNULL);
/* z = x-y, z already allocated */
iv_sub(x,y,z);

SEE ALSO: Vector operations v_...() and iv_resize().

SOURCE FILE: ivecop.c