| 1 | /* matrix/prop_source.c |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, 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 | int |
| 21 | FUNCTION (gsl_matrix, isnull) (const TYPE (gsl_matrix) * m) |
| 22 | { |
| 23 | const size_t size1 = m->size1; |
| 24 | const size_t size2 = m->size2; |
| 25 | const size_t tda = m->tda ; |
| 26 | |
| 27 | size_t i, j, k; |
| 28 | |
| 29 | for (i = 0; i < size1 ; i++) |
| 30 | { |
| 31 | for (j = 0; j < size2; j++) |
| 32 | { |
| 33 | for (k = 0; k < MULTIPLICITY; k++) |
| 34 | { |
| 35 | if (m->data[(i * tda + j) * MULTIPLICITY + k] != 0.0) |
| 36 | { |
| 37 | return 0; |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | return 1; |
| 44 | } |
| 45 | |
| 46 | |
| 47 | int |
| 48 | FUNCTION (gsl_matrix, ispos) (const TYPE (gsl_matrix) * m) |
| 49 | { |
| 50 | const size_t size1 = m->size1; |
| 51 | const size_t size2 = m->size2; |
| 52 | const size_t tda = m->tda ; |
| 53 | |
| 54 | size_t i, j, k; |
| 55 | |
| 56 | for (i = 0; i < size1 ; i++) |
| 57 | { |
| 58 | for (j = 0; j < size2; j++) |
| 59 | { |
| 60 | for (k = 0; k < MULTIPLICITY; k++) |
| 61 | { |
| 62 | if (m->data[(i * tda + j) * MULTIPLICITY + k] <= 0.0) |
| 63 | { |
| 64 | return 0; |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | return 1; |
| 71 | } |
| 72 | |
| 73 | |
| 74 | int |
| 75 | FUNCTION (gsl_matrix, isneg) (const TYPE (gsl_matrix) * m) |
| 76 | { |
| 77 | const size_t size1 = m->size1; |
| 78 | const size_t size2 = m->size2; |
| 79 | const size_t tda = m->tda ; |
| 80 | |
| 81 | size_t i, j, k; |
| 82 | |
| 83 | for (i = 0; i < size1 ; i++) |
| 84 | { |
| 85 | for (j = 0; j < size2; j++) |
| 86 | { |
| 87 | for (k = 0; k < MULTIPLICITY; k++) |
| 88 | { |
| 89 | if (m->data[(i * tda + j) * MULTIPLICITY + k] >= 0.0) |
| 90 | { |
| 91 | return 0; |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | return 1; |
| 98 | } |
| 99 | |
| 100 | |
| 101 | int |
| 102 | FUNCTION (gsl_matrix, isnonneg) (const TYPE (gsl_matrix) * m) |
| 103 | { |
| 104 | const size_t size1 = m->size1; |
| 105 | const size_t size2 = m->size2; |
| 106 | const size_t tda = m->tda ; |
| 107 | |
| 108 | size_t i, j, k; |
| 109 | |
| 110 | for (i = 0; i < size1 ; i++) |
| 111 | { |
| 112 | for (j = 0; j < size2; j++) |
| 113 | { |
| 114 | for (k = 0; k < MULTIPLICITY; k++) |
| 115 | { |
| 116 | if (m->data[(i * tda + j) * MULTIPLICITY + k] < 0.0) |
| 117 | { |
| 118 | return 0; |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | return 1; |
| 125 | } |