Differences From Artifact [7e5ae6afba]:
- Executable file
mttroot/mtt/cc/mtt_m2cc.sh
— part of check-in
[d9e3b30dc2]
at
2002-05-15 14:22:26
on branch origin/master
— Code for Simulink S-function target written direct to sfun.cc instead of
calling .mexglx files. This eliminates the sfun dependency on Octave
ColumnVectors. sys_sfun.cc should build directly on a MS Windows machine
(can't test this yet).added sfun.zip target to create source code to export. (user: geraint@users.sourceforge.net, size: 5267) [annotate] [blame] [check-ins using] [more...]
To Artifact [71ee6a40d1]:
- Executable file
mttroot/mtt/cc/mtt_m2cc.sh
— part of check-in
[062029b187]
at
2002-05-19 13:01:22
on branch origin/master
— Numerical solution of algebraic equations implemented for S-function target.
Equation solving requires the Matlab Optimization Toolbox to be installed.
Code has been changed from C++ to C to allow mex files to be built with LCC,
the compiler bundled with Matlab.Parameters are now obtained from numpar.c instead of a dialogue box.
`mtt <sys> sfun zip` creates all necessary files for building the model mex files. (user: geraint@users.sourceforge.net, size: 5349) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
96 97 98 99 100 101 102 103 104 | cat ;; esac }; fix_comment_delimiter () { # it would be preferable if we didn't use '%' as a delimiter # (a % b) gives the remainder of ((int)a / (int)b) in C/C++ | > > > > > > | | > | 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 | cat ;; esac }; fix_comment_delimiter () { language=${1:-cc} case $language in # it would be preferable if we didn't use '%' as a delimiter # (a % b) gives the remainder of ((int)a / (int)b) in C/C++ c) sed 's/[%#]\(.*\)/\/* \1 *\//' ;; cc | *) sed 's/[%#]/\/\//g' | sed 's/\/\/\/\//\/\//g' ;; esac }; decrement_indices () { # first section appends '-1' to container indices # to convert from FORTRAN-type numbering to C-type numbering sed 's/mtta(\([0-9][0-9]*\),\([0-9][0-9]*\))/mtta[\1-1,\2-1]/g' |\ |
︙ | ︙ | |||
168 169 170 171 172 173 174 | sed 's/\([0-9]*\)\(\.\)\{0,1\}\([0-9]*\)\^\([0-9]*\)\(\.\)\{0,1\}\([0-9]*\)/pow \(\1\2\3,\4\5\6\)/g' }; echo Creating ${OUT} case ${TARGET} in | < > | < | | | 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 | sed 's/\([0-9]*\)\(\.\)\{0,1\}\([0-9]*\)\^\([0-9]*\)\(\.\)\{0,1\}\([0-9]*\)/pow \(\1\2\3,\4\5\6\)/g' }; echo Creating ${OUT} case ${TARGET} in c) mtt_header ${SYS} ${REP} "c" > ${TMP} find_code ${TMP} head > ${OUT} find_code ${IN} body |\ decrement_indices |\ fix_comment_delimiter c |\ fix_pow |\ strip_junk |\ ${PARSER} >> ${OUT} find_code ${TMP} foot >> ${OUT} rm ${TMP} ;; cc | *) mtt_header ${SYS} ${REP} "oct" > ${TMP} find_code ${TMP} head > ${OUT} rep_declarations >> ${OUT} find_code ${IN} body |\ decrement_indices |\ fortran_to_c_paren |\ fix_comment_delimiter cc |\ fix_pow |\ strip_junk |\ ${PARSER} >> ${OUT} rep_footer >> ${OUT} find_code ${TMP} foot >> ${OUT} rm ${TMP} ;; esac |