1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.56 2001/03/30 15:13:58 gawthrop
## Rationalised simulation modes to each return mtt_data
##
## Revision 1.55 2001/03/27 13:21:59 geraint
## Octave version compatibility for save_ascii_data(_for_plotting).
##
## Revision 1.54 2001/03/27 01:14:27 geraint
|
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.57 2001/04/01 03:38:54 geraint
## Reset row to zero after write to file, ready for subsequent runs.
## Eliminates SIGSEGV in Octave when _ode2odes called multiple times.
##
## Revision 1.56 2001/03/30 15:13:58 gawthrop
## Rationalised simulation modes to each return mtt_data
##
## Revision 1.55 2001/03/27 13:21:59 geraint
## Octave version compatibility for save_ascii_data(_for_plotting).
##
## Revision 1.54 2001/03/27 01:14:27 geraint
|
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
|
{
static Matrix data;
static int row;
if (dump_data)
{
Matrix written_data = data.extract (0, 0, row-1, data.cols ()-1);
$save_ascii_data_function (file, written_data, "MTT_data");
return;
}
const int nx = x.length (), ny = y.length ();
register int col = 0;
if (0 == row)
|
|
|
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
|
{
static Matrix data;
static int row;
if (dump_data)
{
Matrix written_data = data.extract (0, 0, row-1, data.cols ()-1);
$save_ascii_data_function (file, written_data, "mtt_data");
return;
}
const int nx = x.length (), ny = y.length ();
register int col = 0;
if (0 == row)
|
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
|
data.elem (row, ++col) = x.elem (i);
row++;
if (nrows == row)
{
#ifdef STANDALONE
$save_ascii_data_function (file, data, "MTT_data");
// cout << data << endl;
#else // ! STANDALONE
set_global_value ("MTT_data", data);
#endif
row = 0;
}
}
|
|
|
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
|
data.elem (row, ++col) = x.elem (i);
row++;
if (nrows == row)
{
#ifdef STANDALONE
$save_ascii_data_function (file, data, "mtt_data");
// cout << data << endl;
#else // ! STANDALONE
set_global_value ("MTT_data", data);
#endif
row = 0;
}
}
|