atraj.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. #ifndef atraj_h
  2. #define atraj_h
  3. #if defined (GCC) && defined(GODESS)
  4. /* gcc does not always seem to handle #include statement within 'extern "C"-block', so add another block here */
  5. extern "C" {
  6. #endif
  7. /*
  8. * Copyright (C) 1997-2010 Dynasim AB.
  9. * All rights reserved.
  10. *
  11. */
  12. /*
  13. Write object of class "Atrajectory" to file.
  14. Read object of class "Atrajectory" from file.
  15. The following possibilities exist:
  16. 1. The file contains the following matrices:
  17. Aclass : Information about class (class name,
  18. version number="1.1", description text).
  19. name (nName,*): String matrix of names.
  20. description(nName,*): String matrix of description text for each name.
  21. info (nName,5): Information matrix which defines how the
  22. trajectory is defined:
  23. info(i,1) = j: name i data is stored in matrix
  24. "data_j".
  25. info(i,2) = k: name i data is stored in column
  26. abs(k) of matrix data_j with
  27. sign(k) used as sign.
  28. info(i,3) = 0 : linear interpolation
  29. = 1..4: polygon spline which is
  30. differentiable upto order 1..4.
  31. info(i,4) =-1: not defined outside of time range.
  32. = 0: keep first/last point
  33. outside of time range.
  34. = 1: interpolate through first/last
  35. two points outside of time range.
  36. = 2: keep first point outside of
  37. minimum time and periodically
  38. repeating the signal outside
  39. of right time range
  40. (not yet implemented)
  41. info(i,5) = offset of signal (this columns is only
  42. available on file. After reading the
  43. file, the offset is added to the data
  44. matrices.
  45. info(1,1) = 0 means, that column info(1,2)
  46. is the abscissa data "name(1,*)"
  47. of ALL data matrices. This is usually "time".
  48. This special rule is necessary, since otherwise
  49. the abscissa name has to be repeated in "name"
  50. and the names in "name" would be no longer unique.
  51. data_1 (nt1,nc1): First data matrix.
  52. data_2 (nt2,nc2): Second data matrix.
  53. ...
  54. data_n (ntn,ncn): N-th data matrix.
  55. 2. The file contains the following 3 matrices:
  56. Aclass : Information about class (class name,
  57. version number="1.0", description text).
  58. names(nName,*) : String matrix of names
  59. data (nt,nName): Numeric data. Time is stored in the first column.
  60. 3. The file contains one numeric matrix. In this case a default
  61. signal name matrix is build automatically.
  62. The trajectory data may be retrieved in float or in double precision.
  63. It is always returned in "column-dense" format, i.e. all columns
  64. of a matrix are stored in consecutive order one after the other in a
  65. vector (= FORTRAN storage format). Every column of the matrix corresponds
  66. to one trajectory signal. The first column is the time vector.
  67. When writing an Atrajectory object to file, ONE of the data matrices
  68. can be stored without knowing the number of rows in advance
  69. (= the matrix is stored one row after the other).
  70. Functions:
  71. atrajRead : Read trajectory data from file
  72. (object of class Atrajectory or single matrix).
  73. atrajWrite : Write trajectory object to file.
  74. atrajWinit : Initialize row-wise writing of trajectory object to file.
  75. atrajWclose : Close row-wise writing of trajectory object.
  76. atrajWreal : Write one row of a real matrix to file.
  77. atrajWdouble: Write one row of a doublereal matrix to file.
  78. atrajNew : Allocate storage for a new trajectory object
  79. and initialize it (set all components to NULL).
  80. atrajInit : Initialize a trajectory object
  81. (set all components to NULL).
  82. atrajDel : Delete the contents of a trajectory object
  83. (and set all components to NULL).
  84. Example:
  85. Atrajectory *traj;
  86. char *file = "temp.mat";
  87. // Read trajectory "traj" from file
  88. if ( (traj = atrajRead(file, realPrec)) == NULL ) goto ERROR;
  89. printf("Read trajectory from file \"%s\n"
  90. "(\"%s\")\n", file, traj.title;
  91. ...
  92. atrajDel(traj);
  93. return;
  94. // Error handling (amatError is a global variable, defined in "amat.h")
  95. ERROR: fprintf(stderr,"Error in program XXX:\n%s",amatError);
  96. return 1;
  97. */
  98. #include "amat.h"
  99. /* Trajectory format of version 1.1
  100. Note, that the indices of arrays stored in "info" are with respect
  101. to the storage format on File (= Matlab, Fortran format) and NOT with
  102. respect to C-arrays (= matrix indices start with 1).
  103. */
  104. extern const int TRAJ_NINFO; /* Column number of traj.info matrix */
  105. extern const int TRAJ_IPO_MIN; /* Minimum interpolation number */
  106. extern const int TRAJ_IPO_MAX; /* Maximum interpolation number */
  107. extern const int TRAJ_EXPO_MIN; /* Minimum extrapolation number */
  108. extern const int TRAJ_EXPO_MAX; /* Maximum extrapolation number */
  109. typedef struct {
  110. AmatData time; /* Pointer to time vector of data matrix i */
  111. /* real/double time[ntime] */
  112. int ntime; /* Number of time points */
  113. AmatType prec; /* Precision of data (real/double) */
  114. int ibeg; /* C-index of begin of actual interval */
  115. int iend; /* C-index of end of actual interval */
  116. /* time[i] < time[i+1] for i=ibeg..iend-1 */
  117. int ilast; /* C-index of last interpolation interval */
  118. /* (at time[ilast..ilast+1]) */
  119. int ijump; /* = 0: last interval (no discontinuous */
  120. /* point anymore). */
  121. /* = 1: tjump is the next discontinuous */
  122. /* point. */
  123. doublereal tjump; /* Time instant of next discontinuous point */
  124. /* if ijump=1. */
  125. /* The following flags indicate whether */
  126. /* information about the time vector has */
  127. /* already been stored. */
  128. int tindex; /* C-index of actual time vector */
  129. /* (0..IDeval->nData). If -1, this structure */
  130. /* is not yet initialized. */
  131. int tdata; /* C-index of actual time vector with */
  132. /* respect to traj, i.e., traj.data[tdata] */
  133. /* contains the actual time vector */
  134. } AtrajInfoTime;
  135. typedef struct {
  136. AtrajInfoTime *tinfo; /* Pointer to abscissa data. */
  137. /* If Null, no signal is defined. */
  138. AmatData sig; /* Pointer to signal vector. */
  139. /* real/double sig[tptr->ntime] */
  140. /* If Null, no signal is defined */
  141. int ipo; /* Interpolation method */
  142. int expo; /* Extrapolation method */
  143. int sign; /* Sign of signal (+1/-1) */
  144. char *name; /* Name of signal */
  145. int offset; /* used for doubleRowMatrix */
  146. } AtrajInfoSignal;
  147. typedef struct {
  148. AtrajInfoTime *tinfo; /* Information of abscissa data */
  149. /* tinfo[ntMax] */
  150. AtrajInfoSignal *sinfo; /* Information of data to be interpolated */
  151. /* sinfo[nsig] */
  152. AmatType prec; /* Precision of data (real/double) */
  153. int ntMax; /* Maximum number of different time vectors */
  154. int nt; /* Number of utilized time vectors */
  155. int nsig; /* Number of signals to be interpolated */
  156. int ijump; /* = 0: last interval (no discontinuous */
  157. /* point anymore). */
  158. /* = 1: tjump is the next discontinuous */
  159. /* point. */
  160. doublereal tjump; /* Time instant of next discontinuous point */
  161. /* if ijump=1. */
  162. } AtrajEval;
  163. typedef struct Atrajectory {
  164. char *title; /* description text of trajectory */
  165. int nData; /* number of data matrices (>= 1) */
  166. Amatrix name; /* names of trajectories; char name(nName) */
  167. /* The names should be unique identifiers */
  168. Amatrix description; /* description text for names; */
  169. /* char description(nName); may have zero rows, */
  170. /* if no description texts are provided */
  171. Amatrix info; /* int info(Name,4); column dense storage format. */
  172. /* Information in which data_i matrix the data is */
  173. /* stored and how it has to be interpreted. */
  174. /* Details see description at top of file */
  175. Amatrix *data; /* data[nData] numeric (float/double) matrices; */
  176. AtrajEval *eval; /* information build-up to allow fast */
  177. /* evaluation of the signals; this structure */
  178. /* contains redundant information and is */
  179. /* mainpulated by the atrajEvalXXX functions */
  180. int npoints; /* number of points used for spline interpolation */
  181. } Atrajectory;
  182. typedef enum {
  183. realReq, /* data required in real precision */
  184. doubleReq, /* data required in doublereal precision */
  185. realRowReq, /* data required in real precision, and row variant */
  186. doubleRowReq /* data required in doublereal precision, and row variant */
  187. } AmatPrec;
  188. typedef struct AtrajectoryRemember {
  189. fpos_t headerStart;
  190. fpos_t dataEnd;
  191. AmatGetFile getFile;
  192. Atrajectory *traj;
  193. } AtrajectoryRemember;
  194. /* ----------------- Reading trajectory objects from file ----------------- */
  195. extern Atrajectory* atrajRead (const char *fileName, AmatPrec prec);
  196. /* Read trajectory from file. It is checked, whether the read object
  197. is a valid Atrajectory object.
  198. -> fileName: Name of file
  199. -> prec : Desired precision (realReq or doubleReq)
  200. <- RETURN : Trajectory read from file. If NULL is returned, an
  201. error occured and the error message is stored
  202. as (static) string in global variable "amatError".
  203. */
  204. extern Atrajectory* atrajReadRemember(const char *fileName, AmatPrec prec, AtrajectoryRemember*remember);
  205. /* Extended variant. if remember is non-NULL one must close this with atrajCloseRemember*/
  206. void atrajCloseRemember(AtrajectoryRemember*remember);
  207. /* Must be called if atrajReadRemember have been called */
  208. /* Note that you should first call atrajMoreRemember */
  209. int atrajMoreRemember(AtrajectoryRemember*remember);
  210. /* for reading more data from the file. Returns true if something was read */
  211. /* ----------------- Writing trajectory objects to file ------------------- */
  212. extern int atrajWrite (const char *fileName, Atrajectory *traj, AmatFileType ftype);
  213. /* Write trajectory to file. It is NOT checked, whether Atrajectory
  214. is a valid Atrajectory object.
  215. -> fileName : Name of file.
  216. -> Atrajectory : Trajectory.
  217. -> AmatFileType: File type (amatASCII, amatBinary)
  218. <- RETURN : = 0 : no error occurs.
  219. else: an error occured; the error message is stored
  220. as (static) string in global variable "amatError".
  221. */
  222. extern int atrajWinit (const char *fileName, Atrajectory *traj, integer rowMatrixIndex,
  223. AmatFileType ftype, AmatPutFile *file);
  224. /* Initialize row-wise writing of trajectory to file.
  225. It is NOT checked, whether Atrajectory is a valid Atrajectory object.
  226. -> fileName : Name of file.
  227. -> Atrajectory : Trajectory (numeric data is ignored).
  228. -> rowMatrixIndex: traj.data[0..rowMatrixIndex-1] is already stored on file
  229. by this call. Matrix traj.data[rowMatrixIndex] is not
  230. provided and is stored by atrajReal, atrajDouble.
  231. If rowMatrixIndex=-1, the complete traj-object is stored
  232. and the file is closed. That is no call to atrajWclose
  233. should be made.
  234. -> AmatFileType : File type (amatASCII, amatBinary)
  235. <- file : File identificator.
  236. <- RETURN : = 0 : no error occurs.
  237. else: an error occured; the error message is stored
  238. as (static) string in global variable "amatError".
  239. */
  240. extern int atrajWclose (AmatPutFile *file, Atrajectory *traj, integer rowMatrixIndex);
  241. /* Close row-wise writing of trajectory
  242. -> file : File identificator.
  243. -> traj : Remaining matrices to be stored on file.
  244. -> rowMatrixIndex: Matrices traj.data[rowMatrixIndex+1,...] are stored on
  245. file before closing the file.
  246. <- RETURN: = 0 : no error occurs.
  247. else : an error occured; the error message is stored
  248. as (static) string in global variable "amatError".
  249. */
  250. extern int atrajWreal (AmatPutFile *file, real row[]);
  251. extern int atrajWdouble (AmatPutFile *file, doublereal row[]);
  252. /* Write row of trajectory to file
  253. -> file : File identificator.
  254. -> row : Row to be written to file. The dimension of the vector was
  255. defined by "traj.data[rowMatrixIndex].nrow" of atrajWinit.
  256. <- RETURN: = 0 : no error occurs.
  257. else: an error occured; the error message is stored
  258. as (static) string in global variable "amatError".
  259. */
  260. /* ------------ Utility functions to plot trajectory objects -------------- */
  261. extern void atrajSetNpoints(Atrajectory* traj, int npoints);
  262. /* Set number of points "npoints" used for spline interpolation.
  263. If not called, a reasonable default for npoints is used.
  264. <> traj : Trajectory.
  265. -> npoints: Number of points used for spline interpolation.
  266. */
  267. extern int atrajGetNsig(Atrajectory* traj);
  268. /* Get total number of signals
  269. -> traj : Trajectory.
  270. <- return: Total number of signals (>= 0).
  271. */
  272. extern const char* atrajGetName(Atrajectory* traj, int i);
  273. /* Inquire name of signal i. A pointer
  274. to the name is returned (the name is NOT copied).
  275. -> traj : Trajectory.
  276. -> i : Signal index (0 <= i < nsig (from atrajGetNsig)).
  277. i=0 characterizes the abscissa value (Time).
  278. <- return: Pointer to name of signal i. If NULL, i is out of range.
  279. */
  280. extern const char* atrajGetDescription(Atrajectory* traj, int i);
  281. /* Inquire description of signal i. A pointer
  282. to the description is returned (the description is NOT copied).
  283. -> traj : Trajectory.
  284. -> i : Signal index (0 <= i < nsig (from atrajGetNsig)).
  285. i=0 characterizes the abscissa value (Time).
  286. <- return: Pointer to name of signal i.
  287. If NULL, i is out of range, or no descriptions are available.
  288. */
  289. extern int atrajGetYdataR (Atrajectory* traj, const char* yName,
  290. int* n, real** x, real** y);
  291. extern int atrajGetYdataD (Atrajectory* traj, const char* yName,
  292. int* n, doublereal** x, doublereal** y);
  293. extern int atrajGetXYdataR(Atrajectory* traj, const char* xName, const char* yName,
  294. int* n, real** x, real** y);
  295. extern int atrajGetXYdataD(Atrajectory* traj, const char* xName, const char* yName,
  296. int* n, doublereal** x, doublereal** y);
  297. /* Get trajectory data as a polygon.
  298. <> traj : Trajectory.
  299. -> xName : Abscissa signal name.
  300. (for atrajGetYData this is the first signal in the trajectory,
  301. i.e. usually time; the name of the abscissa can be inquired
  302. via atrajGetTimeName).
  303. -> yName : Ordinate signal name.
  304. <- n : Number of signal points.
  305. <- x : Vector of abscissa values, x[n].
  306. <- y : Vector of ordinate values, y[n].
  307. <- return : = 0: x,y are pointers to internal data of traj.
  308. = 1: x,y is stored in newly allocated memory (malloc)
  309. The calling routine is responsible for this memory.
  310. = 2: An error occured and an error message is stored as
  311. static string in global variable amatError.
  312. */
  313. extern int atrajGetXYdataDiOnline(Atrajectory* traj, const char* xName, int ix, const char* yName, int iy,
  314. int* n, doublereal** x, doublereal** y,double onlineWindow);
  315. extern int atrajGetXYdataDi(Atrajectory* traj, const char* xName, int ix, const char* yName, int iy,
  316. int* n, doublereal**x, doublereal** y);
  317. /* See above for description
  318. ix and iy are precomputed index of the variables xName and yName
  319. */
  320. extern int atrajGetRowDim(Atrajectory* traj);
  321. /* Inquire number of rows of matrix traj->data[1] matrix if 2 matrices
  322. or traj->data[0] if 1 matrix
  323. -> traj : Trajectory
  324. <- return: >= 0: Number of rows (time points) of traj->data[1 or 0] matrix.
  325. =-1: Error. The error message is stored as static string
  326. in global variable amatError.
  327. */
  328. extern double atrajGetTimeMin(Atrajectory* traj);
  329. extern double atrajGetTimeMax(Atrajectory* traj);
  330. /* Return min and max time-values for the trajectory.
  331. */
  332. extern int atrajGetRowR(Atrajectory* traj, int irow, real row[]);
  333. extern int atrajGetRowD(Atrajectory* traj, int irow, doublereal row[]);
  334. /* Get row "irow" of data matrices.
  335. The values of all signals are stored in "row" in the same order
  336. as the signals are defined in traj.name. In "row" the values
  337. of row 1 of traj.data[0] matrix and of row "irow" of traj.data[1]
  338. matrix are stored (or only traj.data[0], if only one matrix).
  339. -> traj : Trajectory.
  340. -> irow : Row to be inquired
  341. (0 <= irow < nsig; nsig from atrajGetNsig).
  342. <- row : Data of row "irow"; row[nsig] (nsig from atrajGetNsig).
  343. <- return: = 0: No error.
  344. = 1: Error. The error message is stored as static string
  345. in global variable amatError.
  346. */
  347. extern int atrajGetRowDsub(Atrajectory* traj, int irow, doublereal *row, int ifrom, int ito);
  348. extern int atrajGetRowRsub(Atrajectory* traj, int irow, real *row, int ifrom, int ito);
  349. /* Get part of row "irow" of data matrices */
  350. /* Similar as the above, but for a limited part of the number of signals */
  351. /* Get Row data from [ifrom,ito) I.e. row[0]=data[ifrom], ... row[..]=data[ito-1] */
  352. /* ------------ Generating/destroying trajectory objects ------------------ */
  353. extern Atrajectory *atrajNew(integer nData, AmatPrec prec);
  354. /* Generate a new Atrajectory object with nData data objects.
  355. -> nData : Number of numeric data-objects contained in traj
  356. (nData >= 0 required).
  357. -> prec : Precision of numeric data matrices (= realReq or doubleReq).
  358. <- RETURN: > 0: Pointer to new trajectory object.
  359. = 0: an error occured; the error message is stored
  360. as (static) string in global variable "amatError".
  361. */
  362. extern int atrajInit(Atrajectory *traj, integer nData, AmatPrec prec);
  363. /* Initialize an Atrajectory object with nData data objects.
  364. <> traj : On entry non-initialized, empty trajectory object.
  365. On return, an initialized trajectory object with nData
  366. data objects.
  367. -> nData : Number of numeric data matrices (>= 0 required).
  368. -> prec : Precision of numeric data matrices (= realReq or doubleReq).
  369. <- RETURN: = 0: No error occured.
  370. = 1: An error occured.
  371. */
  372. extern int atrajResize(Atrajectory *traj, integer nDataNew, AmatPrec prec);
  373. /* Resize an Atrajectory object.
  374. <> traj : On entry actual trajectory object with traj->nData=0.
  375. On return, the trajectory object has nDataNew
  376. numeric data objects.
  377. -> nDataNew: Number of numeric data matrices (>= 0 required).
  378. -> prec : Precision of new data matrices (= realReq or doubleReq).
  379. <- RETURN : = 0: No error occured.
  380. = 1: An error occured.
  381. */
  382. extern void atrajDel (Atrajectory *traj);
  383. /* Delete internal storage of an Atrajectory object (but not traj itself) */
  384. extern void atrajDelAll (Atrajectory *traj);
  385. /* Delete complete storage in an Atrajectory object (traj=NULL afterwards)*/
  386. /* ------------ Fast interpolation of trajectory objects ------------------ */
  387. /* The following functions "atrajEvalXXX" are designed to evaluate a
  388. trajectory during simulation, i.e., the actual values have to be evaluated
  389. at many given time instants which are not known in advance, but which are
  390. essentially given in quasi monotonically increasing order (sometimes
  391. going back in time, but never before the previous discontinuous point).
  392. Trajectories may be discontinuous at certain points in time.
  393. In order to be able to generate an event, it is necessary to inquire
  394. these discontinuous points in advance. It is assumed, that in an
  395. interval between two discontinuous time instants, a time instant
  396. outside of this interval is never inquired. A function is provided
  397. to move from one such interval to the next one.
  398. The most time consuming part is to search for the actual time instant.
  399. Therefore internally the position of the last inquirey is stored
  400. and the search for the next time interval starts from this position.
  401. */
  402. extern int atrajEvalInit(Atrajectory* traj, const char*const* sigName, int nsig,
  403. doublereal tStart);
  404. /* Initialize evaluation of trajectory data.
  405. Note, that all trajectory data matrices must have the same precision
  406. (either real or double precision).
  407. <> traj : Trajectory object to be evaluated at given time instants.
  408. -> sigName: Vector of names (= Vector of string pointers) which
  409. characterize the signals to be evaluated (sigName[nsig]).
  410. if sigName = NULL, all signals in traj are evaluated.
  411. -> nsig : Number of names in "sigName". If sigName=NULL, nsig is ignored
  412. and internally the dimension traj->name.nrow is used.
  413. -> tStart : First time instant where the trajectory will be
  414. interpolated.
  415. <- return : = 0: Initialization correct.
  416. = 1: At least one name in sigName is not contained in traj.
  417. All the missing names are stored in appropriate form
  418. in (static) string amatError. This allows printing of
  419. a warning message of the form:
  420. if ( ... == 1)
  421. fprintf(stderr, "Warning: The following model input signals are "
  422. "not defined and are set to zero:\n%s",amatError);
  423. = 2: Initialization failed. An error message is stored in amatError.
  424. */
  425. extern void atrajEvalClear(Atrajectory* traj);
  426. /* Clear evaluation of fast evaluation data structure in the trajectory.
  427. <> traj: Trajectory.
  428. */
  429. extern void atrajEvalNextInterval(Atrajectory* traj);
  430. /* Move to next evaluation interval, i.e., after the next
  431. discontinuous point in the current interval. Afterwards it is only
  432. possible to evaluate the trajectory at bigger time instants.
  433. <> traj: Trajectory.
  434. */
  435. extern doublereal atrajEvalNextJump(Atrajectory* traj, int *info);
  436. /* Inquire next discontinuous time instant
  437. <> traj : Trajectory.
  438. <- info : = 0: There is no discontinuous time instant any more.
  439. = 1: The next discontinuous time instant in the current
  440. interval.
  441. <- RETURN: If info=0: 0.0.
  442. If info=1: Next discontinuous time instant.
  443. */
  444. extern int atrajEvalRowR(Atrajectory* traj, doublereal time, doublereal sig[]);
  445. extern int atrajEvalRowD(Atrajectory* traj, doublereal time, doublereal sig[]);
  446. extern int atrajEvalR (Atrajectory* traj, real time, real sig[]);
  447. extern int atrajEvalD (Atrajectory* traj, doublereal time, doublereal sig[]);
  448. /* Interpolate the trajectory signals at time instant "time"
  449. (real and double precision version).
  450. If trajectory has "real" matrices, atrajEvalR must be used.
  451. If trajectory has "double" matrices, atrajEvalD must be used.
  452. If trajectory has "doublerow" matrices, atrajEvalRowD must be used.
  453. <> traj : Trajectory.
  454. -> time : Actual time instant.
  455. <- sig : Interpolated trajectory signals at "time".
  456. (sig[nsig], where nsig is defined by atrajEvalInit).
  457. In case of error, sig[i]=0.
  458. <- return: = 0: No error.
  459. = 1: An error occured. The error message is stored as
  460. static string in global variable amatError.
  461. The signal (sig) is returned as 0.0.
  462. */
  463. #if defined (GCC) && defined(GODESS)
  464. }
  465. #endif
  466. #endif