/[ascend]/trunk/base/generic/solver/samplelist.h
ViewVC logotype

Contents of /trunk/base/generic/solver/samplelist.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 966 - (show annotations) (download) (as text)
Thu Dec 14 14:04:54 2006 UTC (13 years, 10 months ago) by johnpye
File MIME type: text/x-chdr
File size: 2339 byte(s)
Cleaned up code comments in units.h
Fixed a bug with starting timesteps in LSODE (i think)
Added function to output a SampleList to the console (for debugging)
Removed debug output from base/generic/test/SConscript.
Removed 'custom' headers for UnitsM in ascpy.i
Made a sane default ctor for UnitsM
Added some more test cases to the Python unittest suite (still a problem running multiple solver-based tests in a single run)
1 /* ASCEND modelling environment
2 Copyright (C) 2006 Carnegie Mellon University
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18 *//**
19 @file
20 Sample list for ASCEND integrator. Keeps a list of sample times
21 for which model data will be computed during the integration.
22
23 Will include functions to initialise various kinds of sample
24 vectors, from linear-spaced to log-spaced, etc.
25
26 This is a nicely self-contained 'class' that can be wrapped up and
27 interfaced with SWIG/C++ for the PyGTK interface, and interfaced via
28 the current functions in Integrators.c for the needs of the Tcl/Tk GUI.
29 *//*
30 by John Pye, May 2006.
31 */
32
33 #ifndef ASC_SAMPLELIST_H
34 #define ASC_SAMPLELIST_H
35
36 #include <utilities/ascConfig.h>
37 #include <compiler/fractions.h>
38 #include <compiler/compiler.h>
39 #include <compiler/dimen.h>
40
41 /** An array of sample 'times' for reference during integration */
42 struct SampleList_struct {
43 long ns;
44 double *x;
45 const dim_type *d;
46 };
47
48 typedef struct SampleList_struct SampleList;
49
50 ASC_DLLSPEC(void) samplelist_free(SampleList *);
51
52 ASC_DLLSPEC(SampleList *) samplelist_new(unsigned long n, const dim_type *d);
53
54 /* assign to a SampleList, freeing stuff if there's some there. */
55
56 ASC_DLLSPEC(int) samplelist_assign(SampleList *l, unsigned long n, double *values, const dim_type *d);
57
58 ASC_DLLSPEC(long) samplelist_length(CONST SampleList *l);
59 ASC_DLLSPEC(const dim_type *) samplelist_dim(CONST SampleList *l);
60
61 /**
62 Get an element from the samplelist. Value of the index i should be in [0,ns).
63 */
64 ASC_DLLSPEC(double) samplelist_get(CONST SampleList *l, CONST long i);
65 ASC_DLLSPEC(void) samplelist_set(CONST SampleList *l, CONST long i, CONST double x);
66
67 void samplelist_debug(CONST SampleList *l);
68
69 #endif

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22