Overview
Comment:Octave 2.0.16 compatibility.
Removed static declarations - gave wrong results.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: a642e130b1e7e7b767a53fbcf654a1778f7e1bb49483152f604c989a51b76c6c
User & Date: geraint@users.sourceforge.net on 2001-04-01 05:18:57.000
Other Links: branch diff | manifest | tags
Context
2001-04-02
08:19:18
Translates modulated parameters into reduce check-in: b52250ca63 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2001-04-01
05:18:57
Octave 2.0.16 compatibility.
Removed static declarations - gave wrong results.
check-in: a642e130b1 user: geraint@users.sourceforge.net tags: origin/master, trunk
05:17:22
Removed static declarations - gave wrong results with multiple calls of ode2odes. check-in: b6b370e3b4 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes
︙︙
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
			    const ColumnVector	&openx)
{
#else // !STANDALONE
DEFUN_DLD (mtt_implicit, args, ,
	   "implicit integration method")
{
#ifdef OCTAVE_DEV
  static ColumnVector  	x	= args(0).column_vector_value ();
  static ColumnVector	dx	= args(1).column_vector_value ();
  static Matrix		AA	= args(2).matrix_value ();
  static ColumnVector	AAx	= args(3).column_vector_value ();
  const  double		t	= args(4).double_value ();
  const  int		Nx	= (int) (args(5).double_value ());
  const  ColumnVector	openx	= args(6).column_vector_value ();
#else // !OCTAVE_DEV
  static ColumnVector	x	= args(0).vector_value ();
  static ColumnVector	dx	= args(1).vector_value ();
  static Matrix		AA	= args(2).matrix_value ();
  static ColumnVector	AAx	= args(3).vector_value ();
  const  double		t	= args(4).double_value ();
  const  int		Nx	= (int) (args(5).double_value ());
  const  ColumnVector	openx	= args(6).vector_value ();
#endif // OCTAVE_DEV
#endif // STANDALONE

  register int row, col;







|
|
|
|




|
|
|
|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
			    const ColumnVector	&openx)
{
#else // !STANDALONE
DEFUN_DLD (mtt_implicit, args, ,
	   "implicit integration method")
{
#ifdef OCTAVE_DEV
  ColumnVector  	x	= args(0).column_vector_value ();
  ColumnVector		dx	= args(1).column_vector_value ();
  Matrix		AA	= args(2).matrix_value ();
  ColumnVector		AAx	= args(3).column_vector_value ();
  const  double		t	= args(4).double_value ();
  const  int		Nx	= (int) (args(5).double_value ());
  const  ColumnVector	openx	= args(6).column_vector_value ();
#else // !OCTAVE_DEV
  ColumnVector		x	= args(0).vector_value ();
  ColumnVector		dx	= args(1).vector_value ();
  Matrix		AA	= args(2).matrix_value ();
  ColumnVector		AAx	= args(3).vector_value ();
  const  double		t	= args(4).double_value ();
  const  int		Nx	= (int) (args(5).double_value ());
  const  ColumnVector	openx	= args(6).vector_value ();
#endif // OCTAVE_DEV
#endif // STANDALONE

  register int row, col;
︙︙
45
46
47
48
49
50
51

52







53
54
55
56
57
58
59
	    {
	      AA (row,col) = 0.0;
	      AA (col,row) = 0.0;
	    }
	}
    }


  x = static_cast<ColumnVector> (xleftdiv (AA, static_cast<Matrix>(static_cast<ColumnVector>(AAx + dx * t))));







  
  for (row = 0; row < Nx; row++)
    {
      if (openx (row) > 0.5)
	{
	  x (row) = 0.0;
	}







>
|
>
>
>
>
>
>
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
	    {
	      AA (row,col) = 0.0;
	      AA (col,row) = 0.0;
	    }
	}
    }

#ifdef OCTAVE_DEV
  x = static_cast<ColumnVector> (xleftdiv (AA, static_cast<Matrix>(AAx + dx * t)));
#else // !OCTAVE_DEV
  Matrix tmp = xleftdiv (AA, static_cast<Matrix>(static_cast<ColumnVector>(AAx + dx * t)));
  for (row = 0; row < Nx; row++)
    {
      x (row) = tmp (row,0);
    }
#endif // OCTAVE_DEV
  
  for (row = 0; row < Nx; row++)
    {
      if (openx (row) > 0.5)
	{
	  x (row) = 0.0;
	}
︙︙

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