| 1 | /* ode-initval/odeiv.c |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | /* Author: G. Jungman |
| 21 | */ |
| 22 | #include "gsl__config.h"cxx . . $ `<file>/external/gsl/gsl__config.h`/ |
| 23 | #include <stdlib.h> |
| 24 | #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/ |
| 25 | #include "gsl_odeiv.h"cxx . . $ `<file>/external/gsl/gsl_odeiv.h`/ |
| 26 | |
| 27 | gsl_odeiv_stepcxx . . $ gsl_odeiv_step# * |
| 28 | gsl_odeiv_step_alloccxx . . $ gsl_odeiv_step_alloc(f35891c0b7f78d81).(const gsl_odeiv_step_typecxx . . $ gsl_odeiv_step_type# * T, size_t dim) |
| 29 | { |
| 30 | gsl_odeiv_stepcxx . . $ gsl_odeiv_step# *s = (gsl_odeiv_stepcxx . . $ gsl_odeiv_step# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64). (sizeof (gsl_odeiv_stepcxx . . $ gsl_odeiv_step#)); |
| 31 | |
| 32 | if (s == 0) |
| 33 | { |
| 34 | GSL_ERROR_NULLcxx . . $ `external/gsl/gsl_errno.h:129:9`! ("failed to allocate space for ode struct", GSL_ENOMEM); |
| 35 | }; |
| 36 | |
| 37 | s->typecxx . . $ $anonymous_type_c944e69215e42634_2#type. = T; |
| 38 | s->dimensioncxx . . $ $anonymous_type_c944e69215e42634_2#dimension. = dim; |
| 39 | |
| 40 | s->statecxx . . $ $anonymous_type_c944e69215e42634_2#state. = s->typecxx . . $ $anonymous_type_c944e69215e42634_2#type.->alloccxx . . $ $anonymous_type_c944e69215e42634_1#alloc.(dim); |
| 41 | |
| 42 | if (s->statecxx . . $ $anonymous_type_c944e69215e42634_2#state. == 0) |
| 43 | { |
| 44 | freecxx . . $ free(5d22bdacc48458e8). (s); /* exception in constructor, avoid memory leak */ |
| 45 | |
| 46 | GSL_ERROR_NULLcxx . . $ `external/gsl/gsl_errno.h:129:9`! ("failed to allocate space for ode state", GSL_ENOMEM); |
| 47 | }; |
| 48 | |
| 49 | return s; |
| 50 | } |
| 51 | |
| 52 | const char * |
| 53 | gsl_odeiv_step_namecxx . . $ gsl_odeiv_step_name(ad19a006ae4bd941).(const gsl_odeiv_stepcxx . . $ gsl_odeiv_step# * s) |
| 54 | { |
| 55 | return s->typecxx . . $ $anonymous_type_c944e69215e42634_2#type.->namecxx . . $ $anonymous_type_c944e69215e42634_1#name.; |
| 56 | } |
| 57 | |
| 58 | unsigned int |
| 59 | gsl_odeiv_step_ordercxx . . $ gsl_odeiv_step_order(c07baaf4316c15df).(const gsl_odeiv_stepcxx . . $ gsl_odeiv_step# * s) |
| 60 | { |
| 61 | return s->typecxx . . $ $anonymous_type_c944e69215e42634_2#type.->ordercxx . . $ $anonymous_type_c944e69215e42634_1#order.(s->statecxx . . $ $anonymous_type_c944e69215e42634_2#state.); |
| 62 | } |
| 63 | |
| 64 | int |
| 65 | gsl_odeiv_step_applycxx . . $ gsl_odeiv_step_apply(abc4fc936a94a578).( |
| 66 | gsl_odeiv_stepcxx . . $ gsl_odeiv_step# * s, |
| 67 | double t, |
| 68 | double h, |
| 69 | double y[], |
| 70 | double yerr[], |
| 71 | const double dydt_in[], |
| 72 | double dydt_out[], |
| 73 | const gsl_odeiv_systemcxx . . $ gsl_odeiv_system# * dydt) |
| 74 | { |
| 75 | return s->typecxx . . $ $anonymous_type_c944e69215e42634_2#type.->applycxx . . $ $anonymous_type_c944e69215e42634_1#apply.(s->statecxx . . $ $anonymous_type_c944e69215e42634_2#state., s->dimensioncxx . . $ $anonymous_type_c944e69215e42634_2#dimension., t, h, y, yerr, dydt_in, dydt_out, dydt); |
| 76 | } |
| 77 | |
| 78 | int |
| 79 | gsl_odeiv_step_resetcxx . . $ gsl_odeiv_step_reset(315534907a0c4f61).(gsl_odeiv_stepcxx . . $ gsl_odeiv_step# * s) |
| 80 | { |
| 81 | return s->typecxx . . $ $anonymous_type_c944e69215e42634_2#type.->resetcxx . . $ $anonymous_type_c944e69215e42634_1#reset.(s->statecxx . . $ $anonymous_type_c944e69215e42634_2#state., s->dimensioncxx . . $ $anonymous_type_c944e69215e42634_2#dimension.); |
| 82 | } |
| 83 | |
| 84 | void |
| 85 | gsl_odeiv_step_freecxx . . $ gsl_odeiv_step_free(70b0036a14f7e2b6).(gsl_odeiv_stepcxx . . $ gsl_odeiv_step# * s) |
| 86 | { |
| 87 | s->typecxx . . $ $anonymous_type_c944e69215e42634_2#type.->freecxx . . $ $anonymous_type_c944e69215e42634_1#free.(s->statecxx . . $ $anonymous_type_c944e69215e42634_2#state.); |
| 88 | freecxx . . $ free(5d22bdacc48458e8).(s); |
| 89 | } |