Differences From Artifact [0dc2f50e29]:

To Artifact [7870987d9c]:


1
2
3
4
5
6
7
8
9
10
11





12
13
14
15
16
17
18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23











+
+
+
+
+







#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
    ######################################

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.71  2002/04/30 23:27:00  geraint
## Replaced octave_map with columnvector in simpar.cc. Not quite as descriptive but
## standardises the interfaces somewhat and reduces the dependency on liboctinterp
## (and thus libreadline, libkpathsea, libncurses, etc).
##
## Revision 1.70  2002/04/28 18:41:27  geraint
## Fixed [ 549658 ] awk should be gawk.
## Replaced calls to awk with call to gawk.
##
## Revision 1.69  2002/04/17 13:46:58  geraint
## #include <fstream> for -oct as well as -cc.
##
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
407
408
409
410
411
412
413

414
415
416
417

418
419
420
421

422
423
424
425
426
427
428







-




-




-







make_cc() 
{
# get octave version
case `$MATRIX --version | gawk -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/load-save.h>
#include <octave/lo-mappers.h>
917
918
919
920
921
922
923




924


925
926
927
928
929
930
931
919
920
921
922
923
924
925
926
927
928
929

930
931
932
933
934
935
936
937
938







+
+
+
+
-
+
+







  static int row;

  if (dump_data)
    {
       if (row > 0)
         {
           Matrix written_data = data.extract (0, 0, row-1, data.cols ()-1);
	   file << "# name: mtt_dump" << std::endl
		<< "# type: matrix" << std::endl
		<< "# rows: " << written_data.rows () << std::endl
		<< "# columns: " << written_data.columns () << std::endl
           $save_ascii_data_function (file, written_data, "mtt_data");
		<< written_data;
	   file.flush ();
	 }
       return;
    }

  const int nx = x.length (), ny = y.length ();
  register int col = 0;

949
950
951
952
953
954
955
956
957






958
959
960
961
962
963
964
956
957
958
959
960
961
962


963
964
965
966
967
968
969
970
971
972
973
974
975







-
-
+
+
+
+
+
+







	   << static_cast <double> (cputime - cputime0) / CLOCKS_PER_SEC << '\t'
	   << static_cast <double> (cputime - cputime1) / CLOCKS_PER_SEC << std::endl;
  cputime1 = cputime;

  if (nrows == row)
    {
#ifdef STANDALONE
      $save_ascii_data_function (file, data, "mtt_data");
//    std::cout << data << std::endl;
      file << "# name: mtt_dump" << std::endl
	   << "# type: matrix" << std::endl
	   << "# rows: " << data.rows () << std::endl
	   << "# columns: " << data.columns () << std::endl
	   << data;
      file.flush ();
#else // ! STANDALONE
  set_global_value ("MTT_data", data);
#endif
    row = 0;
    fcputime.close();
    }
}

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