Overview
Comment:-stdin for .cc reps.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 22bdf1e9f562df370a1d3b1a364851f35b9f88c5bd3af4d9cc6061a822692c19
User & Date: geraint@users.sourceforge.net on 2001-04-06 05:24:31
Other Links: branch diff | manifest | tags
Context
2001-04-10
12:54:50
Minor fixes for sensitivity versions check-in: 8eed789a90 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2001-04-06
05:24:31
-stdin for .cc reps. check-in: 22bdf1e9f5 user: geraint@users.sourceforge.net tags: origin/master, trunk
2001-04-05
12:00:18
Identification example check-in: 5ad84ea3e2 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [496bfee36c] to [923294286c].

11
12
13
14
15
16
17




18
19
20
21
22
23
24
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$




## Revision 1.300  2001/04/04 10:06:49  gawthrop
## New ssim (sensitiveity simulation) rep
##
## Revision 1.299  2001/04/03 14:49:42  gawthrop
## Revised to incorporate new ssim (sensitivity simulation)
## representation (m only just now).
##







>
>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.301  2001/04/05 03:46:12  geraint
## Added mtt_prepend.sh, -p preserves time attribute of base file
## - eliminates error in dependencies due to update of ese.r by modpar.r.
##
## Revision 1.300  2001/04/04 10:06:49  gawthrop
## New ssim (sensitiveity simulation) rep
##
## Revision 1.299  2001/04/03 14:49:42  gawthrop
## Revised to incorporate new ssim (sensitivity simulation)
## representation (m only just now).
##
2515
2516
2517
2518
2519
2520
2521


2522
2523
2524
2525
2526
2527
2528

#SUMMARY input	numerical input declaration (m) 
ifeq ($stdin,stdin)
$1_input.m : $1_def.r
	make_stdin $1 m
$1_input.p : $1_def.r
	make_stdin $1 p


else
$1_input.m:  $1_input.txt $1_sympars.txt
	mtt_txt2m $1 input
$1_input.p : $1_def.r $1_input.m
	mtt_m2p $1_input.m
endif








>
>







2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534

#SUMMARY input	numerical input declaration (m) 
ifeq ($stdin,stdin)
$1_input.m : $1_def.r
	make_stdin $1 m
$1_input.p : $1_def.r
	make_stdin $1 p
$1_input.cc:
	make_stdin $1 cc
else
$1_input.m:  $1_input.txt $1_sympars.txt
	mtt_txt2m $1 input
$1_input.p : $1_def.r $1_input.m
	mtt_m2p $1_input.m
endif

Modified mttroot/mtt/bin/trans/make_stdin from [d40985b5b8] to [4dcdc2fa84].

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
endfunction
EOF

}


make_cc() {







cat > $outfile <<EOF









#include "${Sys}_def.h"






























DEFUN_DLD (sidRC_input, args, ,
"Usage: [mttu] = sidRC_input(mttx,mtty,mttt,mttpar)
Octave input representation of system sidRC");


{
  static ColumnVector	u (MTTNU);
  static Matrix mtt_input;
  octave_value_list retval;

  




  mtt_input = octave_value (get_global_value ("MTT_input"));













  retval (0)	= octave_value (mtt_input);
  return (retval);
}





EOF
}

case $lang in
    p)
	make_p
	;;







>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
>
|
|
<
<

>
|
>
>
>
>
|
>
>
>
>
>
|
>
>
>
>
>
>
>
|


>
>
>
>
>







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
endfunction
EOF

}


make_cc() {
## Check octave version
case `$MATRIX --version | awk -F\. '{print $2}'` in
    0) vector_value="vector_value";;       	# stable 
    1) vector_value="column_vector_value";;	# development
    *) vector_value="column_vector_value";;
esac

cat > $outfile <<EOF
// -*-c++-*- Put emacs into c++-mode

// 
// System ${Sys}, representation input, language oct; 
// File $Sys_input.oct; 
// Generated by MTT on Thu Apr  5 21:05:08 EDT 2001; 

#ifdef STANDALONE
#include <octave/oct.h>
#include "${Sys}_def.h"

void strip_comments (istream &str)
{
  char c;
  c = str.peek ();
  while (c == '#')
    {
      str.unsetf(ios::skipws);
      while (c != '\n')
	{
	  str >> c;
	}
      str.setf(ios::skipws);
      c = str.peek ();
    }
}

ColumnVector F${Sys}_input (
	ColumnVector	&mttx,
	ColumnVector	&mtty,
	const double	&mttt,
	ColumnVector	&mttpar
)
{
#endif // STANDALONE
#ifndef STANDALONE
#include <octave/oct.h>
#include <variables.h>
#include "${Sys}_def.h"

DEFUN_DLD (${Sys}_input, args, ,
"Usage: [mttu] = ${Sys}_input()
Octave input (-stdin) representation of system ${Sys}
Generated by MTT on `date`")
{



  octave_value_list retval;
#endif // ! STANDALONE

  ColumnVector	mttu	(MTTNU);

  // Set up the mttu vector
#ifndef STANDALONE
  mttu	= get_global_value ("MTT_input").${vector_value}();
#else
  double t, u;
  strip_comments (cin);
  cin >> t;
  for (register int i = 0; i < MTTNU; i++)
    {      
      cin >> u;
      mttu(i) = u;
    }
#endif


#ifndef STANDALONE
  retval (0)	= octave_value (mttu);
  return (retval);
}
#endif // ! STANDALONE
#ifdef STANDALONE
  return mttu;
}
#endif // STANDALONE
EOF
}

case $lang in
    p)
	make_p
	;;


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