| 1 | /* poly/zsolve_init.c |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough |
| 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 | #include "gsl__config.h"cxx . . $ `<file>/external/gsl/gsl__config.h`/ |
| 21 | #include <math.h> |
| 22 | #include "gsl_math.h"cxx . . $ `<file>/external/gsl/gsl_math.h`/ |
| 23 | #include "gsl_complex.h"cxx . . $ `<file>/external/gsl/gsl_complex.h`/ |
| 24 | #include "gsl_poly.h"cxx . . $ `<file>/external/gsl/gsl_poly.h`/ |
| 25 | #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/ |
| 26 | |
| 27 | gsl_poly_complex_workspacecxx . . $ gsl_poly_complex_workspace# * |
| 28 | gsl_poly_complex_workspace_alloccxx . . $ gsl_poly_complex_workspace_alloc(5d1c6074a757cc7a). (size_t n) |
| 29 | { |
| 30 | size_t nc ; |
| 31 | |
| 32 | gsl_poly_complex_workspacecxx . . $ gsl_poly_complex_workspace# * w ; |
| 33 | |
| 34 | if (n == 0) |
| 35 | { |
| 36 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("matrix size n must be positive integer", GSL_EDOM, 0); |
| 37 | } |
| 38 | |
| 39 | w = (gsl_poly_complex_workspacecxx . . $ gsl_poly_complex_workspace# *) |
| 40 | malloccxx . . $ malloc(bfcfa4d6b7f7ef64). (sizeof(gsl_poly_complex_workspacecxx . . $ gsl_poly_complex_workspace#)); |
| 41 | |
| 42 | if (w == 0) |
| 43 | { |
| 44 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("failed to allocate space for struct", GSL_ENOMEM, 0); |
| 45 | } |
| 46 | |
| 47 | nc = n - 1; |
| 48 | |
| 49 | w->nccxx . . $ $anonymous_type_a68e025527e5319d_0#nc. = nc; |
| 50 | |
| 51 | w->matrixcxx . . $ $anonymous_type_a68e025527e5319d_0#matrix. = (double *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64). (nc * nc * sizeof(double)); |
| 52 | |
| 53 | if (w->matrixcxx . . $ $anonymous_type_a68e025527e5319d_0#matrix. == 0) |
| 54 | { |
| 55 | freecxx . . $ free(5d22bdacc48458e8). (w) ; /* error in constructor, avoid memory leak */ |
| 56 | |
| 57 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("failed to allocate space for workspace matrix", |
| 58 | GSL_ENOMEM, 0); |
| 59 | } |
| 60 | |
| 61 | return w ; |
| 62 | } |
| 63 | |
| 64 | void |
| 65 | gsl_poly_complex_workspace_freecxx . . $ gsl_poly_complex_workspace_free(856fbceaed224b67). (gsl_poly_complex_workspacecxx . . $ gsl_poly_complex_workspace# * w) |
| 66 | { |
| 67 | freecxx . . $ free(5d22bdacc48458e8).(w->matrixcxx . . $ $anonymous_type_a68e025527e5319d_0#matrix.) ; |
| 68 | freecxx . . $ free(5d22bdacc48458e8).(w); |
| 69 | } |