ert_main.c file

mail@pastecode.io avatar
unknown
c_cpp
17 days ago
1.5 kB
3
Indexable
Never
#ifdef __GNUC__

#define REAL(param)          double * param

#define INTEGER(param)       int * param

#define COMPLEX(param)       FCmplx * param

#define LOGICAL(param)       int * param

#define REAL_ARR(param)      double * param

#define INTEGER_ARR(param)   int * param

#define COMPLEX_ARR(param)   FCmplx * param

#define LOGICAL_ARR(param)   int * param

#define FUNCTION(func_name)  func_name##_

#else

#define REAL(param)          double * param

#define INTEGER(param)       int * param

#define COMPLEX(param)       FCmplx * param

#define LOGICAL(param)       int * param

#define REAL_ARR(param)      double param[]

#define INTEGER_ARR(param)   int param[]

#define COMPLEX_ARR(param)   FCmplx param[]

#define LOGICAL_ARR(param)   int param[]

#define FUNCTION(func_name)  func_name

#endif

 

// ------------------------------------------------------------

// The structure to represent complex numbers.

// ------------------------------------------------------------

typedef struct { double real; double imag; } FCmplx;

 

 

#include <stddef.h>

#include <stdio.h>

#include "CInterface0.h"

#include "rtwtypes.h"

 

void FUNCTION(rt_onestep)(REAL(freq), REAL(mod), REAL(Ia), REAL(Ib), REAL(Ic))

{

   CInterface0_U.freq = *freq;

   CInterface0_U.mod = *mod;

   CInterface0_step();

   *Ia = CInterface0_Y.Iabc[0];

   *Ib = CInterface0_Y.Iabc[1];

   *Ic = CInterface0_Y.Iabc[2];

}
Leave a Comment