Overview
Comment:Octave version compatibility for save_ascii_data(_for_plotting).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 1f42af64c9d72198523ab76623ed2c773e7c6e6d55d0c4bbf75d479e668ec2a4
User & Date: geraint@users.sourceforge.net on 2001-03-27 13:21:59
Other Links: branch diff | manifest | tags
Context
2001-03-27
13:47:53
First version check-in: 8ccb71060d user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:21:59
Octave version compatibility for save_ascii_data(_for_plotting). check-in: 1f42af64c9 user: geraint@users.sourceforge.net tags: origin/master, trunk
13:10:23
Improved determination of Octave version. check-in: 1d1895315e user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/make_ode2odes from [34aabe5863] to [f5954cc958].

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
    }
}


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