VEC_$IREC2C Domain/OS VEC_$IREC2C
NAME
vec_$irec2c - calculate second-order linear recurrence of 32-bit integer
vector with constant coefficients
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
void vec_$irec2c(
long int *start_vec,
long int &count,
long int &mult_constant,
long int &mult_constant_2,
long int *result_vec)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
procedure vec_$irec2c(
in start_vec: univ vec_$integer32_vector;
in count: integer32;
in mult_constant: integer32;
in mult_constant_2: integer32;
var result_vec: univ vec_$integer32_vector);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
integer*4 start_vec(nvec), result_vec(nvec), mult_constant, mult_constant_2
integer*4 count
call vec_$irec2c(start_vec, count, mult_constant, mult_constant_2, result_vec)
DESCRIPTION
Vec_$irec2c calculates a second-order linear recurrence with constant
coefficients based on start_vec. It differs from vec_$rec2c in that the
vectors being handled contain 32-bit integers.
This routine reads the first two entries in the array result_vec; it then
writes count entries into result_vec based on the following formula:
For each integer I such that 1 <= I <= count,
result_vec(I+2) = start_vec(I) + (mult_constant x result_vec(I+1))
+ (mult_constant_2 x result_vec(I))
Notice that result_vec is used both for input and output, and that it
must be large enough to hold count + 2 entries.
start_vec
An input vector.
mult_constant
A scalar multiplier.
mult_constant_2
A scalar multiplier.
count
The number of elements to be operated on.
result_vec
The vector containing two input values and the result of the
recurrence calculation.
NOTES
When vec_$irec2c is used to operate on matrixes in C and Pascal,
start_vec and result_vec are row vectors; in FORTRAN, they are column
vectors.
As in all the vec_$ calls, the result array must not overlap any of the
input arrays; the result array may be identical to an input, but must not
contain any smaller subset of an input. Because of pipelining, using
overlapping input and output arrays may cause incorrect results.
SEE ALSO
vec_$rec2, vec_$rec2c, vec_$rec2c_i, vec_$drec2c, vec_$drec2c_i,
vec_$irec2c_i, vec_$irec2c16, vec_$irec2c16_i.