| 1 | /* SampledXY_def.h |
| 2 | * |
| 3 | * Copyright (C) 1992-2005,2008,2011-2018,2023 Paul Boersma |
| 4 | * |
| 5 | * This code 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 2 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code 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. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | |
| 20 | #define ooSTRUCTcxx . . $ `fon/SampledXY_def.h:20:9`! SampledXY |
| 21 | oo_DEFINE_CLASScxx . . $ `sys/oo.h:176:9`! (SampledXY, Sampled) |
| 22 | |
| 23 | oo_DOUBLEcxx . . $ `sys/oo.h:58:9`! (ymin) |
| 24 | oo_DOUBLEcxx . . $ `sys/oo.h:58:9`! (ymax) |
| 25 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (ny) |
| 26 | oo_DOUBLEcxx . . $ `sys/oo.h:58:9`! (dy) |
| 27 | oo_DOUBLEcxx . . $ `sys/oo.h:58:9`! (y1) |
| 28 | |
| 29 | #if oo_READINGcxx . . $ `sys/oo.h:235:9`! |
| 30 | if (ymin > ymax) { |
| 31 | Melder_throw (U"ymax should be at least as great as ymin."); |
| 32 | } |
| 33 | if (ny < 1) { |
| 34 | Melder_throw (U"ny should be at least 1."); |
| 35 | } |
| 36 | if (dy <= 0.0) { |
| 37 | Melder_throw (U"dy should be positive."); |
| 38 | } |
| 39 | #endif |
| 40 | |
| 41 | #if oo_DECLARINGcxx . . $ `sys/oo.h:230:9`! |
| 42 | bool v_hasGetYmincxx . . $ structSampledXY#v_hasGetYmin(50ce9a9e25b4a850). () const |
| 43 | override { return true; } |
| 44 | double v_getYmincxx . . $ structSampledXY#v_getYmin(21b6c25e127938e2). () const |
| 45 | override { return ymincxx . . $ structSampledXY#ymin.; } |
| 46 | bool v_hasGetYmaxcxx . . $ structSampledXY#v_hasGetYmax(50ce9a9e25b4a850). () const |
| 47 | override { return true; } |
| 48 | double v_getYmaxcxx . . $ structSampledXY#v_getYmax(21b6c25e127938e2). () const |
| 49 | override { return ymaxcxx . . $ structSampledXY#ymax.; } |
| 50 | bool v_hasGetNycxx . . $ structSampledXY#v_hasGetNy(50ce9a9e25b4a850). () const |
| 51 | override { return true; } |
| 52 | double v_getNycxx . . $ structSampledXY#v_getNy(21b6c25e127938e2). () const |
| 53 | override { return nycxx . . $ structSampledXY#ny.; } |
| 54 | bool v_hasGetDycxx . . $ structSampledXY#v_hasGetDy(50ce9a9e25b4a850). () const |
| 55 | override { return true; } |
| 56 | double v_getDycxx . . $ structSampledXY#v_getDy(21b6c25e127938e2). () const |
| 57 | override { return dycxx . . $ structSampledXY#dy.; } |
| 58 | bool v_hasGetYcxx . . $ structSampledXY#v_hasGetY(50ce9a9e25b4a850). () const |
| 59 | override { return true; } |
| 60 | double v_getYcxx . . $ structSampledXY#v_getY(9db9ea2d2e621dac). (const integercxx . . $ integer# iy) const |
| 61 | override { return y1cxx . . $ structSampledXY#y1. + (iy - 1) * dycxx . . $ structSampledXY#dy.; } |
| 62 | #endif |
| 63 | |
| 64 | oo_END_CLASScxx . . $ `sys/oo.h:186:9`! (SampledXY) |
| 65 | #undef ooSTRUCTcxx . . $ `fon/SampledXY_def.h:20:9`! |
| 66 | |
| 67 | |
| 68 | /* End of file SampledXY_def.h */ |