/[ascend]/branches/georgy/ascend/integrator/samplelist.h
ViewVC logotype

Contents of /branches/georgy/ascend/integrator/samplelist.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3105 - (show annotations) (download) (as text)
Tue May 24 01:31:12 2016 UTC (8 years, 2 months ago) by jpye
File MIME type: text/x-chdr
File size: 2363 byte(s)
Creating new branch for [[User:Georgy]] for [[GSOC2016]], from trunk r3104.

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, see <http://www.gnu.org/licenses/>.
16 *//**
17 @file
18 Sample list for ASCEND integrator. Keeps a list of sample times
19 for which model data will be computed during the integration.
20
21 Will include functions to initialise various kinds of sample
22 vectors, from linear-spaced to log-spaced, etc.
23
24 This is a nicely self-contained 'class' that can be wrapped up and
25 interfaced with SWIG/C++ for the PyGTK interface, and interfaced via
26 the current functions in Integrators.c for the needs of the Tcl/Tk GUI.
27 *//*
28 by John Pye, May 2006.
29 */
30
31 #ifndef ASC_SAMPLELIST_H
32 #define ASC_SAMPLELIST_H
33
34 /** @addtogroup integrator_sample Integrator Sample List
35 @{
36 */
37
38 #include <ascend/general/platform.h>
39 #include <ascend/compiler/fractions.h>
40 #include <ascend/compiler/compiler.h>
41 #include <ascend/compiler/dimen.h>
42
43 /** An array of sample 'times' for reference during integration */
44 struct SampleList_struct {
45 long ns;
46 double *x;
47 const dim_type *d;
48 };
49
50 typedef struct SampleList_struct SampleList;
51
52 ASC_DLLSPEC void samplelist_free(SampleList *);
53
54 ASC_DLLSPEC SampleList *samplelist_new(unsigned long n, const dim_type *d);
55
56 /* assign to a SampleList, freeing stuff if there's some there. */
57
58 ASC_DLLSPEC int samplelist_assign(SampleList *l, unsigned long n, double *values, const dim_type *d);
59
60 ASC_DLLSPEC long samplelist_length(CONST SampleList *l);
61 ASC_DLLSPEC const dim_type *samplelist_dim(CONST SampleList *l);
62
63 /**
64 Get an element from the samplelist. Value of the index i should be in [0,ns).
65 */
66 ASC_DLLSPEC double samplelist_get(CONST SampleList *l, CONST long i);
67 ASC_DLLSPEC void samplelist_set(CONST SampleList *l, CONST long i, CONST double x);
68
69 void samplelist_debug(CONST SampleList *l);
70
71 /* @} */
72
73 #endif

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