PRO generate_geometric_sequence, a1, r, n, seq, status, INTEGER_SEQUENCE = integer_sequence, NO_PAR_CHECK = no_par_check
; Description: This module generates a geometric sequence of "n" elements with first element "a1"
; and a ratio "r" between consecutive elements. The sequence is returned as the
; one-dimensional vector "seq". Mathematically, the geometric sequence is defined as:
;
; seq[i] = a1 * r^(i-1) for i = 1,2,...,n
;
; Input Parameters:
;
; a1 - INTEGER/LONG/FLOAT/DOUBLE - The first element of the geometric sequence.
; d - INTEGER/LONG/FLOAT/DOUBLE - The ratio between consecutive elements of the sequence.
; n - INTEGER/LONG - The number of elements in the geometric sequence. This parameter must be
; positive.
;
; Output Parameters:
;
; seq - DOUBLE VECTOR - A one-dimensional vector of length "n" elements that contains the
; geometric sequence that has been generated.
; status - INTEGER - If the module successfully generated the geometric 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 "r" into LONG type integers, and it will use them to generate
; the output geometric 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:
;
; 24/10/2010 - Module created (dmb).
;Set the default output parameter values
;Perform parameter checking if not instructed otherwise
;Check that "a1", "r" and "n" are numbers of the correct type, and check that they have sensible
;values
;Generate the geometric sequence
;Set "status" to "1"