Differences From Artifact [630b2a9dfd]:

To Artifact [83d0d37bdc]:


8
9
10
11
12
13
14



15
16
17
18
19
20
21
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.47  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.46  2002/05/07 13:48:43  geraint
## Improved clarity of code generated for -cc and -oct (except ode2odes).







>
>
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.48  2002/05/08 14:51:03  geraint
## Moved matlab/octave data type conversion functions to a separate file.
##
## Revision 1.47  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.46  2002/05/07 13:48:43  geraint
## Improved clarity of code generated for -cc and -oct (except ode2odes).
320
321
322
323
324
325
326
327


328
329
330
331
332
333
334
        output='mtt_data'
        args='x0,par,simpar'
	;;
    simpar)
	states=no;
	inputs=no;
	parameters=no;
        output='mttsimpar'


	;;
    sm)
	states=no;
	inputs=no;
	parameters=yes;
        output='mtta,mttb,mttc,mttd'
        args=mttpar;







|
>
>







323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
        output='mtt_data'
        args='x0,par,simpar'
	;;
    simpar)
	states=no;
	inputs=no;
	parameters=no;
	output='mttsimpar'
	oct_rep_include="#include <mtt_simpar.hh>"
	oct_return_type="mtt_simpar"
	;;
    sm)
	states=no;
	inputs=no;
	parameters=yes;
        output='mtta,mttb,mttc,mttd'
        args=mttpar;
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

write_oct()
{
    func=${1:-"<insert function name>"}
    args=${2:-""}
    cat <<EOF
#if (CODEGENTARGET == OCTAVEDLD)


DEFUN_DLD (${system}_${rep}, args, ,
"Usage: [$output] = ${system}_${rep}($args)\nOctave ${rep} representation of system ${system}\nGenerated by MTT on `date`")
{
  static octave_value_list retval;

EOF
    map_oct_inputs ${args}
    cat <<EOF

  retval (0) = ${func} (${args});
  return (retval);
}
#endif // (CODEGENTARGET == OCTAVEDLD)

EOF
}

write_mex ()







>
>









|
|







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

write_oct()
{
    func=${1:-"<insert function name>"}
    args=${2:-""}
    cat <<EOF
#if (CODEGENTARGET == OCTAVEDLD)
$oct_rep_include

DEFUN_DLD (${system}_${rep}, args, ,
"Usage: [$output] = ${system}_${rep}($args)\nOctave ${rep} representation of system ${system}\nGenerated by MTT on `date`")
{
  static octave_value_list retval;

EOF
    map_oct_inputs ${args}
    cat <<EOF

  retval (0) = octave_value ($oct_return_type (${func} (${args})));
  return retval;
}
#endif // (CODEGENTARGET == OCTAVEDLD)

EOF
}

write_mex ()

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]