1
2
3
4
5
6
7
8
9
10
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
37
|
#include <octave/oct.h>
#include <octave/xdiv.h>
#ifdef OCTAVE_DEV
#define VECTOR_VALUE column_vector_value
#else // !OCTAVE_DEV
#define VECTOR_VALUE vector_value
#endif // OCTAVE_DEV
#ifdef STANDALONE
ColumnVector Fmtt_implicit ( ColumnVector &x,
ColumnVector &dx,
Matrix &AA,
ColumnVector &AAx,
const double &t,
const int &Nx,
const ColumnVector &openx)
{
#else // !STANDALONE
DEFUN_DLD (mtt_implicit, args, ,
"implicit integration method")
{
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 // STANDALONE
register int row, col;
for (row = 0; row < Nx; row++)
{
if (openx (row) > 0.5)
{
|
>
|
>
>
>
>
>
>
|
|
|
1
2
3
4
5
6
7
8
9
10
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
37
38
39
40
41
42
43
44
|
#include <octave/oct.h>
#include <octave/xdiv.h>
#ifdef OCTAVE_DEV
#define VECTOR_VALUE column_vector_value
#else // !OCTAVE_DEV
#define VECTOR_VALUE vector_value
#endif // OCTAVE_DEV
// Code generation directives
#define STANDALONE 0
#define OCTAVEDLD 1
#if (! defined (CODEGENTARGET))
#define CODEGENTARGET STANDALONE
#endif // (! defined (CODEGENTARGET))
#if (CODEGENTARGET == STANDALONE)
ColumnVector Fmtt_implicit ( ColumnVector &x,
ColumnVector &dx,
Matrix &AA,
ColumnVector &AAx,
const double &t,
const int &Nx,
const ColumnVector &openx)
{
#elif (CODEGENTARGET == OCTAVEDLD)
DEFUN_DLD (mtt_implicit, args, ,
"implicit integration method")
{
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 // (CODEGENTARGET == STANDALONE)
register int row, col;
for (row = 0; row < Nx; row++)
{
if (openx (row) > 0.5)
{
|
59
60
61
62
63
64
65
66
67
68
69
70
71
|
{
if (openx (row) > 0.5)
{
x (row) = 0.0;
}
}
#ifdef STANDALONE
return x;
#else // !STANDALONE
return octave_value (x);
#endif // STANDALONE
}
|
|
|
|
|
66
67
68
69
70
71
72
73
74
75
76
77
78
|
{
if (openx (row) > 0.5)
{
x (row) = 0.0;
}
}
#if (CODEGENTARGET == STANDALONE)
return x;
#elif (CODEGENTARGET == OCTAVEDLD)
return octave_value (x);
#endif // (CODEGENTARGET == STANDALONE)
}
|