1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461
|
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.2.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.
package Math::GSL::Vector;
use base qw(Exporter);
use base qw(DynaLoader);
package Math::GSL::Vectorc;
bootstrap Math::GSL::Vector;
package Math::GSL::Vector;
@EXPORT = qw();
# ---------- BASE METHODS -------------
package Math::GSL::Vector;
sub TIEHASH {
my ($classname,$obj) = @_;
return bless $obj, $classname;
}
sub CLEAR { }
sub FIRSTKEY { }
sub NEXTKEY { }
sub FETCH {
my ($self,$field) = @_;
my $member_func = "swig_${field}_get";
$self->$member_func();
}
sub STORE {
my ($self,$field,$newval) = @_;
my $member_func = "swig_${field}_set";
$self->$member_func($newval);
}
sub this {
my $ptr = shift;
return tied(%$ptr);
}
# ------- FUNCTION WRAPPERS --------
package Math::GSL::Vector;
*gsl_error = *Math::GSL::Vectorc::gsl_error;
*gsl_stream_printf = *Math::GSL::Vectorc::gsl_stream_printf;
*gsl_strerror = *Math::GSL::Vectorc::gsl_strerror;
*gsl_set_error_handler = *Math::GSL::Vectorc::gsl_set_error_handler;
*gsl_set_error_handler_off = *Math::GSL::Vectorc::gsl_set_error_handler_off;
*gsl_set_stream_handler = *Math::GSL::Vectorc::gsl_set_stream_handler;
*gsl_set_stream = *Math::GSL::Vectorc::gsl_set_stream;
*fopen = *Math::GSL::Vectorc::fopen;
*fclose = *Math::GSL::Vectorc::fclose;
*gsl_vector_char_alloc = *Math::GSL::Vectorc::gsl_vector_char_alloc;
*gsl_vector_char_calloc = *Math::GSL::Vectorc::gsl_vector_char_calloc;
*gsl_vector_char_alloc_from_block = *Math::GSL::Vectorc::gsl_vector_char_alloc_from_block;
*gsl_vector_char_alloc_from_vector = *Math::GSL::Vectorc::gsl_vector_char_alloc_from_vector;
*gsl_vector_char_free = *Math::GSL::Vectorc::gsl_vector_char_free;
*gsl_vector_char_view_array = *Math::GSL::Vectorc::gsl_vector_char_view_array;
*gsl_vector_char_view_array_with_stride = *Math::GSL::Vectorc::gsl_vector_char_view_array_with_stride;
*gsl_vector_char_const_view_array = *Math::GSL::Vectorc::gsl_vector_char_const_view_array;
*gsl_vector_char_const_view_array_with_stride = *Math::GSL::Vectorc::gsl_vector_char_const_view_array_with_stride;
*gsl_vector_char_subvector = *Math::GSL::Vectorc::gsl_vector_char_subvector;
*gsl_vector_char_subvector_with_stride = *Math::GSL::Vectorc::gsl_vector_char_subvector_with_stride;
*gsl_vector_char_const_subvector = *Math::GSL::Vectorc::gsl_vector_char_const_subvector;
*gsl_vector_char_const_subvector_with_stride = *Math::GSL::Vectorc::gsl_vector_char_const_subvector_with_stride;
*gsl_vector_char_set_zero = *Math::GSL::Vectorc::gsl_vector_char_set_zero;
*gsl_vector_char_set_all = *Math::GSL::Vectorc::gsl_vector_char_set_all;
*gsl_vector_char_set_basis = *Math::GSL::Vectorc::gsl_vector_char_set_basis;
*gsl_vector_char_fread = *Math::GSL::Vectorc::gsl_vector_char_fread;
*gsl_vector_char_fwrite = *Math::GSL::Vectorc::gsl_vector_char_fwrite;
*gsl_vector_char_fscanf = *Math::GSL::Vectorc::gsl_vector_char_fscanf;
*gsl_vector_char_fprintf = *Math::GSL::Vectorc::gsl_vector_char_fprintf;
*gsl_vector_char_memcpy = *Math::GSL::Vectorc::gsl_vector_char_memcpy;
*gsl_vector_char_reverse = *Math::GSL::Vectorc::gsl_vector_char_reverse;
*gsl_vector_char_swap = *Math::GSL::Vectorc::gsl_vector_char_swap;
*gsl_vector_char_swap_elements = *Math::GSL::Vectorc::gsl_vector_char_swap_elements;
*gsl_vector_char_max = *Math::GSL::Vectorc::gsl_vector_char_max;
*gsl_vector_char_min = *Math::GSL::Vectorc::gsl_vector_char_min;
*gsl_vector_char_minmax = *Math::GSL::Vectorc::gsl_vector_char_minmax;
*gsl_vector_char_max_index = *Math::GSL::Vectorc::gsl_vector_char_max_index;
*gsl_vector_char_min_index = *Math::GSL::Vectorc::gsl_vector_char_min_index;
*gsl_vector_char_minmax_index = *Math::GSL::Vectorc::gsl_vector_char_minmax_index;
*gsl_vector_char_add = *Math::GSL::Vectorc::gsl_vector_char_add;
*gsl_vector_char_sub = *Math::GSL::Vectorc::gsl_vector_char_sub;
*gsl_vector_char_mul = *Math::GSL::Vectorc::gsl_vector_char_mul;
*gsl_vector_char_div = *Math::GSL::Vectorc::gsl_vector_char_div;
*gsl_vector_char_scale = *Math::GSL::Vectorc::gsl_vector_char_scale;
*gsl_vector_char_add_constant = *Math::GSL::Vectorc::gsl_vector_char_add_constant;
*gsl_vector_char_equal = *Math::GSL::Vectorc::gsl_vector_char_equal;
*gsl_vector_char_isnull = *Math::GSL::Vectorc::gsl_vector_char_isnull;
*gsl_vector_char_ispos = *Math::GSL::Vectorc::gsl_vector_char_ispos;
*gsl_vector_char_isneg = *Math::GSL::Vectorc::gsl_vector_char_isneg;
*gsl_vector_char_isnonneg = *Math::GSL::Vectorc::gsl_vector_char_isnonneg;
*gsl_vector_char_get = *Math::GSL::Vectorc::gsl_vector_char_get;
*gsl_vector_char_set = *Math::GSL::Vectorc::gsl_vector_char_set;
*gsl_vector_char_ptr = *Math::GSL::Vectorc::gsl_vector_char_ptr;
*gsl_vector_char_const_ptr = *Math::GSL::Vectorc::gsl_vector_char_const_ptr;
*gsl_vector_complex_alloc = *Math::GSL::Vectorc::gsl_vector_complex_alloc;
*gsl_vector_complex_calloc = *Math::GSL::Vectorc::gsl_vector_complex_calloc;
*gsl_vector_complex_alloc_from_block = *Math::GSL::Vectorc::gsl_vector_complex_alloc_from_block;
*gsl_vector_complex_alloc_from_vector = *Math::GSL::Vectorc::gsl_vector_complex_alloc_from_vector;
*gsl_vector_complex_free = *Math::GSL::Vectorc::gsl_vector_complex_free;
*gsl_vector_complex_view_array = *Math::GSL::Vectorc::gsl_vector_complex_view_array;
*gsl_vector_complex_view_array_with_stride = *Math::GSL::Vectorc::gsl_vector_complex_view_array_with_stride;
*gsl_vector_complex_const_view_array = *Math::GSL::Vectorc::gsl_vector_complex_const_view_array;
*gsl_vector_complex_const_view_array_with_stride = *Math::GSL::Vectorc::gsl_vector_complex_const_view_array_with_stride;
*gsl_vector_complex_subvector = *Math::GSL::Vectorc::gsl_vector_complex_subvector;
*gsl_vector_complex_subvector_with_stride = *Math::GSL::Vectorc::gsl_vector_complex_subvector_with_stride;
*gsl_vector_complex_const_subvector = *Math::GSL::Vectorc::gsl_vector_complex_const_subvector;
*gsl_vector_complex_const_subvector_with_stride = *Math::GSL::Vectorc::gsl_vector_complex_const_subvector_with_stride;
*gsl_vector_complex_real = *Math::GSL::Vectorc::gsl_vector_complex_real;
*gsl_vector_complex_imag = *Math::GSL::Vectorc::gsl_vector_complex_imag;
*gsl_vector_complex_const_real = *Math::GSL::Vectorc::gsl_vector_complex_const_real;
*gsl_vector_complex_const_imag = *Math::GSL::Vectorc::gsl_vector_complex_const_imag;
*gsl_vector_complex_set_zero = *Math::GSL::Vectorc::gsl_vector_complex_set_zero;
*gsl_vector_complex_set_all = *Math::GSL::Vectorc::gsl_vector_complex_set_all;
*gsl_vector_complex_set_basis = *Math::GSL::Vectorc::gsl_vector_complex_set_basis;
*gsl_vector_complex_fread = *Math::GSL::Vectorc::gsl_vector_complex_fread;
*gsl_vector_complex_fwrite = *Math::GSL::Vectorc::gsl_vector_complex_fwrite;
*gsl_vector_complex_fscanf = *Math::GSL::Vectorc::gsl_vector_complex_fscanf;
*gsl_vector_complex_fprintf = *Math::GSL::Vectorc::gsl_vector_complex_fprintf;
*gsl_vector_complex_memcpy = *Math::GSL::Vectorc::gsl_vector_complex_memcpy;
*gsl_vector_complex_reverse = *Math::GSL::Vectorc::gsl_vector_complex_reverse;
*gsl_vector_complex_swap = *Math::GSL::Vectorc::gsl_vector_complex_swap;
*gsl_vector_complex_swap_elements = *Math::GSL::Vectorc::gsl_vector_complex_swap_elements;
*gsl_vector_complex_equal = *Math::GSL::Vectorc::gsl_vector_complex_equal;
*gsl_vector_complex_isnull = *Math::GSL::Vectorc::gsl_vector_complex_isnull;
*gsl_vector_complex_ispos = *Math::GSL::Vectorc::gsl_vector_complex_ispos;
*gsl_vector_complex_isneg = *Math::GSL::Vectorc::gsl_vector_complex_isneg;
*gsl_vector_complex_isnonneg = *Math::GSL::Vectorc::gsl_vector_complex_isnonneg;
*gsl_vector_complex_add = *Math::GSL::Vectorc::gsl_vector_complex_add;
*gsl_vector_complex_sub = *Math::GSL::Vectorc::gsl_vector_complex_sub;
*gsl_vector_complex_mul = *Math::GSL::Vectorc::gsl_vector_complex_mul;
*gsl_vector_complex_div = *Math::GSL::Vectorc::gsl_vector_complex_div;
*gsl_vector_complex_scale = *Math::GSL::Vectorc::gsl_vector_complex_scale;
*gsl_vector_complex_add_constant = *Math::GSL::Vectorc::gsl_vector_complex_add_constant;
*gsl_vector_complex_get = *Math::GSL::Vectorc::gsl_vector_complex_get;
*gsl_vector_complex_set = *Math::GSL::Vectorc::gsl_vector_complex_set;
*gsl_vector_complex_ptr = *Math::GSL::Vectorc::gsl_vector_complex_ptr;
*gsl_vector_complex_const_ptr = *Math::GSL::Vectorc::gsl_vector_complex_const_ptr;
*gsl_vector_alloc = *Math::GSL::Vectorc::gsl_vector_alloc;
*gsl_vector_calloc = *Math::GSL::Vectorc::gsl_vector_calloc;
*gsl_vector_alloc_from_block = *Math::GSL::Vectorc::gsl_vector_alloc_from_block;
*gsl_vector_alloc_from_vector = *Math::GSL::Vectorc::gsl_vector_alloc_from_vector;
*gsl_vector_free = *Math::GSL::Vectorc::gsl_vector_free;
*gsl_vector_view_array = *Math::GSL::Vectorc::gsl_vector_view_array;
*gsl_vector_view_array_with_stride = *Math::GSL::Vectorc::gsl_vector_view_array_with_stride;
*gsl_vector_const_view_array = *Math::GSL::Vectorc::gsl_vector_const_view_array;
*gsl_vector_const_view_array_with_stride = *Math::GSL::Vectorc::gsl_vector_const_view_array_with_stride;
*gsl_vector_subvector = *Math::GSL::Vectorc::gsl_vector_subvector;
*gsl_vector_subvector_with_stride = *Math::GSL::Vectorc::gsl_vector_subvector_with_stride;
*gsl_vector_const_subvector = *Math::GSL::Vectorc::gsl_vector_const_subvector;
*gsl_vector_const_subvector_with_stride = *Math::GSL::Vectorc::gsl_vector_const_subvector_with_stride;
*gsl_vector_set_zero = *Math::GSL::Vectorc::gsl_vector_set_zero;
*gsl_vector_set_all = *Math::GSL::Vectorc::gsl_vector_set_all;
*gsl_vector_set_basis = *Math::GSL::Vectorc::gsl_vector_set_basis;
*gsl_vector_fread = *Math::GSL::Vectorc::gsl_vector_fread;
*gsl_vector_fwrite = *Math::GSL::Vectorc::gsl_vector_fwrite;
*gsl_vector_fscanf = *Math::GSL::Vectorc::gsl_vector_fscanf;
*gsl_vector_fprintf = *Math::GSL::Vectorc::gsl_vector_fprintf;
*gsl_vector_memcpy = *Math::GSL::Vectorc::gsl_vector_memcpy;
*gsl_vector_reverse = *Math::GSL::Vectorc::gsl_vector_reverse;
*gsl_vector_swap = *Math::GSL::Vectorc::gsl_vector_swap;
*gsl_vector_swap_elements = *Math::GSL::Vectorc::gsl_vector_swap_elements;
*gsl_vector_max = *Math::GSL::Vectorc::gsl_vector_max;
*gsl_vector_min = *Math::GSL::Vectorc::gsl_vector_min;
*gsl_vector_minmax = *Math::GSL::Vectorc::gsl_vector_minmax;
*gsl_vector_max_index = *Math::GSL::Vectorc::gsl_vector_max_index;
*gsl_vector_min_index = *Math::GSL::Vectorc::gsl_vector_min_index;
*gsl_vector_minmax_index = *Math::GSL::Vectorc::gsl_vector_minmax_index;
*gsl_vector_add = *Math::GSL::Vectorc::gsl_vector_add;
*gsl_vector_sub = *Math::GSL::Vectorc::gsl_vector_sub;
*gsl_vector_mul = *Math::GSL::Vectorc::gsl_vector_mul;
*gsl_vector_div = *Math::GSL::Vectorc::gsl_vector_div;
*gsl_vector_scale = *Math::GSL::Vectorc::gsl_vector_scale;
*gsl_vector_add_constant = *Math::GSL::Vectorc::gsl_vector_add_constant;
*gsl_vector_equal = *Math::GSL::Vectorc::gsl_vector_equal;
*gsl_vector_isnull = *Math::GSL::Vectorc::gsl_vector_isnull;
*gsl_vector_ispos = *Math::GSL::Vectorc::gsl_vector_ispos;
*gsl_vector_isneg = *Math::GSL::Vectorc::gsl_vector_isneg;
*gsl_vector_isnonneg = *Math::GSL::Vectorc::gsl_vector_isnonneg;
*gsl_vector_get = *Math::GSL::Vectorc::gsl_vector_get;
*gsl_vector_set = *Math::GSL::Vectorc::gsl_vector_set;
*gsl_vector_ptr = *Math::GSL::Vectorc::gsl_vector_ptr;
*gsl_vector_const_ptr = *Math::GSL::Vectorc::gsl_vector_const_ptr;
*gsl_vector_int_alloc = *Math::GSL::Vectorc::gsl_vector_int_alloc;
*gsl_vector_int_calloc = *Math::GSL::Vectorc::gsl_vector_int_calloc;
*gsl_vector_int_alloc_from_block = *Math::GSL::Vectorc::gsl_vector_int_alloc_from_block;
*gsl_vector_int_alloc_from_vector = *Math::GSL::Vectorc::gsl_vector_int_alloc_from_vector;
*gsl_vector_int_free = *Math::GSL::Vectorc::gsl_vector_int_free;
*gsl_vector_int_view_array = *Math::GSL::Vectorc::gsl_vector_int_view_array;
*gsl_vector_int_view_array_with_stride = *Math::GSL::Vectorc::gsl_vector_int_view_array_with_stride;
*gsl_vector_int_const_view_array = *Math::GSL::Vectorc::gsl_vector_int_const_view_array;
*gsl_vector_int_const_view_array_with_stride = *Math::GSL::Vectorc::gsl_vector_int_const_view_array_with_stride;
*gsl_vector_int_subvector = *Math::GSL::Vectorc::gsl_vector_int_subvector;
*gsl_vector_int_subvector_with_stride = *Math::GSL::Vectorc::gsl_vector_int_subvector_with_stride;
*gsl_vector_int_const_subvector = *Math::GSL::Vectorc::gsl_vector_int_const_subvector;
*gsl_vector_int_const_subvector_with_stride = *Math::GSL::Vectorc::gsl_vector_int_const_subvector_with_stride;
*gsl_vector_int_set_zero = *Math::GSL::Vectorc::gsl_vector_int_set_zero;
*gsl_vector_int_set_all = *Math::GSL::Vectorc::gsl_vector_int_set_all;
*gsl_vector_int_set_basis = *Math::GSL::Vectorc::gsl_vector_int_set_basis;
*gsl_vector_int_fread = *Math::GSL::Vectorc::gsl_vector_int_fread;
*gsl_vector_int_fwrite = *Math::GSL::Vectorc::gsl_vector_int_fwrite;
*gsl_vector_int_fscanf = *Math::GSL::Vectorc::gsl_vector_int_fscanf;
*gsl_vector_int_fprintf = *Math::GSL::Vectorc::gsl_vector_int_fprintf;
*gsl_vector_int_memcpy = *Math::GSL::Vectorc::gsl_vector_int_memcpy;
*gsl_vector_int_reverse = *Math::GSL::Vectorc::gsl_vector_int_reverse;
*gsl_vector_int_swap = *Math::GSL::Vectorc::gsl_vector_int_swap;
*gsl_vector_int_swap_elements = *Math::GSL::Vectorc::gsl_vector_int_swap_elements;
*gsl_vector_int_max = *Math::GSL::Vectorc::gsl_vector_int_max;
*gsl_vector_int_min = *Math::GSL::Vectorc::gsl_vector_int_min;
*gsl_vector_int_minmax = *Math::GSL::Vectorc::gsl_vector_int_minmax;
*gsl_vector_int_max_index = *Math::GSL::Vectorc::gsl_vector_int_max_index;
*gsl_vector_int_min_index = *Math::GSL::Vectorc::gsl_vector_int_min_index;
*gsl_vector_int_minmax_index = *Math::GSL::Vectorc::gsl_vector_int_minmax_index;
*gsl_vector_int_add = *Math::GSL::Vectorc::gsl_vector_int_add;
*gsl_vector_int_sub = *Math::GSL::Vectorc::gsl_vector_int_sub;
*gsl_vector_int_mul = *Math::GSL::Vectorc::gsl_vector_int_mul;
*gsl_vector_int_div = *Math::GSL::Vectorc::gsl_vector_int_div;
*gsl_vector_int_scale = *Math::GSL::Vectorc::gsl_vector_int_scale;
*gsl_vector_int_add_constant = *Math::GSL::Vectorc::gsl_vector_int_add_constant;
*gsl_vector_int_equal = *Math::GSL::Vectorc::gsl_vector_int_equal;
*gsl_vector_int_isnull = *Math::GSL::Vectorc::gsl_vector_int_isnull;
*gsl_vector_int_ispos = *Math::GSL::Vectorc::gsl_vector_int_ispos;
*gsl_vector_int_isneg = *Math::GSL::Vectorc::gsl_vector_int_isneg;
*gsl_vector_int_isnonneg = *Math::GSL::Vectorc::gsl_vector_int_isnonneg;
*gsl_vector_int_get = *Math::GSL::Vectorc::gsl_vector_int_get;
*gsl_vector_int_set = *Math::GSL::Vectorc::gsl_vector_int_set;
*gsl_vector_int_ptr = *Math::GSL::Vectorc::gsl_vector_int_ptr;
*gsl_vector_int_const_ptr = *Math::GSL::Vectorc::gsl_vector_int_const_ptr;
############# Class : Math::GSL::Vector::gsl_vector_char ##############
package Math::GSL::Vector::gsl_vector_char;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_size_get = *Math::GSL::Vectorc::gsl_vector_char_size_get;
*swig_size_set = *Math::GSL::Vectorc::gsl_vector_char_size_set;
*swig_stride_get = *Math::GSL::Vectorc::gsl_vector_char_stride_get;
*swig_stride_set = *Math::GSL::Vectorc::gsl_vector_char_stride_set;
*swig_data_get = *Math::GSL::Vectorc::gsl_vector_char_data_get;
*swig_data_set = *Math::GSL::Vectorc::gsl_vector_char_data_set;
*swig_block_get = *Math::GSL::Vectorc::gsl_vector_char_block_get;
*swig_block_set = *Math::GSL::Vectorc::gsl_vector_char_block_set;
*swig_owner_get = *Math::GSL::Vectorc::gsl_vector_char_owner_get;
*swig_owner_set = *Math::GSL::Vectorc::gsl_vector_char_owner_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new_gsl_vector_char(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete_gsl_vector_char($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::_gsl_vector_char_view ##############
package Math::GSL::Vector::_gsl_vector_char_view;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_vector_get = *Math::GSL::Vectorc::_gsl_vector_char_view_vector_get;
*swig_vector_set = *Math::GSL::Vectorc::_gsl_vector_char_view_vector_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new__gsl_vector_char_view(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete__gsl_vector_char_view($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::_gsl_vector_char_const_view ##############
package Math::GSL::Vector::_gsl_vector_char_const_view;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_vector_get = *Math::GSL::Vectorc::_gsl_vector_char_const_view_vector_get;
*swig_vector_set = *Math::GSL::Vectorc::_gsl_vector_char_const_view_vector_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new__gsl_vector_char_const_view(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete__gsl_vector_char_const_view($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::gsl_vector_complex ##############
package Math::GSL::Vector::gsl_vector_complex;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_size_get = *Math::GSL::Vectorc::gsl_vector_complex_size_get;
*swig_size_set = *Math::GSL::Vectorc::gsl_vector_complex_size_set;
*swig_stride_get = *Math::GSL::Vectorc::gsl_vector_complex_stride_get;
*swig_stride_set = *Math::GSL::Vectorc::gsl_vector_complex_stride_set;
*swig_data_get = *Math::GSL::Vectorc::gsl_vector_complex_data_get;
*swig_data_set = *Math::GSL::Vectorc::gsl_vector_complex_data_set;
*swig_block_get = *Math::GSL::Vectorc::gsl_vector_complex_block_get;
*swig_block_set = *Math::GSL::Vectorc::gsl_vector_complex_block_set;
*swig_owner_get = *Math::GSL::Vectorc::gsl_vector_complex_owner_get;
*swig_owner_set = *Math::GSL::Vectorc::gsl_vector_complex_owner_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new_gsl_vector_complex(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete_gsl_vector_complex($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::_gsl_vector_complex_view ##############
package Math::GSL::Vector::_gsl_vector_complex_view;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_vector_get = *Math::GSL::Vectorc::_gsl_vector_complex_view_vector_get;
*swig_vector_set = *Math::GSL::Vectorc::_gsl_vector_complex_view_vector_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new__gsl_vector_complex_view(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete__gsl_vector_complex_view($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::_gsl_vector_complex_const_view ##############
package Math::GSL::Vector::_gsl_vector_complex_const_view;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_vector_get = *Math::GSL::Vectorc::_gsl_vector_complex_const_view_vector_get;
*swig_vector_set = *Math::GSL::Vectorc::_gsl_vector_complex_const_view_vector_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new__gsl_vector_complex_const_view(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete__gsl_vector_complex_const_view($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::gsl_vector ##############
package Math::GSL::Vector::gsl_vector;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_size_get = *Math::GSL::Vectorc::gsl_vector_size_get;
*swig_size_set = *Math::GSL::Vectorc::gsl_vector_size_set;
*swig_stride_get = *Math::GSL::Vectorc::gsl_vector_stride_get;
*swig_stride_set = *Math::GSL::Vectorc::gsl_vector_stride_set;
*swig_data_get = *Math::GSL::Vectorc::gsl_vector_data_get;
*swig_data_set = *Math::GSL::Vectorc::gsl_vector_data_set;
*swig_block_get = *Math::GSL::Vectorc::gsl_vector_block_get;
*swig_block_set = *Math::GSL::Vectorc::gsl_vector_block_set;
*swig_owner_get = *Math::GSL::Vectorc::gsl_vector_owner_get;
*swig_owner_set = *Math::GSL::Vectorc::gsl_vector_owner_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new_gsl_vector(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete_gsl_vector($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::_gsl_vector_view ##############
package Math::GSL::Vector::_gsl_vector_view;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_vector_get = *Math::GSL::Vectorc::_gsl_vector_view_vector_get;
*swig_vector_set = *Math::GSL::Vectorc::_gsl_vector_view_vector_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new__gsl_vector_view(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete__gsl_vector_view($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::_gsl_vector_const_view ##############
package Math::GSL::Vector::_gsl_vector_const_view;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_vector_get = *Math::GSL::Vectorc::_gsl_vector_const_view_vector_get;
*swig_vector_set = *Math::GSL::Vectorc::_gsl_vector_const_view_vector_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new__gsl_vector_const_view(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete__gsl_vector_const_view($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::gsl_vector_int ##############
package Math::GSL::Vector::gsl_vector_int;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_size_get = *Math::GSL::Vectorc::gsl_vector_int_size_get;
*swig_size_set = *Math::GSL::Vectorc::gsl_vector_int_size_set;
*swig_stride_get = *Math::GSL::Vectorc::gsl_vector_int_stride_get;
*swig_stride_set = *Math::GSL::Vectorc::gsl_vector_int_stride_set;
*swig_data_get = *Math::GSL::Vectorc::gsl_vector_int_data_get;
*swig_data_set = *Math::GSL::Vectorc::gsl_vector_int_data_set;
*swig_block_get = *Math::GSL::Vectorc::gsl_vector_int_block_get;
*swig_block_set = *Math::GSL::Vectorc::gsl_vector_int_block_set;
*swig_owner_get = *Math::GSL::Vectorc::gsl_vector_int_owner_get;
*swig_owner_set = *Math::GSL::Vectorc::gsl_vector_int_owner_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new_gsl_vector_int(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete_gsl_vector_int($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::_gsl_vector_int_view ##############
package Math::GSL::Vector::_gsl_vector_int_view;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_vector_get = *Math::GSL::Vectorc::_gsl_vector_int_view_vector_get;
*swig_vector_set = *Math::GSL::Vectorc::_gsl_vector_int_view_vector_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new__gsl_vector_int_view(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete__gsl_vector_int_view($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : Math::GSL::Vector::_gsl_vector_int_const_view ##############
package Math::GSL::Vector::_gsl_vector_int_const_view;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( Math::GSL::Vector );
%OWNER = ();
%ITERATORS = ();
*swig_vector_get = *Math::GSL::Vectorc::_gsl_vector_int_const_view_vector_get;
*swig_vector_set = *Math::GSL::Vectorc::_gsl_vector_int_const_view_vector_set;
sub new {
my $pkg = shift;
my $self = Math::GSL::Vectorc::new__gsl_vector_int_const_view(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
Math::GSL::Vectorc::delete__gsl_vector_int_const_view($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
# ------- VARIABLE STUBS --------
package Math::GSL::Vector;
*GSL_VERSION = *Math::GSL::Vectorc::GSL_VERSION;
*GSL_MAJOR_VERSION = *Math::GSL::Vectorc::GSL_MAJOR_VERSION;
*GSL_MINOR_VERSION = *Math::GSL::Vectorc::GSL_MINOR_VERSION;
*GSL_POSZERO = *Math::GSL::Vectorc::GSL_POSZERO;
*GSL_NEGZERO = *Math::GSL::Vectorc::GSL_NEGZERO;
*GSL_SUCCESS = *Math::GSL::Vectorc::GSL_SUCCESS;
*GSL_FAILURE = *Math::GSL::Vectorc::GSL_FAILURE;
*GSL_CONTINUE = *Math::GSL::Vectorc::GSL_CONTINUE;
*GSL_EDOM = *Math::GSL::Vectorc::GSL_EDOM;
*GSL_ERANGE = *Math::GSL::Vectorc::GSL_ERANGE;
*GSL_EFAULT = *Math::GSL::Vectorc::GSL_EFAULT;
*GSL_EINVAL = *Math::GSL::Vectorc::GSL_EINVAL;
*GSL_EFAILED = *Math::GSL::Vectorc::GSL_EFAILED;
*GSL_EFACTOR = *Math::GSL::Vectorc::GSL_EFACTOR;
*GSL_ESANITY = *Math::GSL::Vectorc::GSL_ESANITY;
*GSL_ENOMEM = *Math::GSL::Vectorc::GSL_ENOMEM;
*GSL_EBADFUNC = *Math::GSL::Vectorc::GSL_EBADFUNC;
*GSL_ERUNAWAY = *Math::GSL::Vectorc::GSL_ERUNAWAY;
*GSL_EMAXITER = *Math::GSL::Vectorc::GSL_EMAXITER;
*GSL_EZERODIV = *Math::GSL::Vectorc::GSL_EZERODIV;
*GSL_EBADTOL = *Math::GSL::Vectorc::GSL_EBADTOL;
*GSL_ETOL = *Math::GSL::Vectorc::GSL_ETOL;
*GSL_EUNDRFLW = *Math::GSL::Vectorc::GSL_EUNDRFLW;
*GSL_EOVRFLW = *Math::GSL::Vectorc::GSL_EOVRFLW;
*GSL_ELOSS = *Math::GSL::Vectorc::GSL_ELOSS;
*GSL_EROUND = *Math::GSL::Vectorc::GSL_EROUND;
*GSL_EBADLEN = *Math::GSL::Vectorc::GSL_EBADLEN;
*GSL_ENOTSQR = *Math::GSL::Vectorc::GSL_ENOTSQR;
*GSL_ESING = *Math::GSL::Vectorc::GSL_ESING;
*GSL_EDIVERGE = *Math::GSL::Vectorc::GSL_EDIVERGE;
*GSL_EUNSUP = *Math::GSL::Vectorc::GSL_EUNSUP;
*GSL_EUNIMPL = *Math::GSL::Vectorc::GSL_EUNIMPL;
*GSL_ECACHE = *Math::GSL::Vectorc::GSL_ECACHE;
*GSL_ETABLE = *Math::GSL::Vectorc::GSL_ETABLE;
*GSL_ENOPROG = *Math::GSL::Vectorc::GSL_ENOPROG;
*GSL_ENOPROGJ = *Math::GSL::Vectorc::GSL_ENOPROGJ;
*GSL_ETOLF = *Math::GSL::Vectorc::GSL_ETOLF;
*GSL_ETOLX = *Math::GSL::Vectorc::GSL_ETOLX;
*GSL_ETOLG = *Math::GSL::Vectorc::GSL_ETOLG;
*GSL_EOF = *Math::GSL::Vectorc::GSL_EOF;
use Scalar::Util 'blessed';
use Data::Dumper;
use Carp qw/croak/;
use Math::GSL::Errno qw/$GSL_SUCCESS gsl_strerror/;
use Math::GSL::BLAS qw/gsl_blas_ddot/;
use Math::GSL::Test qw/is_similar/;
use overload
'*' => \&_multiplication,
'+' => \&_addition,
'-' => \&_subtract,
'abs' => \&_abs,
'==' => \&_equal,
'!=' => \&_not_equal,
fallback => 1,
;
@EXPORT_all = qw/fopen fclose
gsl_vector_alloc gsl_vector_calloc gsl_vector_alloc_from_block gsl_vector_alloc_from_vector
gsl_vector_free gsl_vector_view_array gsl_vector_const_view_array gsl_vector_view_array_with_stride
gsl_vector_const_view_array_with_stride gsl_vector_subvector gsl_vector_subvector_wi gsl_vector_subvector_with_stride
gsl_vector_const_subvector gsl_vector_const_subvec gsl_vector_get gsl_vector_set
gsl_vector_ptr gsl_vector_const_ptr gsl_vector_set_zero gsl_vector_set_all
gsl_vector_set_basis gsl_vector_fread gsl_vector_fwrite gsl_vector_fscanf
gsl_vector_fprintf gsl_vector_memcpy gsl_vector_reverse gsl_vector_swap
gsl_vector_swap_elements gsl_vector_max gsl_vector_min gsl_vector_minmax
gsl_vector_max_index gsl_vector_min_index gsl_vector_minmax_index
gsl_vector_add gsl_vector_sub gsl_vector_mul gsl_vector_div
gsl_vector_scale gsl_vector_add_constant gsl_vector_isnull
gsl_vector_ispos gsl_vector_isneg gsl_vector_isnonneg
gsl_vector_float_alloc gsl_vector_float_calloc gsl_vector_float_alloc_from_block
gsl_vector_float_alloc_from_vector gsl_vector_float_free gsl_vector_float_view_array
gsl_vector_float_view_array_with_stride gsl_vector_float_const_view_array gsl_vector_float_const_view_array_with_stride
gsl_vector_float_subvector gsl_vector_float_subvector_with_stride gsl_vector_float_const_subvector
gsl_vector_float_const_subvector_with_stride gsl_vector_float_get gsl_vector_float_set gsl_vector_float_ptr
gsl_vector_float_const_ptr gsl_vector_float_set_zero gsl_vector_float_set_all gsl_vector_float_set_basis
gsl_vector_float_fread gsl_vector_float_fwrite gsl_vector_float_fscanf gsl_vector_float_fprintf
gsl_vector_float_memcpy gsl_vector_float_reverse gsl_vector_float_swap gsl_vector_float_swap_elements
gsl_vector_float_max gsl_vector_float_min gsl_vector_float_minmax gsl_vector_float_max_index gsl_vector_float_min_index
gsl_vector_float_minmax_index gsl_vector_float_add gsl_vector_float_sub gsl_vector_float_mul gsl_vector_float_div gsl_vector_float_scale
gsl_vector_float_add_constant gsl_vector_float_isnull gsl_vector_float_ispos gsl_vector_float_isneg gsl_vector_float_isnonneg
/;
@EXPORT_file =qw/ fopen fclose/;
@EXPORT_OK = (@EXPORT_all, @EXPORT_file);
%EXPORT_TAGS = ( file => \@EXPORT_file, all => \@EXPORT_all );
=encoding utf8
=head1 NAME
Math::GSL::Vector - Functions concerning vectors
=head1 SYNOPSIS
use Math::GSL::Vector qw/:all/;
my $vec1 = Math::GSL::Vector->new([1, 7, 94, 15 ]);
my $vec2 = $vec1 * 5;
my $vec3 = Math::GSL::Vector>new(10); # 10 element zero vector
my $vec4 = $vec1 + $vec2;
# set the element at index 1 to 9
# and the element at index 3 to 8
$vec3->set([ 1, 3 ], [ 9, 8 ]);
my @vec = $vec2->as_list; # return elements as Perl list
my $dot_product = $vec1 * $vec2;
my $length = $vec2->length;
my $first = $vec1->get(0);
# access raw GSL object to call low-level functions
my $raw = $vec1->raw;
my $element = gsl_vector_get($raw, 2);
=cut
=head1 Objected Oriented Interface to GSL Math::GSL::Vector
=head2 Math::GSL::Vector->new()
Creates a new Vector of the given size.
my $vector = Math::GSL::Vector->new(3);
You can also create and set directly the values of the vector like this :
my $vector = Math::GSL::Vector->new([2,4,1]);
=cut
sub new {
my ($class, $values) = @_;
my $length = $#$values;
my $this = {};
my $vector;
if ( ref $values eq 'ARRAY' ){
die __PACKAGE__.'::new($x) - $x must be a nonempty array reference' if $length == -1;
$vector = gsl_vector_alloc($length+1);
map { gsl_vector_set($vector, $_, $values->[$_] ) } (0 .. $length);
$this->{_length} = $length+1;
} elsif ( (int($values) == $values) && ($values > 0)) {
$vector = gsl_vector_alloc($values);
gsl_vector_set_zero($vector);
$this->{_length} = $values;
} else {
die __PACKAGE__.'::new($x) - $x must be an int or array reference';
}
$this->{_vector} = $vector;
bless $this, $class;
}
=head2 raw()
Get the underlying GSL vector object created by SWIG, useful for using gsl_vector_* functions which do not have an OO counterpart.
my $vector = Math::GSL::Vector->new(3);
my $gsl_vector = $vector->raw;
my $stuff = gsl_vector_get($gsl_vector, 1);
=cut
sub raw {
my $self = shift;
return $self->{_vector};
}
=head2 swap()
Exchanges the values in the vectors $v with $w by copying.
my $v = Math::GSL::Vector->new([1..5]);
my $w = Math::GSL::Vector->new([3..7]);
$v->swap( $w );
=cut
sub swap() {
my ($self,$other) = @_;
croak "Math::GSL::Vector: \$v->swap(\$w) : \$w must be a Math::GSL::Vector"
unless ref $other eq 'Math::GSL::Vector';
gsl_vector_swap( $self->raw, $other->raw );
return $self;
}
=head2 reverse()
Reverse the elements in the vector.
$v->reverse;
=cut
sub reverse() {
my $self = shift;
gsl_vector_reverse($self->raw);
return $self;
}
=head2 min()
Returns the minimum value contained in the vector.
my $vector = Math::GSL::Vector->new([2,4,1]);
my $minimum = $vector->min;
=cut
sub min {
my $self=shift;
return gsl_vector_min($self->raw);
}
=head2 max()
Returns the minimum value contained in the vector.
my $vector = Math::GSL::Vector->new([2,4,1]);
my $maximum = $vector->max;
=cut
sub max {
my $self=shift;
return gsl_vector_max($self->raw);
}
=head2 length()
Returns the number of elements contained in the vector.
my $vector = Math::GSL::Vector->new([2,4,1]);
my $length = $vector->length;
=cut
sub length { my $self=shift; $self->{_length} }
=head2 $v->norm($p)
Returns the p-norm of $v, which defaults to the Euclidean (p=2) norm when no argument is given.
my $euclidean_distance = $v->norm;
=cut
sub norm($;$)
{
my ($self,$p) = @_;
my $norm = 0;
$p ||= 2;
map { $norm += $p == 1 ? abs $_ : $_ ** $p } ($self->as_list);
return $norm ** (1 / $p);
}
=head2 normalize($p)
Divide each element of a vector by its norm, hence creating a unit vector.
Returns the vector for chaining. If you just want the value of the norm
without changing the vector, use C<norm()>. The default value for C<$p> is 2,
which gives the familiar Euclidean distance norm.
my $unit_vector = $vector->normalize(2);
is the same as
my $unit_vector = $vector->normalize;
=cut
sub normalize($;$)
{
my ($self,$p) = @_;
$p ||= 2;
my $norm = $self->norm($p);
return $self if ($norm == 0);
my $status = gsl_vector_scale( $self->raw, 1/$norm );
croak "Math::GSL::Vector - could not scale vectr" unless $status == $GSL_SUCCESS;
return $self;
}
=head2 as_list()
Gets the content of a Math::GSL::Vector object as a Perl list.
my $vector = Math::GSL::Vector->new(3);
...
my @values = $vector->as_list;
=cut
sub as_list {
my $self=shift;
$self->get( [ 0 .. $self->length - 1 ] );
}
=head2 get()
Gets the value of an of a Math::GSL::Vector object.
my $vector = Math::GSL::Vector->new(3);
...
my @values = $vector->get(2);
You can also enter an array of indices to receive their corresponding values:
my $vector = Math::GSL::Vector->new(3);
...
my @values = $vector->get([0,2]);
=cut
sub get {
my ($self, $indices) = @_;
return gsl_vector_get($self->raw, $indices) unless ref $indices;
return map { gsl_vector_get($self->raw, $_ ) } @$indices ;
}
=head2 set()
Sets values of an of a Math::GSL::Vector object.
my $vector = Math::GSL::Vector->new(3);
$vector->set([1,2], [8,23]);
This sets the second and third value to 8 and 23.
=cut
sub set {
my ($self, $indices, $values) = @_;
die (__PACKAGE__.'::set($indices, $values) - $indices and $values must be array references of the same length')
unless ( ref $indices eq 'ARRAY' && ref $values eq 'ARRAY' && $#$indices == $#$values );
eval {
map { gsl_vector_set($self->{_vector}, $indices->[$_], $values->[$_] ) } (0..$#$indices);
};
return;
}
=head2 copy()
Returns a copy of the vector, which has the same length and values but resides at a different location in memory.
my $vector = Math::GSL::Vector->new([10 .. 20]);
my $copy = $vector->copy;
=cut
sub copy {
my $self = shift;
my $copy = Math::GSL::Vector->new( $self->length );
if ( gsl_vector_memcpy($copy->raw, $self->raw) != $GSL_SUCCESS ) {
croak "Math::GSL - error copying memory, aborting";
}
return $copy;
}
sub _multiplication {
my ($left,$right) = @_;
my $lcopy = $left->copy;
if ( blessed $right && $right->isa('Math::GSL::Vector') ) {
return $lcopy->dot_product($right);
} else {
gsl_vector_scale($lcopy->raw, $right);
}
return $lcopy;
}
sub _subtract {
my ($left, $right, $flip) = @_;
if ($flip) {
my $lcopy = $left->copy;
gsl_vector_scale($lcopy->raw, -1 );
gsl_vector_add_constant($lcopy->raw, $right);
return $lcopy;
} else {
return _addition($left, -1.0*$right);
}
}
sub _abs {
my $self = shift;
$self->norm;
}
sub _addition {
my ($left, $right, $flip) = @_;
my $lcopy = $left->copy;
if ( blessed $right && $right->isa('Math::GSL::Vector') && blessed $left && $left->isa('Math::GSL::Vector') ) {
if ( $left->length == $right->length ) {
gsl_vector_add($lcopy->raw, $right->raw);
} else {
croak "Math::GSL - addition of vectors must be called with two objects vectors and must have the same length";
}
} else {
gsl_vector_add_constant($lcopy->raw, $right);
}
return $lcopy;
}
sub dot_product_pp {
my ($left,$right) = @_;
my $sum=0;
if ( blessed $right && $right->isa('Math::GSL::Vector') &&
$left->length == $right->length ) {
my @l = $left->as_list;
my @r = $right->as_list;
map { $sum += $l[$_] * $r[$_] } (0..$#l);
return $sum;
} else {
croak "dot_product() must be called with two vectors";
}
}
sub dot_product {
my ($left,$right) = @_;
my ($status, $product) = gsl_blas_ddot($left->raw,$right->raw);
croak sprintf "Math::GSL::dot_product - %s", gsl_strerror($status) if ($status != $GSL_SUCCESS);
return $product;
}
sub _equal {
my ($left,$right) = @_;
return 0 if ($left->length != $right->length);
return is_similar( [$left->as_list ], [$right->as_list ]);
}
sub _not_equal {
my ($left, $right) = @_;
return !_equal($left,$right);
}
=head1 DESCRIPTION
Here is a list of all the functions included in this module :
=over 1
=item C<gsl_vector_alloc($x)>
Create a vector of size $x
=item C<gsl_vector_calloc($x)>
Create a vector of size $x and initializes all the elements of the vector to zero
=item C<gsl_vector_alloc_from_block>
=item C<gsl_vector_alloc_from_vector>
=item C<gsl_vector_free($v)>
Free a previously allocated vector $v
=item C<gsl_vector_view_array($base, $n)>
This function returns a vector view of an array reference $base. The start of
the new vector is given by $base and has $n elements. Mathematically, the i-th
element of the new vector v' is given by, v'(i) = $base->[i] where the index i
runs from 0 to $n-1. The array containing the elements of v is not owned by the
new vector view. When the view goes out of scope the original array will
continue to exist. The original memory can only be deallocated by freeing the
original pointer base. Of course, the original array should not be deallocated
while the view is still in use.
=item C<gsl_vector_const_view_array($base, $n)>
This function is equivalent to gsl_vector_view_array but can be used for arrays which are declared const.
=item C<gsl_vector_view_array_with_stride($base, $stride, $n)>
This function returns a vector view of an array reference $base with an
additional $stride argument. The subvector is formed in the same way as for
gsl_vector_view_array but the new vector has $n elements with a step-size of
$stride from one element to the next in the original array. Mathematically,
the i-th element of the new vector v' is given by, v'(i) = $base->[i*$stride]
where the index i runs from 0 to $n-1. Note that the view gives direct access
to the underlying elements of the original array. A vector view $view can be
passed to any subroutine which takes a vector argument just as a directly
allocated vector would be, using $view->{vector}.
=item C<gsl_vector_const_view_array_with_stride($base, $stride, $n)>
This function is equivalent to gsl_vector_view_array_with_stride but can be
used for arrays which are declared const.
=item C<gsl_vector_subvector($v, $offset, $n)>
Return a vector_view type which contains a subvector of $v, with a size of $size, starting from the $offset position
=item C<gsl_vector_subvector_with_stride($v, $offset, $stride, $size)>
Return a vector_view type which contains a subvector of $v, with a size of
$size, starting from the $offset position and with a $stride step between each
element of $v
=item C<gsl_vector_const_subvector>
=item C<gsl_vector_get($v, $i)>
Return the $i-th element of a raw vector $v, where $v is a Math::GSL::Vector object. For example:
my $third_element = gsl_vector_get($v->raw, 3);
=item C<gsl_vector_set($v, $i, $x)>
Return the vector $v with his $i-th element set to $x
=item C<gsl_vector_ptr>
=item C<gsl_vector_const_ptr>
=item C<gsl_vector_set_zero($v)>
set all the elements of $v to 0
=item C<gsl_vector_set_all($v, $x)>
set all the elements of $v to $x
=item C<gsl_vector_set_basis($v, $i)>
set all the elements of $v to 0 except for the $i-th element which is set to 1
and return 0 if the operation succeeded, 1 otherwise.
=item C<gsl_vector_fread($file, $v)>
This function reads into the vector $v from the open stream $file opened with
gsl_fopen function from the Math::GSL module in binary format. The vector $v
must be preallocated with the correct length since the function uses the size
of $v to determine how many bytes to read. The return value is 0 for success
and 1 if there was a problem reading from the file.
=item C<gsl_vector_fwrite($file, $v)>
This function writes the elements of the vector $v to the stream $file opened
with gsl_fopen function from the Math::GSL module in binary format. The return
value is 0 for success and 1 if there was a problem writing to the file. Since
the data is written in the native binary format it may not be portable between
different architectures.
=item C<gsl_vector_fscanf($file, $v)>
This function reads formatted data from the stream $file opened with gsl_fopen
function from the Math::GSL module into the vector $v. The vector $v must be
preallocated with the correct length since the function uses the size of $v to
determine how many numbers to read. The function returns 0 for success and 1 if
there was a problem reading from the file.
=item C<gsl_vector_fprintf($file, $v, $format)>
This function writes the elements of the vector $v line-by-line to the stream
$file opened with gsl_fopen function from the Math::GSL module using the format
specifier $format, which should be one of the "%g", "%e" or "%f" formats for
floating point numbers and "%d" for integers. The function returns 0 for
success and 1 if there was a problem writing to the file.
=item C<gsl_vector_memcpy($dest, $src)>
This function copies the elements of the vector $src into the vector $dest and
return 0 if the operation succeeded, 1 otherwise. The two vectors must have the
same length.
=item C<gsl_vector_reverse($v)>
reverse the order of the elements of the vector $v and return 0 if the
operation succeeded, 1 otherwise
=item C<gsl_vector_swap($v, $v2)>
swap the values of the vectors $v and $v2 and return 0 if the operation
succeeded, 1 otherwise
=item C<gsl_vector_swap_elements($v, $i, $j)>
permute the elements at position $i and $j in the vector $v and return 0 if the
operation succeeded, 1 otherwise.
=item C<gsl_vector_max($v)>
return the maximum value in the vector $v
=item C<gsl_vector_min($v)>
return the minimum value in the vector $v
=item C<gsl_vector_minmax($v)>
return two values, the first is the minimum value in the vector $v and the
second is the maximum value.
=item C<gsl_vector_max_index($v)>
return the position of the maximum value in the vector $v
=item C<gsl_vector_min_index($v)>
return the position of the minimum value in the vector $v
=item C<gsl_vector_minmax_index>
return two values, the first is the position of the minimum value in the vector
$v and the second is the position of the maximum value.
=item C<gsl_vector_add($v, $v2)>
add the elements of $v2 to the elements of $v, the two vectors must have the
same length and return 0 if the operation succeeded, 1 otherwise.
=item C<gsl_vector_sub($v, $v2)>
subtract the elements of $v2 from the elements of $v, the two vectors must
have the same length and return 0 if the operation succeeded, 1 otherwise.
=item C<gsl_vector_mul($v, $v2)>
multiply the elements of $v by the elements of $v2, the two vectors must have
the same length and return 0 if the operation succeeded, 1 otherwise.
=item C<gsl_vector_div($v, $v2)>
divides the elements of $v by the elements of $v2, the two vectors must have
the same length and return 0 if the operation succeeded, 1 otherwise.
=item C<gsl_vector_scale($v, $x)>
multiplty the elements of the vector $v by a constant $x and return 0 if the
operation succeeded, 1 otherwise.
=item C<gsl_vector_add_constant($v, $x)>
add a constant $x to the elements of the vector $v and return 0 if the
operation succeeded, 1 otherwise.
=item C<gsl_vector_isnull($v)>
verify if all the elements of the vector $v are null, return 0 if it's the
case, 1 otherwise.
=item C<gsl_vector_ispos($v)>
verify if all the elements of the vector $v are positive, return 0 if it's the
case, 1 otherwise.
=item C<gsl_vector_isneg($v)>
verify if all the elements of the vector $v are negative, return 0 if it's the
case, 1 otherwise.
=item C<gsl_vector_isnonneg($v)>
verify if all the elements the vector $v are not negative, return 0 if it's the
case, 1 otherwise.
=back
Precision on the vector_view type : every modification you'll make on a
vector_view will also modify the original vector. For example, the following
code will zero the even elements of the vector $v of length $size, while
leaving the odd elements untouched :
=over 1
=item C<$v_even= gsl_vector_subvector_with_stride ($v, 0, 2, $size/2);>
=item C<gsl_vector_set_zero ($v_even-E<gt>{vector});>
=back
For more information on the functions, we refer you to the GSL official documentation:
L<http://www.gnu.org/software/gsl/manual/html_node/>
=head1 EXAMPLES
Here is an example using both interfaces.
use Math::GSL::Vector qw/:all/;
print "We'll create this vector : [0,1,4,9,16] \n";
my $vector = Math::GSL::Vector->new([0,1,4,9,16]);
my ($min, $max) = gsl_vector_minmax_index($vector->raw);
print "We then check the index value of the maximum and minimum values of the vector. \n";
print "The index of the maximum should be 4 and we received $max \n";
print "The index of the minimum should be 0 and we received $min \n";
print "We'll then swap the first and the third elements of the vector \n";
gsl_vector_swap_elements($vector->raw, 0, 3);
my @got = $vector->as_list;
print "The vector should now be like this : [9,1,4,0,16] \n";
print "and we received : [ @got ]\n";
=head1 AUTHORS
Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2008-2024 Jonathan "Duke" Leto and Thierry Moisan
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
1;
|