GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
initds.f
Go to the documentation of this file.
1*DECK INITDS
2 FUNCTION initds (OS, NOS, ETA)
3C***BEGIN PROLOGUE INITDS
4C***PURPOSE Determine the number of terms needed in an orthogonal
5C polynomial series so that it meets a specified accuracy.
6C***LIBRARY SLATEC (FNLIB)
7C***CATEGORY C3A2
8C***TYPE DOUBLE PRECISION (INITS-S, INITDS-D)
9C***KEYWORDS CHEBYSHEV, FNLIB, INITIALIZE, ORTHOGONAL POLYNOMIAL,
10C ORTHOGONAL SERIES, SPECIAL FUNCTIONS
11C***AUTHOR Fullerton, W., (LANL)
12C***DESCRIPTION
13C
14C Initialize the orthogonal series, represented by the array OS, so
15C that INITDS is the number of terms needed to insure the error is no
16C larger than ETA. Ordinarily, ETA will be chosen to be one-tenth
17C machine precision.
18C
19C Input Arguments --
20C OS double precision array of NOS coefficients in an orthogonal
21C series.
22C NOS number of coefficients in OS.
23C ETA single precision scalar containing requested accuracy of
24C series.
25C
26C***REFERENCES (NONE)
27C***ROUTINES CALLED XERMSG
28C***REVISION HISTORY (YYMMDD)
29C 770601 DATE WRITTEN
30C 890531 Changed all specific intrinsics to generic. (WRB)
31C 890831 Modified array declarations. (WRB)
32C 891115 Modified error message. (WRB)
33C 891115 REVISION DATE from Version 3.2
34C 891214 Prologue converted to Version 4.0 format. (BAB)
35C 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
36C***END PROLOGUE INITDS
37 DOUBLE PRECISION os(*)
38C***FIRST EXECUTABLE STATEMENT INITDS
39 IF (nos .LT. 1) CALL xermsg ('SLATEC', 'INITDS',
40 + 'Number of coefficients is less than 1', 2, 1)
41C
42 err = 0.
43 DO 10 ii = 1,nos
44 i = nos + 1 - ii
45 err = err + abs(real(os(i)))
46 IF (err.GT.eta) GO TO 20
47 10 CONTINUE
48C
49 20 IF (i .EQ. nos) CALL xermsg ('SLATEC', 'INITDS',
50 + 'Chebyshev series too short for specified accuracy', 1, 1)
51 initds = i
52C
53 RETURN
54 END
ColumnVector real(const ComplexColumnVector &a)
function initds(os, nos, eta)
Definition initds.f:3
subroutine xermsg(librar, subrou, messg, nerr, level)
Definition xermsg.f:3