OMCompiler/Compiler/Util/Lapack.mo
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * This file is part of OpenModelica. | ||
| 3 | * | ||
| 4 | * Copyright (c) 1998-2026, Open Source Modelica Consortium (OSMC), | ||
| 5 | * c/o Linköpings universitet, Department of Computer and Information Science, | ||
| 6 | * SE-58183 Linköping, Sweden. | ||
| 7 | * | ||
| 8 | * All rights reserved. | ||
| 9 | * | ||
| 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF AGPL VERSION 3 LICENSE OR | ||
| 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8. | ||
| 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES | ||
| 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GNU AGPL | ||
| 14 | * VERSION 3, ACCORDING TO RECIPIENTS CHOICE. | ||
| 15 | * | ||
| 16 | * The OpenModelica software and the OSMC (Open Source Modelica Consortium) | ||
| 17 | * Public License (OSMC-PL) are obtained from OSMC, either from the above | ||
| 18 | * address, from the URLs: | ||
| 19 | * http://www.openmodelica.org or | ||
| 20 | * https://github.com/OpenModelica/ or | ||
| 21 | * http://www.ida.liu.se/projects/OpenModelica, | ||
| 22 | * and in the OpenModelica distribution. | ||
| 23 | * | ||
| 24 | * GNU AGPL version 3 is obtained from: | ||
| 25 | * https://www.gnu.org/licenses/licenses.html#GPL | ||
| 26 | * | ||
| 27 | * This program is distributed WITHOUT ANY WARRANTY; without | ||
| 28 | * even the implied warranty of MERCHANTABILITY or FITNESS | ||
| 29 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH | ||
| 30 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. | ||
| 31 | * | ||
| 32 | * See the full OSMC Public License conditions for more details. | ||
| 33 | * | ||
| 34 | */ | ||
| 35 | |||
| 36 | encapsulated package Lapack | ||
| 37 | " file: Lapack.mo | ||
| 38 | package: Lapack | ||
| 39 | description: This file contains Lapack external functions. | ||
| 40 | |||
| 41 | |||
| 42 | This package contains Lapack external functions which are used by | ||
| 43 | CevalFunction to evaluate functions that use these Lapack functions. The | ||
| 44 | input/output parameters to the functions are named according to the Lapack | ||
| 45 | documentation, see e.g. the documentation in Modelica.Math.Matrices.LAPACK for | ||
| 46 | a description." | ||
| 47 | |||
| 48 | ✗ | public function dgeev | |
| 49 | input String inJOBVL; | ||
| 50 | input String inJOBVR; | ||
| 51 | input Integer inN; | ||
| 52 | input list<list<Real>> inA; | ||
| 53 | input Integer inLDA; | ||
| 54 | input Integer inLDVL; | ||
| 55 | input Integer inLDVR; | ||
| 56 | input list<Real> inWORK; | ||
| 57 | input Integer inLWORK; | ||
| 58 | output list<list<Real>> outA; | ||
| 59 | output list<Real> outWR; | ||
| 60 | output list<Real> outWI; | ||
| 61 | output list<list<Real>> outVL; | ||
| 62 | output list<list<Real>> outVR; | ||
| 63 | output list<Real> outWORK; | ||
| 64 | output Integer outINFO; | ||
| 65 | external "C" LapackImpl__dgeev(inJOBVL, inJOBVR, inN, inA, inLDA, inLDVL, | ||
| 66 | inLDVR, inWORK, inLWORK, outA, outWR, outWI, outVL, outVR, outWORK, outINFO) | ||
| 67 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 68 | end dgeev; | ||
| 69 | |||
| 70 | ✗ | public function dgegv | |
| 71 | input String inJOBVL; | ||
| 72 | input String inJOBVR; | ||
| 73 | input Integer inN; | ||
| 74 | input list<list<Real>> inA; | ||
| 75 | input Integer inLDA; | ||
| 76 | input list<list<Real>> inB; | ||
| 77 | input Integer inLDB; | ||
| 78 | input Integer inLDVL; | ||
| 79 | input Integer inLDVR; | ||
| 80 | input list<Real> inWORK; | ||
| 81 | input Integer inLWORK; | ||
| 82 | output list<Real> outALPHAR; | ||
| 83 | output list<Real> outALPHAI; | ||
| 84 | output list<Real> outBETA; | ||
| 85 | output list<list<Real>> outVL; | ||
| 86 | output list<list<Real>> outVR; | ||
| 87 | output list<Real> outWORK; | ||
| 88 | output Integer outINFO; | ||
| 89 | external "C" LapackImpl__dgegv(inJOBVL, inJOBVR, inN, inA, inLDA, inB, inLDB, | ||
| 90 | inLDVL, inLDVR, inWORK, inLWORK, outALPHAR, outALPHAI, outBETA, outVL, | ||
| 91 | outVR, outWORK, outINFO) annotation(Library = {"omcruntime", "Lapack"}); | ||
| 92 | end dgegv; | ||
| 93 | |||
| 94 | ✗ | public function dgels | |
| 95 | input String inTRANS; | ||
| 96 | input Integer inM; | ||
| 97 | input Integer inN; | ||
| 98 | input Integer inNRHS; | ||
| 99 | input list<list<Real>> inA; | ||
| 100 | input Integer inLDA; | ||
| 101 | input list<list<Real>> inB; | ||
| 102 | input Integer inLDB; | ||
| 103 | input list<Real> inWORK; | ||
| 104 | input Integer inLWORK; | ||
| 105 | output list<list<Real>> outA; | ||
| 106 | output list<list<Real>> outB; | ||
| 107 | output list<Real> outWORK; | ||
| 108 | output Integer outINFO; | ||
| 109 | external "C" LapackImpl__dgels(inTRANS, inM, inN, inNRHS, inA, inLDA, inB, | ||
| 110 | inLDB, inWORK, inLWORK, outA, outB, outWORK, outINFO) | ||
| 111 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 112 | end dgels; | ||
| 113 | |||
| 114 | ✗ | public function dgelsx | |
| 115 | input Integer inM; | ||
| 116 | input Integer inN; | ||
| 117 | input Integer inNRHS; | ||
| 118 | input list<list<Real>> inA; | ||
| 119 | input Integer inLDA; | ||
| 120 | input list<list<Real>> inB; | ||
| 121 | input Integer inLDB; | ||
| 122 | input list<Integer> inJPVT; | ||
| 123 | input Real inRCOND; | ||
| 124 | input list<Real> inWORK; | ||
| 125 | output list<list<Real>> outA; | ||
| 126 | output list<list<Real>> outB; | ||
| 127 | output list<Integer> outJPVT; | ||
| 128 | output Integer outRANK; | ||
| 129 | output Integer outINFO; | ||
| 130 | external "C" LapackImpl__dgelsx(inM, inN, inNRHS, inA, inLDA, inB, inLDB, | ||
| 131 | inJPVT, inRCOND, inWORK, outA, outB, outJPVT, outRANK, outINFO) | ||
| 132 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 133 | end dgelsx; | ||
| 134 | |||
| 135 | ✗ | public function dgelsy | |
| 136 | input Integer inM; | ||
| 137 | input Integer inN; | ||
| 138 | input Integer inNRHS; | ||
| 139 | input list<list<Real>> inA; | ||
| 140 | input Integer inLDA; | ||
| 141 | input list<list<Real>> inB; | ||
| 142 | input Integer inLDB; | ||
| 143 | input list<Integer> inJPVT; | ||
| 144 | input Real inRCOND; | ||
| 145 | input list<Real> inWORK; | ||
| 146 | input Integer inLWORK; | ||
| 147 | output list<list<Real>> outA; | ||
| 148 | output list<list<Real>> outB; | ||
| 149 | output list<Integer> outJPVT; | ||
| 150 | output Integer outRANK; | ||
| 151 | output list<Real> outWORK; | ||
| 152 | output Integer outINFO; | ||
| 153 | external "C" LapackImpl__dgelsy(inM, inN, inNRHS, inA, inLDA, inB, inLDB, | ||
| 154 | inJPVT, inRCOND, inWORK, inLWORK, outA, outB, outJPVT, outRANK, outWORK, outINFO) | ||
| 155 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 156 | end dgelsy; | ||
| 157 | |||
| 158 |
0/2✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
7 | public function dgesv |
| 159 | input Integer inN; | ||
| 160 | input Integer inNRHS; | ||
| 161 | input list<list<Real>> inA; | ||
| 162 | input Integer inLDA; | ||
| 163 | input list<list<Real>> inB; | ||
| 164 | input Integer inLDB; | ||
| 165 | output list<list<Real>> outA; | ||
| 166 | output list<Integer> outIPIV; | ||
| 167 | output list<list<Real>> outB; | ||
| 168 | output Integer outINFO; | ||
| 169 | external "C" LapackImpl__dgesv(inN, inNRHS, inA, inLDA, inB, inLDB, | ||
| 170 | outA, outIPIV, outB, outINFO) annotation(Library = {"omcruntime", "Lapack"}); | ||
| 171 | end dgesv; | ||
| 172 | |||
| 173 |
0/2✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
4 | public function dgglse |
| 174 | input Integer inM; | ||
| 175 | input Integer inN; | ||
| 176 | input Integer inP; | ||
| 177 | input list<list<Real>> inA; | ||
| 178 | input Integer inLDA; | ||
| 179 | input list<list<Real>> inB; | ||
| 180 | input Integer inLDB; | ||
| 181 | input list<Real> inC; | ||
| 182 | input list<Real> inD; | ||
| 183 | input list<Real> inWORK; | ||
| 184 | input Integer inLWORK; | ||
| 185 | output list<list<Real>> outA; | ||
| 186 | output list<list<Real>> outB; | ||
| 187 | output list<Real> outC; | ||
| 188 | output list<Real> outD; | ||
| 189 | output list<Real> outX; | ||
| 190 | output list<Real> outWORK; | ||
| 191 | output Integer outINFO; | ||
| 192 | external "C" LapackImpl__dgglse(inM, inN, inP, inA, inLDA, inB, inLDB, inC, | ||
| 193 | inD, inWORK, inLWORK, outA, outB, outC, outD, outX, outWORK, outINFO) | ||
| 194 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 195 | end dgglse; | ||
| 196 | |||
| 197 | ✗ | public function dgtsv | |
| 198 | input Integer inN; | ||
| 199 | input Integer inNRHS; | ||
| 200 | input list<Real> inDL; | ||
| 201 | input list<Real> inD; | ||
| 202 | input list<Real> inDU; | ||
| 203 | input list<list<Real>> inB; | ||
| 204 | input Integer inLDB; | ||
| 205 | output list<Real> outDL; | ||
| 206 | output list<Real> outD; | ||
| 207 | output list<Real> outDU; | ||
| 208 | output list<list<Real>> outB; | ||
| 209 | output Integer outINFO; | ||
| 210 | external "C" LapackImpl__dgtsv(inN, inNRHS, inDL, inD, inDU, inB, inLDB, | ||
| 211 | outDL, outD, outDU, outB, outINFO) | ||
| 212 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 213 | end dgtsv; | ||
| 214 | |||
| 215 | ✗ | public function dgbsv | |
| 216 | input Integer inN; | ||
| 217 | input Integer inKL; | ||
| 218 | input Integer inKU; | ||
| 219 | input Integer inNRHS; | ||
| 220 | input list<list<Real>> inAB; | ||
| 221 | input Integer inLDAB; | ||
| 222 | input list<list<Real>> inB; | ||
| 223 | input Integer inLDB; | ||
| 224 | output list<list<Real>> outAB; | ||
| 225 | output list<Integer> outIPIV; | ||
| 226 | output list<list<Real>> outB; | ||
| 227 | output Integer outINFO; | ||
| 228 | external "C" LapackImpl__dgbsv(inN, inKL, inKU, inNRHS, inAB, inLDAB, inB, | ||
| 229 | inLDB, outAB, outIPIV, outB, outINFO) | ||
| 230 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 231 | end dgbsv; | ||
| 232 | |||
| 233 | ✗ | public function dgesvd | |
| 234 | input String inJOBU; | ||
| 235 | input String inJOBVT; | ||
| 236 | input Integer inM; | ||
| 237 | input Integer inN; | ||
| 238 | input list<list<Real>> inA; | ||
| 239 | input Integer inLDA; | ||
| 240 | input Integer inLDU; | ||
| 241 | input Integer inLDVT; | ||
| 242 | input list<Real> inWORK; | ||
| 243 | input Integer inLWORK; | ||
| 244 | output list<list<Real>> outA; | ||
| 245 | output list<Real> outS; | ||
| 246 | output list<list<Real>> outU; | ||
| 247 | output list<list<Real>> outVT; | ||
| 248 | output list<Real> outWORK; | ||
| 249 | output Integer outINFO; | ||
| 250 | external "C" LapackImpl__dgesvd(inJOBU, inJOBVT, inM, inN, inA, inLDA, inLDU, | ||
| 251 | inLDVT, inWORK, inLWORK, outA, outS, outU, outVT, outWORK, outINFO) | ||
| 252 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 253 | end dgesvd; | ||
| 254 | |||
| 255 | ✗ | public function dgetrf | |
| 256 | input Integer inM; | ||
| 257 | input Integer inN; | ||
| 258 | input list<list<Real>> inA; | ||
| 259 | input Integer inLDA; | ||
| 260 | output list<list<Real>> outA; | ||
| 261 | output list<Integer> outIPIV; | ||
| 262 | output Integer outINFO; | ||
| 263 | external "C" LapackImpl__dgetrf(inM, inN, inA, inLDA, outA, outIPIV, outINFO) | ||
| 264 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 265 | end dgetrf; | ||
| 266 | |||
| 267 | ✗ | public function dgetrs | |
| 268 | input String inTRANS; | ||
| 269 | input Integer inN; | ||
| 270 | input Integer inNRHS; | ||
| 271 | input list<list<Real>> inA; | ||
| 272 | input Integer inLDA; | ||
| 273 | input list<Integer> inIPIV; | ||
| 274 | input list<list<Real>> inB; | ||
| 275 | input Integer inLDB; | ||
| 276 | output list<list<Real>> outB; | ||
| 277 | output Integer outINFO; | ||
| 278 | external "C" LapackImpl__dgetrs(inTRANS, inN, inNRHS, inA, inLDA, inIPIV, inB, | ||
| 279 | inLDB, outB, outINFO) | ||
| 280 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 281 | end dgetrs; | ||
| 282 | |||
| 283 | ✗ | public function dgetri | |
| 284 | input Integer inN; | ||
| 285 | input list<list<Real>> inA; | ||
| 286 | input Integer inLDA; | ||
| 287 | input list<Integer> inIPIV; | ||
| 288 | input list<Real> inWORK; | ||
| 289 | input Integer inLWORK; | ||
| 290 | output list<list<Real>> outA; | ||
| 291 | output list<Real> outWORK; | ||
| 292 | output Integer outINFO; | ||
| 293 | external "C" LapackImpl__dgetri(inN, inA, inLDA, inIPIV, inWORK, inLWORK, | ||
| 294 | outA, outWORK, outINFO) annotation(Library = {"omcruntime", "Lapack"}); | ||
| 295 | end dgetri; | ||
| 296 | |||
| 297 | ✗ | public function dgeqpf | |
| 298 | input Integer inM; | ||
| 299 | input Integer inN; | ||
| 300 | input list<list<Real>> inA; | ||
| 301 | input Integer inLDA; | ||
| 302 | input list<Integer> inJPVT; | ||
| 303 | input list<Real> inWORK; | ||
| 304 | output list<list<Real>> outA; | ||
| 305 | output list<Integer> outJPVT; | ||
| 306 | output list<Real> outTAU; | ||
| 307 | output Integer outINFO; | ||
| 308 | external "C" LapackImpl__dgeqpf(inM, inN, inA, inLDA, inJPVT, inWORK, outA, | ||
| 309 | outJPVT, outTAU, outINFO) annotation(Library = {"omcruntime", "Lapack"}); | ||
| 310 | end dgeqpf; | ||
| 311 | |||
| 312 | ✗ | public function dorgqr | |
| 313 | input Integer inM; | ||
| 314 | input Integer inN; | ||
| 315 | input Integer inK; | ||
| 316 | input list<list<Real>> inA; | ||
| 317 | input Integer inLDA; | ||
| 318 | input list<Real> inTAU; | ||
| 319 | input list<Real> inWORK; | ||
| 320 | input Integer inLWORK; | ||
| 321 | output list<list<Real>> outA; | ||
| 322 | output list<Real> outWORK; | ||
| 323 | output Integer outINFO; | ||
| 324 | external "C" LapackImpl__dorgqr(inM, inN, inK, inA, inLDA, inTAU, inWORK, inLWORK, | ||
| 325 | outA, outWORK, outINFO) annotation(Library = {"omcruntime", "Lapack"}); | ||
| 326 | end dorgqr; | ||
| 327 | |||
| 328 | ✗ | public function dhseqr | |
| 329 | input String inJOB; | ||
| 330 | input String inCOMPZ; | ||
| 331 | input Integer inN; | ||
| 332 | input Integer inILO; | ||
| 333 | input Integer inIHI; | ||
| 334 | input list<list<Real>> inH; | ||
| 335 | input Integer inLDH; | ||
| 336 | input list<list<Real>> inZ; | ||
| 337 | input Integer inLDZ; | ||
| 338 | input list<Real> inWORK; | ||
| 339 | input Integer inLWORK; | ||
| 340 | output list<list<Real>> outH; | ||
| 341 | output list<Real> outWR; | ||
| 342 | output list<Real> outWI; | ||
| 343 | output list<list<Real>> outZ; | ||
| 344 | output list<Real> outWORK; | ||
| 345 | output Integer outINFO; | ||
| 346 | external "C" LapackImpl__dhseqr(inJOB, inCOMPZ, inN, inILO, inIHI, inH, inLDH, | ||
| 347 | inZ, inLDZ, inWORK, inLWORK, outH, outWR, outWI, outZ, outWORK, outINFO) | ||
| 348 | annotation(Library = {"omcruntime", "Lapack"}); | ||
| 349 | end dhseqr; | ||
| 350 | |||
| 351 | annotation(__OpenModelica_Interface="util"); | ||
| 352 | end Lapack; | ||
| 353 |