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.53 2001/03/21 03:24:59 geraint
## Calculate inputs before outputs (.cc).
##
## Revision 1.52 2001/03/19 02:28:52 geraint
## Branch merge: merging-ode2odes-exe back to MAIN.
##
## Revision 1.51.2.7 2001/03/17 09:51:07 geraint
|
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.54 2001/03/27 01:14:27 geraint
## Improved determination of Octave version.
##
## Revision 1.53 2001/03/21 03:24:59 geraint
## Calculate inputs before outputs (.cc).
##
## Revision 1.52 2001/03/19 02:28:52 geraint
## Branch merge: merging-ode2odes-exe back to MAIN.
##
## Revision 1.51.2.7 2001/03/17 09:51:07 geraint
|
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
make_cc()
{
# get octave version
case `$MATRIX --version | awk -F\. '{print $2}'` in
0) # stable
vector_value=vector_value
feval_header=toplev.h
;;
1) # development
vector_value=column_vector_value
feval_header=parse.h
;;
*)
vector_value=column_vector_value
feval_header=parse.h
;;
esac
cat <<EOF > $filename
#include <octave/oct.h>
#include <octave/ov-struct.h>
#include <octave/load-save.h>
|
>
>
>
|
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
make_cc()
{
# get octave version
case `$MATRIX --version | awk -F\. '{print $2}'` in
0) # stable
vector_value=vector_value
feval_header=toplev.h
save_ascii_data_function=save_ascii_data
;;
1) # development
vector_value=column_vector_value
feval_header=parse.h
save_ascii_data_function=save_ascii_data_for_plotting
;;
*)
vector_value=column_vector_value
feval_header=parse.h
save_ascii_data_function=save_ascii_data_for_plotting
;;
esac
cat <<EOF > $filename
#include <octave/oct.h>
#include <octave/ov-struct.h>
#include <octave/load-save.h>
|
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
|
{
static Matrix data;
static int row;
if (dump_data)
{
Matrix written_data = data.extract (0, 0, row-1, data.cols ()-1);
save_ascii_data_for_plotting (file, written_data, "MTT_data");
return;
}
const int nx = x.length (), ny = y.length ();
register int col = 0;
if (0 == row)
|
|
|
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
|
{
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)
|
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
|
data.elem (row, ++col) = x.elem (i);
row++;
if (nrows == row)
{
#ifdef STANDALONE
save_ascii_data_for_plotting (file, data, "MTT_data");
// cout << data << endl;
#else // ! STANDALONE
set_global_value ("MTT_data", data);
#endif
}
}
|
|
|
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
|
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
}
}
|