| 1 | /* matrix/rowcol_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 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) |
| 21 | FUNCTIONcxx . . $ `./templates_on.h:233:9`! (gsl_matrix, row) (QUALIFIED_TYPEcxx . . $ `./templates_on.h:236:9`!(gsl_matrix) * m, const size_t i) |
| 22 | { |
| 23 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) view = NULL_VECTOR_VIEWcxx . . $ `external/gsl/gsl_matrix__view.h:2:9`!; |
| 24 | |
| 25 | if (i >= m->size1cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size1.) |
| 26 | { |
| 27 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("row index is out of range", GSL_EINVAL, view); |
| 28 | } |
| 29 | |
| 30 | { |
| 31 | TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_vector) v = NULL_VECTORcxx . . $ `external/gsl/gsl_matrix__view.h:1:9`!; |
| 32 | |
| 33 | v.datacxx . . $ $anonymous_type_9a7b30797aee9e14_0#data. = m->datacxx . . $ $anonymous_type_9e5f70882c9c9756_0#data. + i * MULTIPLICITYcxx . . $ `./templates_on.h:117:9`! * m->tdacxx . . $ $anonymous_type_9e5f70882c9c9756_0#tda.; |
| 34 | v.sizecxx . . $ $anonymous_type_9a7b30797aee9e14_0#size. = m->size2cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size2.; |
| 35 | v.stridecxx . . $ $anonymous_type_9a7b30797aee9e14_0#stride. = 1; |
| 36 | v.blockcxx . . $ $anonymous_type_9a7b30797aee9e14_0#block. = m->blockcxx . . $ $anonymous_type_9e5f70882c9c9756_0#block.; |
| 37 | v.ownercxx . . $ $anonymous_type_9a7b30797aee9e14_0#owner. = 0; |
| 38 | |
| 39 | view.vectorcxx . . $ $anonymous_type_9a7b30797aee9e14_1#vector. = v; |
| 40 | return view; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) |
| 45 | FUNCTIONcxx . . $ `./templates_on.h:233:9`! (gsl_matrix, column) (QUALIFIED_TYPEcxx . . $ `./templates_on.h:236:9`!(gsl_matrix) * m, const size_t j) |
| 46 | { |
| 47 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) view = NULL_VECTOR_VIEWcxx . . $ `external/gsl/gsl_matrix__view.h:2:9`!; |
| 48 | |
| 49 | if (j >= m->size2cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size2.) |
| 50 | { |
| 51 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("column index is out of range", GSL_EINVAL, view); |
| 52 | } |
| 53 | |
| 54 | { |
| 55 | TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_vector) v = NULL_VECTORcxx . . $ `external/gsl/gsl_matrix__view.h:1:9`!; |
| 56 | |
| 57 | v.datacxx . . $ $anonymous_type_9a7b30797aee9e14_0#data. = m->datacxx . . $ $anonymous_type_9e5f70882c9c9756_0#data. + j * MULTIPLICITYcxx . . $ `./templates_on.h:117:9`!; |
| 58 | v.sizecxx . . $ $anonymous_type_9a7b30797aee9e14_0#size. = m->size1cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size1.; |
| 59 | v.stridecxx . . $ $anonymous_type_9a7b30797aee9e14_0#stride. = m->tdacxx . . $ $anonymous_type_9e5f70882c9c9756_0#tda.; |
| 60 | v.blockcxx . . $ $anonymous_type_9a7b30797aee9e14_0#block. = m->blockcxx . . $ $anonymous_type_9e5f70882c9c9756_0#block.; |
| 61 | v.ownercxx . . $ $anonymous_type_9a7b30797aee9e14_0#owner. = 0; |
| 62 | |
| 63 | view.vectorcxx . . $ $anonymous_type_9a7b30797aee9e14_1#vector. = v; |
| 64 | return view; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) |
| 69 | FUNCTIONcxx . . $ `./templates_on.h:233:9`! (gsl_matrix, diagonal) (QUALIFIED_TYPEcxx . . $ `./templates_on.h:236:9`!(gsl_matrix) * m) |
| 70 | { |
| 71 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) view = NULL_VECTOR_VIEWcxx . . $ `external/gsl/gsl_matrix__view.h:2:9`!; |
| 72 | |
| 73 | TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_vector) v = NULL_VECTORcxx . . $ `external/gsl/gsl_matrix__view.h:1:9`!; |
| 74 | v.datacxx . . $ $anonymous_type_9a7b30797aee9e14_0#data. = m->datacxx . . $ $anonymous_type_9e5f70882c9c9756_0#data.; |
| 75 | v.sizecxx . . $ $anonymous_type_9a7b30797aee9e14_0#size. = GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(m->size1,m->size2); |
| 76 | v.stridecxx . . $ $anonymous_type_9a7b30797aee9e14_0#stride. = m->tdacxx . . $ $anonymous_type_9e5f70882c9c9756_0#tda. + 1; |
| 77 | v.blockcxx . . $ $anonymous_type_9a7b30797aee9e14_0#block. = m->blockcxx . . $ $anonymous_type_9e5f70882c9c9756_0#block.; |
| 78 | v.ownercxx . . $ $anonymous_type_9a7b30797aee9e14_0#owner. = 0; |
| 79 | |
| 80 | view.vectorcxx . . $ $anonymous_type_9a7b30797aee9e14_1#vector. = v; |
| 81 | return view; |
| 82 | } |
| 83 | |
| 84 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) |
| 85 | FUNCTIONcxx . . $ `./templates_on.h:233:9`! (gsl_matrix, subdiagonal) (QUALIFIED_TYPEcxx . . $ `./templates_on.h:236:9`!(gsl_matrix) * m, |
| 86 | const size_t k) |
| 87 | { |
| 88 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) view = NULL_VECTOR_VIEWcxx . . $ `external/gsl/gsl_matrix__view.h:2:9`!; |
| 89 | |
| 90 | if (k >= m->size1cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size1.) |
| 91 | { |
| 92 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("subdiagonal index is out of range", GSL_EINVAL, view); |
| 93 | } |
| 94 | |
| 95 | { |
| 96 | TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_vector) v = NULL_VECTORcxx . . $ `external/gsl/gsl_matrix__view.h:1:9`!; |
| 97 | |
| 98 | v.datacxx . . $ $anonymous_type_9a7b30797aee9e14_0#data. = m->datacxx . . $ $anonymous_type_9e5f70882c9c9756_0#data. + k * MULTIPLICITYcxx . . $ `./templates_on.h:117:9`! * m->tdacxx . . $ $anonymous_type_9e5f70882c9c9756_0#tda.; |
| 99 | v.sizecxx . . $ $anonymous_type_9a7b30797aee9e14_0#size. = GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(m->size1 - k, m->size2); |
| 100 | v.stridecxx . . $ $anonymous_type_9a7b30797aee9e14_0#stride. = m->tdacxx . . $ $anonymous_type_9e5f70882c9c9756_0#tda. + 1; |
| 101 | v.blockcxx . . $ $anonymous_type_9a7b30797aee9e14_0#block. = m->blockcxx . . $ $anonymous_type_9e5f70882c9c9756_0#block.; |
| 102 | v.ownercxx . . $ $anonymous_type_9a7b30797aee9e14_0#owner. = 0; |
| 103 | |
| 104 | view.vectorcxx . . $ $anonymous_type_9a7b30797aee9e14_1#vector. = v; |
| 105 | return view; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) |
| 110 | FUNCTIONcxx . . $ `./templates_on.h:233:9`! (gsl_matrix, superdiagonal) (QUALIFIED_TYPEcxx . . $ `./templates_on.h:236:9`!(gsl_matrix) * m, |
| 111 | const size_t k) |
| 112 | { |
| 113 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) view = NULL_VECTOR_VIEWcxx . . $ `external/gsl/gsl_matrix__view.h:2:9`!; |
| 114 | |
| 115 | |
| 116 | if (k >= m->size2cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size2.) |
| 117 | { |
| 118 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("column index is out of range", GSL_EINVAL, view); |
| 119 | } |
| 120 | |
| 121 | { |
| 122 | TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_vector) v = NULL_VECTORcxx . . $ `external/gsl/gsl_matrix__view.h:1:9`!; |
| 123 | |
| 124 | v.datacxx . . $ $anonymous_type_9a7b30797aee9e14_0#data. = m->datacxx . . $ $anonymous_type_9e5f70882c9c9756_0#data. + k * MULTIPLICITYcxx . . $ `./templates_on.h:117:9`!; |
| 125 | v.sizecxx . . $ $anonymous_type_9a7b30797aee9e14_0#size. = GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(m->size1, m->size2 - k); |
| 126 | v.stridecxx . . $ $anonymous_type_9a7b30797aee9e14_0#stride. = m->tdacxx . . $ $anonymous_type_9e5f70882c9c9756_0#tda. + 1; |
| 127 | v.blockcxx . . $ $anonymous_type_9a7b30797aee9e14_0#block. = m->blockcxx . . $ $anonymous_type_9e5f70882c9c9756_0#block.; |
| 128 | v.ownercxx . . $ $anonymous_type_9a7b30797aee9e14_0#owner. = 0; |
| 129 | |
| 130 | view.vectorcxx . . $ $anonymous_type_9a7b30797aee9e14_1#vector. = v; |
| 131 | return view; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) |
| 136 | FUNCTIONcxx . . $ `./templates_on.h:233:9`! (gsl_matrix, subrow) (QUALIFIED_TYPEcxx . . $ `./templates_on.h:236:9`!(gsl_matrix) * m, const size_t i, const size_t offset, const size_t n) |
| 137 | { |
| 138 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) view = NULL_VECTOR_VIEWcxx . . $ `external/gsl/gsl_matrix__view.h:2:9`!; |
| 139 | |
| 140 | if (i >= m->size1cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size1.) |
| 141 | { |
| 142 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("row index is out of range", GSL_EINVAL, view); |
| 143 | } |
| 144 | else if (n == 0) |
| 145 | { |
| 146 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("vector length n must be positive integer", |
| 147 | GSL_EINVAL, view); |
| 148 | } |
| 149 | else if (offset + n > m->size1cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size1.) |
| 150 | { |
| 151 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("dimension n overflows matrix", GSL_EINVAL, view); |
| 152 | } |
| 153 | |
| 154 | { |
| 155 | TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_vector) v = NULL_VECTORcxx . . $ `external/gsl/gsl_matrix__view.h:1:9`!; |
| 156 | |
| 157 | v.datacxx . . $ $anonymous_type_9a7b30797aee9e14_0#data. = m->datacxx . . $ $anonymous_type_9e5f70882c9c9756_0#data. + MULTIPLICITYcxx . . $ `./templates_on.h:117:9`! * (i * m->tdacxx . . $ $anonymous_type_9e5f70882c9c9756_0#tda. + offset); |
| 158 | v.sizecxx . . $ $anonymous_type_9a7b30797aee9e14_0#size. = n; |
| 159 | v.stridecxx . . $ $anonymous_type_9a7b30797aee9e14_0#stride. = 1; |
| 160 | v.blockcxx . . $ $anonymous_type_9a7b30797aee9e14_0#block. = m->blockcxx . . $ $anonymous_type_9e5f70882c9c9756_0#block.; |
| 161 | v.ownercxx . . $ $anonymous_type_9a7b30797aee9e14_0#owner. = 0; |
| 162 | |
| 163 | view.vectorcxx . . $ $anonymous_type_9a7b30797aee9e14_1#vector. = v; |
| 164 | return view; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) |
| 169 | FUNCTIONcxx . . $ `./templates_on.h:233:9`! (gsl_matrix, subcolumn) (QUALIFIED_TYPEcxx . . $ `./templates_on.h:236:9`!(gsl_matrix) * m, const size_t j, const size_t offset, const size_t n) |
| 170 | { |
| 171 | QUALIFIED_VIEWcxx . . $ `./templates_on.h:237:9`!(_gsl_vector,view) view = NULL_VECTOR_VIEWcxx . . $ `external/gsl/gsl_matrix__view.h:2:9`!; |
| 172 | |
| 173 | if (j >= m->size2cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size2.) |
| 174 | { |
| 175 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("column index is out of range", GSL_EINVAL, view); |
| 176 | } |
| 177 | else if (n == 0) |
| 178 | { |
| 179 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("vector length n must be positive integer", |
| 180 | GSL_EINVAL, view); |
| 181 | } |
| 182 | else if (offset + n > m->size2cxx . . $ $anonymous_type_9e5f70882c9c9756_0#size2.) |
| 183 | { |
| 184 | GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("dimension n overflows matrix", GSL_EINVAL, view); |
| 185 | } |
| 186 | |
| 187 | { |
| 188 | TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_vector) v = NULL_VECTORcxx . . $ `external/gsl/gsl_matrix__view.h:1:9`!; |
| 189 | |
| 190 | v.datacxx . . $ $anonymous_type_9a7b30797aee9e14_0#data. = m->datacxx . . $ $anonymous_type_9e5f70882c9c9756_0#data. + MULTIPLICITYcxx . . $ `./templates_on.h:117:9`! * (offset * m->tdacxx . . $ $anonymous_type_9e5f70882c9c9756_0#tda. + j); |
| 191 | v.sizecxx . . $ $anonymous_type_9a7b30797aee9e14_0#size. = n; |
| 192 | v.stridecxx . . $ $anonymous_type_9a7b30797aee9e14_0#stride. = m->tdacxx . . $ $anonymous_type_9e5f70882c9c9756_0#tda.; |
| 193 | v.blockcxx . . $ $anonymous_type_9a7b30797aee9e14_0#block. = m->blockcxx . . $ $anonymous_type_9e5f70882c9c9756_0#block.; |
| 194 | v.ownercxx . . $ $anonymous_type_9a7b30797aee9e14_0#owner. = 0; |
| 195 | |
| 196 | view.vectorcxx . . $ $anonymous_type_9a7b30797aee9e14_1#vector. = v; |
| 197 | return view; |
| 198 | } |
| 199 | } |