Overview
Comment: | Added mex support for ode2odes: mtt sys ode2odes mexglx. This mex stuff seems to require octave2.1-headers. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
20ae5bf7e06cdb4dd9992b3a14170e75 |
User & Date: | geraint@users.sourceforge.net on 2002-05-08 16:03:32 |
Other Links: | branch diff | manifest | tags |
Context
2002-05-08
| ||
21:32:26 | Tidied up $1_ode2odes_*.* targets and renamed dummies as *.stamp. check-in: dc8f84a4a1 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
16:03:32 |
Added mex support for ode2odes: mtt sys ode2odes mexglx. This mex stuff seems to require octave2.1-headers. check-in: 20ae5bf7e0 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
14:51:04 | Moved matlab/octave data type conversion functions to a separate file. check-in: cdb81663cf user: geraint@users.sourceforge.net tags: origin/master, trunk | |
Changes
Modified mttroot/mtt/bin/mtt from [570aa6b93c] to [7e8ccc92a7].
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | + + + | # Copyright (C) 2001 by Peter J. Gawthrop ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ ## Revision 1.337 2002/05/08 14:51:03 geraint ## Moved matlab/octave data type conversion functions to a separate file. ## ## Revision 1.336 2002/05/07 23:50:34 geraint ## Preliminary support for Matlab dynamically linked shared objects: ## invoke with: mtt -cc sys rep mexglx ## ode2odes support is not yet included. ## ## Revision 1.335 2002/05/01 17:30:55 geraint ## Improved pre-processor directives to better accommodate future alternatives (matlab) |
︙ | |||
2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 | 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 | + + + + + + + + | echo Creating $1_ode2odes.o ${MTT_CXX} ${MTT_CXXFLAGS} ${MTT_CXXINCS} -c $1_ode2odes.cc -DCODEGENTARGET=STANDALONE $1_ode2odes.oct: $1_ode2odes.cc $1_ode2odes_common.oct $1_ode2odes_${integration_method}.oct $1_ode2odes_${algebraic_solver}.o touch $1_ode2odes.m echo Creating $1_ode2odes.oct $MKOCTFILE -DCODEGENTARGET=OCTAVEDLD $1_ode2odes.cc mtt_${algebraic_solver}.cc mtt_Solver.cc mtt_AlgebraicSolver.cc $1_ode2odes.mexglx: $1_ode2odes.cc $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o touch $1_ode2odes.m echo Creating $1_ode2odes.mexglx ${MTT_CXX} -DCODEGENTARGET=MATLABMEX -o $1_ode2odes.mexglx $1_ode2odes.cc \ $1_ode2odes_common.o $1_ode2odes_${integration_method}.o $1_ode2odes_${algebraic_solver}.o \ ${MTT_MATLAB_FLAGS} ${MTT_CXXINCS} ${MTT_CXXLIBS} ${MTT_CXXFLAGS} \ ${MTT_LIB}/cc/mtt_kpathsea.cc ${MTT_LIB}/cc/mtt_matlab_octave.cc $1_ode2odes.cc: $1_def.r $1_sympars.txt\ $1_ode2odes_common.m $1_ode2odes_common.cc\ $1_ode2odes_${integration_method}.m $1_ode2odes_${integration_method}.cc\ mtt_Solver.cc mtt_AlgebraicSolver.cc mtt_${algebraic_solver}.cc mtt_${algebraic_solver}.hh touch $1_ode2odes.m make_ode2odes $1 cc $integration_method $algebraic_solver |
︙ |
Modified mttroot/mtt/bin/trans/make_ode2odes from [1c01822bdf] to [e5d0e1820f].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | + + + | #! /bin/sh ###################################### ##### Model Transformation Tools ##### ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.76 2002/05/08 14:14:55 geraint ## Tidied up ode2odes code - reduced interweaving of STANDALONE/OCTAVEDLD sections ## ## Revision 1.75 2002/05/07 13:48:42 geraint ## Improved clarity of code generated for -cc and -oct (except ode2odes). ## Octave DEFUN_DLDs now call (rather than replace) their .cc equivalents. ## ## Revision 1.74 2002/05/01 17:30:56 geraint ## Improved pre-processor directives to better accommodate future alternatives (matlab) ## if necessary. |
︙ | |||
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 | 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 | + - + | esac cat <<EOF > $filename // Code generation directives #define STANDALONE 0 #define OCTAVEDLD 1 #define MATLABMEX 2 #if (! defined (CODEGENTARGET)) #define CODEGENTARGET STANDALONE #endif // (! defined (CODEGENTARGET)) #include <octave/oct.h> #include <octave/lo-mappers.h> #include <octave/variables.h> #if (CODEGENTARGET == OCTAVEDLD) #include <octave/${feval_header}> #endif // (CODEGENTARGET == OCTAVEDLD) #include "${sys}_def.h" #include "${sys}_sympar.h" #include "mtt_${algebraic_solver}.hh" #include <fstream> |
︙ | |||
553 554 555 556 557 558 559 | 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 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | const ColumnVector &open_switches); EOF ;; esac cat <<EOF >> $filename |
︙ | |||
885 886 887 888 889 890 891 | 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 | - + - + - + - + | } else step = t; for (register int i = MTTNX; i < MTTNX+MTTNYZ; i++) residual(i) += X(i) - DX(i)*step; } |
︙ | |||
981 982 983 984 985 986 987 | 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 | - + | #if (CODEGENTARGET == STANDALONE) file << "# name: mtt_dump" << std::endl << "# type: matrix" << std::endl << "# rows: " << data.rows () << std::endl << "# columns: " << data.columns () << std::endl << data; file.flush (); |
︙ | |||
1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | error("aborting."); } ${sys}_ode2odes (state0, numpar, simpar); retval = octave_value (get_global_value ("MTT_data")); return (retval); } #elif (CODEGENTARGET == MATLABMEX) #include <mtt_matlab_octave.hh> extern "C" { void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { static ColumnVector state0 (MTTNX); static ColumnVector numpar (MTTNPAR); static ColumnVector simpar (8); initialize_symbol_tables (); switch (nrhs) { case 3: simpar = mtt_ColumnVector (prhs[2]); numpar = mtt_ColumnVector (prhs[1]); state0 = mtt_ColumnVector (prhs[0]); break; case 2: simpar = mtt_simpar (); numpar = mtt_ColumnVector (prhs[1]); state0 = mtt_ColumnVector (prhs[0]); break; case 1: simpar = mtt_simpar (); numpar = mtt_numpar (); state0 = mtt_ColumnVector (prhs[0]); break; case 0: simpar = mtt_simpar (); numpar = mtt_numpar (); state0 = mtt_state (numpar); break; default: std::cerr << "usage: ${sys}_ode2odes (x par simpar)" << std::endl; return; } ${sys}_ode2odes (state0, numpar, simpar); plhs[0] = mtt_mxArray (get_global_value ("MTT_data").matrix_value ()); } } #endif // (CODEGENTARGET == STANDALONE) EOF } case ${lang} in |
︙ |