| 1 | #ifndef _PatternList_h_ |
| 2 | #define _PatternList_h_ |
| 3 | /* Pattern.h |
| 4 | * |
| 5 | * Copyright (C) 1993-2019,2021,2026 David Weenink |
| 6 | * |
| 7 | * This code is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 3 of the License, or (at |
| 10 | * your option) any later version. |
| 11 | * |
| 12 | * This code is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include "Matrix.h" |
| 22 | #include "ActivationList.h" |
| 23 | |
| 24 | Thing_define (PatternList, Matrix) { |
| 25 | }; |
| 26 | |
| 27 | /* Attributes: |
| 28 | xmin :index of first input node. |
| 29 | xmax :last node index. |
| 30 | nx :Number of inputs. |
| 31 | dx :1. |
| 32 | x1 :1. |
| 33 | ymin :1. |
| 34 | ymax :#patterns. |
| 35 | dy :1. |
| 36 | y1 :1. |
| 37 | z [iy] [ix] :the inputs. All elements in interval [0, 1]. |
| 38 | */ |
| 39 | |
| 40 | autoPatternList PatternList_create (integer ny, integer nx); |
| 41 | |
| 42 | void PatternList_normalize (PatternList me, int choice, double pmin, double pmax); |
| 43 | /* choice == 1: z [i] [j] = (z [i] [j] - pmin) / (pmax - pmin); |
| 44 | * choice == 2: z [i] [j] *= 1.0 / sum (j=1, j=nx, z [i] [j] - pmin) |
| 45 | */ |
| 46 | |
| 47 | void PatternList_draw (PatternList me, Graphics g, integer pattern, double xmin, double xmax, |
| 48 | double ymin, double ymax, bool garnish); |
| 49 | |
| 50 | autoPatternList Matrix_to_PatternList (Matrix me, integer join); |
| 51 | |
| 52 | autoMatrix PatternList_to_Matrix (PatternList me); |
| 53 | |
| 54 | autoPatternList ActivationList_to_PatternList (ActivationList me); |
| 55 | |
| 56 | bool _PatternList_checkElements (PatternList me); |
| 57 | /* Return true if all elements are in interval [0, 1] else 0. */ |
| 58 | |
| 59 | #endif /* _PatternList_h_ */ |