PRO generate_arithmetic_sequence, a1, d, n, seq, status, INTEGER_SEQUENCE = integer_sequence, NO_PAR_CHECK = no_par_check
; Description: This module generates an arithmetic sequence of "n" elements with first element "a1"
; and a difference "d" between consecutive elements. The sequence is returned as the
; one-dimensional vector "seq". Mathematically, the arithmetic sequence is defined as:
;
; seq[i] = a1 + ((i-1)*d) for i = 1,2,...,n
;
; Input Parameters:
;
; a1 - INTEGER/LONG/FLOAT/DOUBLE - The first element of the arithmetic sequence.
; d - INTEGER/LONG/FLOAT/DOUBLE - The difference between consecutive elements of the sequence.
; n - INTEGER/LONG - The number of elements in the arithmetic sequence. This parameter must be
; positive.
;
; Output Parameters:
;
; seq - DOUBLE VECTOR - A one-dimensional vector of length "n" elements that contains the
; arithmetic sequence that has been generated.
; status - INTEGER - If the module successfully generated the arithmetic sequence, then "status"
; is returned with a value of "1", otherwise it is returned with a value of
; "0".
;
; Keywords:
;
; If the keyword INTEGER_SEQUENCE is set (as "/INTEGER_SEQUENCE"), then the module will convert
; the input parameters "a1" and "d" into LONG type integers, and it will use them to generate
; the output arithmetic sequence "seq" as a sequence of numbers of LONG type.
;
; If the keyword NO_PAR_CHECK is set (as "/NO_PAR_CHECK"), then the module will not perform
; parameter checking on the input parameters, reducing module overheads.
;
; Author: Dan Bramich (dan.bramich@hotmail.co.uk)
;
; History:
;
; 23/10/2010 - Module created (dmb).
;Set the default output parameter values
;Perform parameter checking if not instructed otherwise
;Check that "a1", "d" and "n" are numbers of the correct type, and check that they have sensible
;values
;Generate the arithmetic sequence
;Set "status" to "1"