COPASI API  4.16.103
Functions
dewset.cpp File Reference
#include <cmath>
#include "copasi.h"
#include "dewset.h"
Include dependency graph for dewset.cpp:

Go to the source code of this file.

Functions

C_INT dewset_ (C_INT *n, C_INT *itol, double *rtol, double *atol, double *ycur, double *ewt)
 

Function Documentation

C_INT dewset_ ( C_INT n,
C_INT itol,
double *  rtol,
double *  atol,
double *  ycur,
double *  ewt 
)

Definition at line 30 of file dewset.cpp.

References C_INT.

Referenced by CLSODA::operator()(), and CLSODAR::operator()().

32 {
33  /* System generated locals */
34  C_INT i__1;
35  double d__1;
36 
37  /* Local variables */
38  C_INT i__;
39 
40  /* ***BEGIN PROLOGUE DEWSET */
41  /* ***SUBSIDIARY */
42  /* ***PURPOSE Set error weight vector. */
43  /* ***TYPE DOUBLE PRECISION (SEWSET-S, DEWSET-D) */
44  /* ***AUTHOR Hindmarsh, Alan C., (LLNL) */
45  /* ***DESCRIPTION */
46 
47  /* This subroutine sets the error weight vector EWT according to */
48  /* EWT(i) = RTOL(i)*ABS(YCUR(i)) + ATOL(i), i = 1,...,N, */
49  /* with the subscript on RTOL and/or ATOL possibly replaced by 1 above, */
50  /* depending on the value of ITOL. */
51 
52  /* ***SEE ALSO DLSODE */
53  /* ***ROUTINES CALLED (NONE) */
54  /* ***REVISION HISTORY (YYMMDD) */
55  /* 791129 DATE WRITTEN */
56  /* 890501 Modified prologue to SLATEC/LDOC format. (FNF) */
57  /* 890503 Minor cosmetic changes. (FNF) */
58  /* 930809 Renamed to allow single/double precision versions. (ACH) */
59  /* ***END PROLOGUE DEWSET */
60  /* **End */
61 
62  /* ***FIRST EXECUTABLE STATEMENT DEWSET */
63  /* Parameter adjustments */
64  --ewt;
65  --ycur;
66  --rtol;
67  --atol;
68 
69  /* Function Body */
70  switch (*itol)
71  {
72  case 1: goto L10;
73  case 2: goto L20;
74  case 3: goto L30;
75  case 4: goto L40;
76  }
77 
78 L10:
79  i__1 = *n;
80 
81  for (i__ = 1; i__ <= i__1; ++i__)
82  {
83  /* L15: */
84  ewt[i__] = rtol[1] * (d__1 = ycur[i__], fabs(d__1)) + atol[1];
85  }
86 
87  return 0;
88 L20:
89  i__1 = *n;
90 
91  for (i__ = 1; i__ <= i__1; ++i__)
92  {
93  /* L25: */
94  ewt[i__] = rtol[1] * (d__1 = ycur[i__], fabs(d__1)) + atol[i__];
95  }
96 
97  return 0;
98 L30:
99  i__1 = *n;
100 
101  for (i__ = 1; i__ <= i__1; ++i__)
102  {
103  /* L35: */
104  ewt[i__] = rtol[i__] * (d__1 = ycur[i__], fabs(d__1)) + atol[1];
105  }
106 
107  return 0;
108 L40:
109  i__1 = *n;
110 
111  for (i__ = 1; i__ <= i__1; ++i__)
112  {
113  /* L45: */
114  ewt[i__] = rtol[i__] * (d__1 = ycur[i__], fabs(d__1)) + atol[i__];
115  }
116 
117  return 0;
118  /* ----------------------- END OF SUBROUTINE DEWSET ---------------------- */
119 } /* dewset_ */
#define C_INT
Definition: copasi.h:115