Differences From Artifact [78c95b87eb]:

To Artifact [8879414d17]:


1
2
3




4
5
6
7
8
9
10
#! /bin/sh
# $Id$
# $Log$




# Revision 1.1  2000/12/28 09:46:05  peterg
# put under RCS
#
# Revision 1.3  2000/12/05 12:13:52  peterg
# Changed function name to name()
#
# Revision 1.2  2000/12/04 12:04:46  peterg



>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#! /bin/sh
# $Id$
# $Log$
# Revision 1.2  2002/04/28 18:58:06  geraint
# Fixed [ 549658 ] awk should be gawk.
# Replaced calls to awk with call to gawk.
#
# Revision 1.1  2000/12/28 09:46:05  peterg
# put under RCS
#
# Revision 1.3  2000/12/05 12:13:52  peterg
# Changed function name to name()
#
# Revision 1.2  2000/12/04 12:04:46  peterg
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

get_array_size ()
{
vec=$1
gawk -v vec=${vec} '($1 == vec && $2 == "=") { print $3 }' | sed s/\;//
}

 echo "// ${SYS}_def.h, generated by MTT on `date`"			>  ${OUT}
 echo ""								>> ${OUT}
 echo "const int MTTNU   = `cat ${IN} | get_array_size nu`;"		>> ${OUT}
 echo "const int MTTNX   = `cat ${IN} | get_array_size nx`;"		>> ${OUT}
 echo "const int MTTNY   = `cat ${IN} | get_array_size ny`;"		>> ${OUT}
 echo "const int MTTNZ   = `cat ${IN} | get_array_size nz`;"		>> ${OUT}
 echo "const int MTTNYZ  = `cat ${IN} | get_array_size nyz`;"		>> ${OUT}
 echo "const int MTTNPAR = `wc -l ${SYM} | gawk '{ print $1 }'`;"      	>> ${OUT}

cat <<EOF >> ${OUT}

// typedefs won't work because it is illegal to initialise ColumnVector in typedef
// use "ColumnVector mttx (MTTNX);" until the proper classes are ready


#if 0 // NB: These classes are not ready for use yet!
class InputVector : public ColumnVector
{
public:
  InputVector (void) : ColumnVector (MTTNU) { ; }
};
class StateVector : public ColumnVector
{
public:
  StateVector (void) : ColumnVector (MTTNX) { ; }
};
class OutputVector : public ColumnVector
{
public:
  OutputVector (void) : ColumnVector (MTTNY) { ; }
};
class ParameterVector : public ColumnVector
{
public:
  ParameterVector (void) : ColumnVector (MTTNPAR) { ; }
};
class StateMatrix : public Matrix
{
public:
  StateMatrix (void) : Matrix (MTTNX, MTTNX) { ; }
};
#endif

EOF












|








<

<
<


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

44


45
46



































get_array_size ()
{
vec=$1
gawk -v vec=${vec} '($1 == vec && $2 == "=") { print $3 }' | sed s/\;//
}

 echo "/* ${SYS}_def.h, generated by MTT on `date` */"			>  ${OUT}
 echo ""								>> ${OUT}
 echo "const int MTTNU   = `cat ${IN} | get_array_size nu`;"		>> ${OUT}
 echo "const int MTTNX   = `cat ${IN} | get_array_size nx`;"		>> ${OUT}
 echo "const int MTTNY   = `cat ${IN} | get_array_size ny`;"		>> ${OUT}
 echo "const int MTTNZ   = `cat ${IN} | get_array_size nz`;"		>> ${OUT}
 echo "const int MTTNYZ  = `cat ${IN} | get_array_size nyz`;"		>> ${OUT}
 echo "const int MTTNPAR = `wc -l ${SYM} | gawk '{ print $1 }'`;"      	>> ${OUT}










































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