initial commit
This commit is contained in:
16
ks/Models/FP56/Model_grt_rtw/Model.bat
Executable file
16
ks/Models/FP56/Model_grt_rtw/Model.bat
Executable file
@@ -0,0 +1,16 @@
|
||||
|
||||
set skipSetupArg=%2
|
||||
if "%skipSetupArg%" NEQ "skip_setup_msvc" (
|
||||
call "setup_msvc.bat"
|
||||
)
|
||||
|
||||
cd .
|
||||
|
||||
if "%1"=="" (nmake -f Model.mk all) else (nmake -f Model.mk %1)
|
||||
@if errorlevel 1 goto error_exit
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_exit
|
||||
echo The make command returned an error of %errorlevel%
|
||||
exit /B 1
|
||||
358
ks/Models/FP56/Model_grt_rtw/Model.cpp
Executable file
358
ks/Models/FP56/Model_grt_rtw/Model.cpp
Executable file
@@ -0,0 +1,358 @@
|
||||
/*
|
||||
* Model.cpp
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.2
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Sat Mar 28 11:28:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#include "Model.h"
|
||||
#include "rtwtypes.h"
|
||||
#include "Model_private.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "rt_nonfinite.h"
|
||||
|
||||
}
|
||||
/*
|
||||
* This function updates continuous states using the ODE3 fixed-step
|
||||
* solver algorithm
|
||||
*/
|
||||
void Model::rt_ertODEUpdateContinuousStates(RTWSolverInfo *si )
|
||||
{
|
||||
/* Solver Matrices */
|
||||
static const real_T rt_ODE3_A[3]{
|
||||
1.0/2.0, 3.0/4.0, 1.0
|
||||
};
|
||||
|
||||
static const real_T rt_ODE3_B[3][3]{
|
||||
{ 1.0/2.0, 0.0, 0.0 },
|
||||
|
||||
{ 0.0, 3.0/4.0, 0.0 },
|
||||
|
||||
{ 2.0/9.0, 1.0/3.0, 4.0/9.0 }
|
||||
};
|
||||
|
||||
time_T t { rtsiGetT(si) };
|
||||
|
||||
time_T tnew { rtsiGetSolverStopTime(si) };
|
||||
|
||||
time_T h { rtsiGetStepSize(si) };
|
||||
|
||||
real_T *x { rtsiGetContStates(si) };
|
||||
|
||||
ODE3_IntgData *id { static_cast<ODE3_IntgData *>(rtsiGetSolverData(si)) };
|
||||
|
||||
real_T *y { id->y };
|
||||
|
||||
real_T *f0 { id->f[0] };
|
||||
|
||||
real_T *f1 { id->f[1] };
|
||||
|
||||
real_T *f2 { id->f[2] };
|
||||
|
||||
real_T hB[3];
|
||||
int_T i;
|
||||
int_T nXc { 3 };
|
||||
|
||||
rtsiSetSimTimeStep(si,MINOR_TIME_STEP);
|
||||
|
||||
/* Save the state values at time t in y, we'll use x as ynew. */
|
||||
(void) std::memcpy(y, x,
|
||||
static_cast<uint_T>(nXc)*sizeof(real_T));
|
||||
|
||||
/* Assumes that rtsiSetT and ModelOutputs are up-to-date */
|
||||
/* f0 = f(t,y) */
|
||||
rtsiSetdX(si, f0);
|
||||
Model_derivatives();
|
||||
|
||||
/* f(:,2) = feval(odefile, t + hA(1), y + f*hB(:,1), args(:)(*)); */
|
||||
hB[0] = h * rt_ODE3_B[0][0];
|
||||
for (i = 0; i < nXc; i++) {
|
||||
x[i] = y[i] + (f0[i]*hB[0]);
|
||||
}
|
||||
|
||||
rtsiSetT(si, t + h*rt_ODE3_A[0]);
|
||||
rtsiSetdX(si, f1);
|
||||
this->step();
|
||||
Model_derivatives();
|
||||
|
||||
/* f(:,3) = feval(odefile, t + hA(2), y + f*hB(:,2), args(:)(*)); */
|
||||
for (i = 0; i <= 1; i++) {
|
||||
hB[i] = h * rt_ODE3_B[1][i];
|
||||
}
|
||||
|
||||
for (i = 0; i < nXc; i++) {
|
||||
x[i] = y[i] + (f0[i]*hB[0] + f1[i]*hB[1]);
|
||||
}
|
||||
|
||||
rtsiSetT(si, t + h*rt_ODE3_A[1]);
|
||||
rtsiSetdX(si, f2);
|
||||
this->step();
|
||||
Model_derivatives();
|
||||
|
||||
/* tnew = t + hA(3);
|
||||
ynew = y + f*hB(:,3); */
|
||||
for (i = 0; i <= 2; i++) {
|
||||
hB[i] = h * rt_ODE3_B[2][i];
|
||||
}
|
||||
|
||||
for (i = 0; i < nXc; i++) {
|
||||
x[i] = y[i] + (f0[i]*hB[0] + f1[i]*hB[1] + f2[i]*hB[2]);
|
||||
}
|
||||
|
||||
rtsiSetT(si, tnew);
|
||||
rtsiSetSimTimeStep(si,MAJOR_TIME_STEP);
|
||||
}
|
||||
|
||||
/* Model step function */
|
||||
void Model::step()
|
||||
{
|
||||
real_T rtb_Gain1;
|
||||
real_T rtb_Gain4;
|
||||
if (rtmIsMajorTimeStep((&Model_M))) {
|
||||
/* set solver stop time */
|
||||
if (!((&Model_M)->Timing.clockTick0+1)) {
|
||||
rtsiSetSolverStopTime(&(&Model_M)->solverInfo, (((&Model_M)
|
||||
->Timing.clockTickH0 + 1) * (&Model_M)->Timing.stepSize0 * 4294967296.0));
|
||||
} else {
|
||||
rtsiSetSolverStopTime(&(&Model_M)->solverInfo, (((&Model_M)
|
||||
->Timing.clockTick0 + 1) * (&Model_M)->Timing.stepSize0 + (&Model_M)
|
||||
->Timing.clockTickH0 * (&Model_M)->Timing.stepSize0 * 4294967296.0));
|
||||
}
|
||||
} /* end MajorTimeStep */
|
||||
|
||||
/* Update absolute time of base rate at minor time step */
|
||||
if (rtmIsMinorTimeStep((&Model_M))) {
|
||||
(&Model_M)->Timing.t[0] = rtsiGetT(&(&Model_M)->solverInfo);
|
||||
}
|
||||
|
||||
/* Outport: '<Root>/Temperatur' incorporates:
|
||||
* Integrator: '<S1>/Integrator1'
|
||||
*/
|
||||
Model_Y.Temperatur = Model_X.Integrator1_CSTATE;
|
||||
|
||||
/* Gain: '<S1>/Gain1' incorporates:
|
||||
* Integrator: '<S1>/Integrator'
|
||||
* Integrator: '<S1>/Integrator1'
|
||||
* Sum: '<S1>/Plus1'
|
||||
*/
|
||||
rtb_Gain1 = Model_P.alphaHD * Model_P.AHD * (Model_X.Integrator_CSTATE -
|
||||
Model_X.Integrator1_CSTATE);
|
||||
|
||||
/* Gain: '<S1>/Gain' incorporates:
|
||||
* Inport: '<Root>/Stellgrad'
|
||||
* Sum: '<S1>/Plus'
|
||||
*/
|
||||
Model_B.Gain = 1.0 / (Model_P.mHD * Model_P.CHD) * (Model_U.Stellgrad -
|
||||
rtb_Gain1);
|
||||
|
||||
/* Gain: '<S1>/Gain4' incorporates:
|
||||
* Integrator: '<S1>/Integrator1'
|
||||
* Integrator: '<S1>/Integrator2'
|
||||
* Sum: '<S1>/Plus4'
|
||||
*/
|
||||
rtb_Gain4 = Model_P.alphaSW * Model_P.Ai * (Model_X.Integrator1_CSTATE -
|
||||
Model_X.Integrator2_CSTATE);
|
||||
|
||||
/* Gain: '<S1>/Gain2' incorporates:
|
||||
* Sum: '<S1>/Plus2'
|
||||
*/
|
||||
Model_B.Gain2 = 1.0 / (Model_P.ml * Model_P.Cl + Model_P.mES * Model_P.CES) *
|
||||
(rtb_Gain1 - rtb_Gain4);
|
||||
|
||||
/* Gain: '<S1>/Gain5' incorporates:
|
||||
* Constant: '<Root>/Constant'
|
||||
* Gain: '<S1>/Gain7'
|
||||
* Integrator: '<S1>/Integrator2'
|
||||
* Sum: '<S1>/Plus5'
|
||||
* Sum: '<S1>/Plus7'
|
||||
*/
|
||||
Model_B.Gain5 = (rtb_Gain4 - Model_P.alpha_aussen * Model_P.A_Aussen *
|
||||
(Model_X.Integrator2_CSTATE - Model_P.Constant_Value)) * (1.0
|
||||
/ (Model_P.mSW * Model_P.CSW));
|
||||
if (rtmIsMajorTimeStep((&Model_M))) {
|
||||
/* Matfile logging */
|
||||
rt_UpdateTXYLogVars((&Model_M)->rtwLogInfo, ((&Model_M)->Timing.t));
|
||||
} /* end MajorTimeStep */
|
||||
|
||||
if (rtmIsMajorTimeStep((&Model_M))) {
|
||||
/* signal main to stop simulation */
|
||||
{ /* Sample time: [0.0s, 0.0s] */
|
||||
if ((rtmGetTFinal((&Model_M))!=-1) &&
|
||||
!((rtmGetTFinal((&Model_M))-((((&Model_M)->Timing.clockTick1+(&Model_M)
|
||||
->Timing.clockTickH1* 4294967296.0)) * 0.05)) > ((((&Model_M)
|
||||
->Timing.clockTick1+(&Model_M)->Timing.clockTickH1* 4294967296.0))
|
||||
* 0.05) * (DBL_EPSILON))) {
|
||||
rtmSetErrorStatus((&Model_M), "Simulation finished");
|
||||
}
|
||||
}
|
||||
|
||||
rt_ertODEUpdateContinuousStates(&(&Model_M)->solverInfo);
|
||||
|
||||
/* Update absolute time for base rate */
|
||||
/* The "clockTick0" counts the number of times the code of this task has
|
||||
* been executed. The absolute time is the multiplication of "clockTick0"
|
||||
* and "Timing.stepSize0". Size of "clockTick0" ensures timer will not
|
||||
* overflow during the application lifespan selected.
|
||||
* Timer of this task consists of two 32 bit unsigned integers.
|
||||
* The two integers represent the low bits Timing.clockTick0 and the high bits
|
||||
* Timing.clockTickH0. When the low bit overflows to 0, the high bits increment.
|
||||
*/
|
||||
if (!(++(&Model_M)->Timing.clockTick0)) {
|
||||
++(&Model_M)->Timing.clockTickH0;
|
||||
}
|
||||
|
||||
(&Model_M)->Timing.t[0] = rtsiGetSolverStopTime(&(&Model_M)->solverInfo);
|
||||
|
||||
{
|
||||
/* Update absolute timer for sample time: [0.05s, 0.0s] */
|
||||
/* The "clockTick1" counts the number of times the code of this task has
|
||||
* been executed. The resolution of this integer timer is 0.05, which is the step size
|
||||
* of the task. Size of "clockTick1" ensures timer will not overflow during the
|
||||
* application lifespan selected.
|
||||
* Timer of this task consists of two 32 bit unsigned integers.
|
||||
* The two integers represent the low bits Timing.clockTick1 and the high bits
|
||||
* Timing.clockTickH1. When the low bit overflows to 0, the high bits increment.
|
||||
*/
|
||||
(&Model_M)->Timing.clockTick1++;
|
||||
if (!(&Model_M)->Timing.clockTick1) {
|
||||
(&Model_M)->Timing.clockTickH1++;
|
||||
}
|
||||
}
|
||||
} /* end MajorTimeStep */
|
||||
}
|
||||
|
||||
/* Derivatives for root system: '<Root>' */
|
||||
void Model::Model_derivatives()
|
||||
{
|
||||
XDot_Model_T *_rtXdot;
|
||||
_rtXdot = ((XDot_Model_T *) (&Model_M)->derivs);
|
||||
|
||||
/* Derivatives for Integrator: '<S1>/Integrator1' */
|
||||
_rtXdot->Integrator1_CSTATE = Model_B.Gain2;
|
||||
|
||||
/* Derivatives for Integrator: '<S1>/Integrator' */
|
||||
_rtXdot->Integrator_CSTATE = Model_B.Gain;
|
||||
|
||||
/* Derivatives for Integrator: '<S1>/Integrator2' */
|
||||
_rtXdot->Integrator2_CSTATE = Model_B.Gain5;
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
void Model::initialize()
|
||||
{
|
||||
/* Registration code */
|
||||
|
||||
/* initialize non-finites */
|
||||
rt_InitInfAndNaN(sizeof(real_T));
|
||||
|
||||
{
|
||||
/* Setup solver object */
|
||||
rtsiSetSimTimeStepPtr(&(&Model_M)->solverInfo, &(&Model_M)
|
||||
->Timing.simTimeStep);
|
||||
rtsiSetTPtr(&(&Model_M)->solverInfo, &rtmGetTPtr((&Model_M)));
|
||||
rtsiSetStepSizePtr(&(&Model_M)->solverInfo, &(&Model_M)->Timing.stepSize0);
|
||||
rtsiSetdXPtr(&(&Model_M)->solverInfo, &(&Model_M)->derivs);
|
||||
rtsiSetContStatesPtr(&(&Model_M)->solverInfo, (real_T **) &(&Model_M)
|
||||
->contStates);
|
||||
rtsiSetNumContStatesPtr(&(&Model_M)->solverInfo, &(&Model_M)
|
||||
->Sizes.numContStates);
|
||||
rtsiSetNumPeriodicContStatesPtr(&(&Model_M)->solverInfo, &(&Model_M)
|
||||
->Sizes.numPeriodicContStates);
|
||||
rtsiSetPeriodicContStateIndicesPtr(&(&Model_M)->solverInfo, &(&Model_M)
|
||||
->periodicContStateIndices);
|
||||
rtsiSetPeriodicContStateRangesPtr(&(&Model_M)->solverInfo, &(&Model_M)
|
||||
->periodicContStateRanges);
|
||||
rtsiSetErrorStatusPtr(&(&Model_M)->solverInfo, (&rtmGetErrorStatus((&Model_M))));
|
||||
rtsiSetRTModelPtr(&(&Model_M)->solverInfo, (&Model_M));
|
||||
}
|
||||
|
||||
rtsiSetSimTimeStep(&(&Model_M)->solverInfo, MAJOR_TIME_STEP);
|
||||
(&Model_M)->intgData.y = (&Model_M)->odeY;
|
||||
(&Model_M)->intgData.f[0] = (&Model_M)->odeF[0];
|
||||
(&Model_M)->intgData.f[1] = (&Model_M)->odeF[1];
|
||||
(&Model_M)->intgData.f[2] = (&Model_M)->odeF[2];
|
||||
(&Model_M)->contStates = ((X_Model_T *) &Model_X);
|
||||
rtsiSetSolverData(&(&Model_M)->solverInfo, static_cast<void *>(&(&Model_M)
|
||||
->intgData));
|
||||
rtsiSetIsMinorTimeStepWithModeChange(&(&Model_M)->solverInfo, false);
|
||||
rtsiSetSolverName(&(&Model_M)->solverInfo,"ode3");
|
||||
rtmSetTPtr((&Model_M), &(&Model_M)->Timing.tArray[0]);
|
||||
rtmSetTFinal((&Model_M), 10.0);
|
||||
(&Model_M)->Timing.stepSize0 = 0.05;
|
||||
|
||||
/* Setup for data logging */
|
||||
{
|
||||
static RTWLogInfo rt_DataLoggingInfo;
|
||||
rt_DataLoggingInfo.loggingInterval = (nullptr);
|
||||
(&Model_M)->rtwLogInfo = &rt_DataLoggingInfo;
|
||||
}
|
||||
|
||||
/* Setup for data logging */
|
||||
{
|
||||
rtliSetLogXSignalInfo((&Model_M)->rtwLogInfo, (nullptr));
|
||||
rtliSetLogXSignalPtrs((&Model_M)->rtwLogInfo, (nullptr));
|
||||
rtliSetLogT((&Model_M)->rtwLogInfo, "tout");
|
||||
rtliSetLogX((&Model_M)->rtwLogInfo, "");
|
||||
rtliSetLogXFinal((&Model_M)->rtwLogInfo, "");
|
||||
rtliSetLogVarNameModifier((&Model_M)->rtwLogInfo, "rt_");
|
||||
rtliSetLogFormat((&Model_M)->rtwLogInfo, 4);
|
||||
rtliSetLogMaxRows((&Model_M)->rtwLogInfo, 0);
|
||||
rtliSetLogDecimation((&Model_M)->rtwLogInfo, 1);
|
||||
rtliSetLogY((&Model_M)->rtwLogInfo, "");
|
||||
rtliSetLogYSignalInfo((&Model_M)->rtwLogInfo, (nullptr));
|
||||
rtliSetLogYSignalPtrs((&Model_M)->rtwLogInfo, (nullptr));
|
||||
}
|
||||
|
||||
/* Matfile logging */
|
||||
rt_StartDataLoggingWithStartTime((&Model_M)->rtwLogInfo, 0.0, rtmGetTFinal
|
||||
((&Model_M)), (&Model_M)->Timing.stepSize0, (&rtmGetErrorStatus((&Model_M))));
|
||||
|
||||
/* InitializeConditions for Integrator: '<S1>/Integrator1' */
|
||||
Model_X.Integrator1_CSTATE = Model_P.T_amb;
|
||||
|
||||
/* InitializeConditions for Integrator: '<S1>/Integrator' */
|
||||
Model_X.Integrator_CSTATE = Model_P.T_amb;
|
||||
|
||||
/* InitializeConditions for Integrator: '<S1>/Integrator2' */
|
||||
Model_X.Integrator2_CSTATE = Model_P.T_amb;
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
void Model::terminate()
|
||||
{
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/* Constructor */
|
||||
Model::Model() :
|
||||
Model_U(),
|
||||
Model_Y(),
|
||||
Model_B(),
|
||||
Model_X(),
|
||||
Model_M()
|
||||
{
|
||||
/* Currently there is no constructor body generated.*/
|
||||
}
|
||||
|
||||
/* Destructor */
|
||||
Model::~Model()
|
||||
{
|
||||
/* Currently there is no destructor body generated.*/
|
||||
}
|
||||
|
||||
/* Real-Time Model get method */
|
||||
RT_MODEL_Model_T * Model::getRTM()
|
||||
{
|
||||
return (&Model_M);
|
||||
}
|
||||
408
ks/Models/FP56/Model_grt_rtw/Model.h
Normal file
408
ks/Models/FP56/Model_grt_rtw/Model.h
Normal file
@@ -0,0 +1,408 @@
|
||||
/*
|
||||
* Model.h
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.1
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Thu Mar 26 17:54:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_Model_h_
|
||||
#define RTW_HEADER_Model_h_
|
||||
#include "rtwtypes.h"
|
||||
#include "rtw_continuous.h"
|
||||
#include "rtw_solver.h"
|
||||
#include "rt_logging.h"
|
||||
#include "Model_types.h"
|
||||
#include <cfloat>
|
||||
#include <cstring>
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "rt_nonfinite.h"
|
||||
|
||||
}
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef rtmGetContStateDisabled
|
||||
#define rtmGetContStateDisabled(rtm) ((rtm)->contStateDisabled)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetContStateDisabled
|
||||
#define rtmSetContStateDisabled(rtm, val) ((rtm)->contStateDisabled = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetContStates
|
||||
#define rtmGetContStates(rtm) ((rtm)->contStates)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetContStates
|
||||
#define rtmSetContStates(rtm, val) ((rtm)->contStates = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetContTimeOutputInconsistentWithStateAtMajorStepFlag
|
||||
#define rtmGetContTimeOutputInconsistentWithStateAtMajorStepFlag(rtm) ((rtm)->CTOutputIncnstWithState)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetContTimeOutputInconsistentWithStateAtMajorStepFlag
|
||||
#define rtmSetContTimeOutputInconsistentWithStateAtMajorStepFlag(rtm, val) ((rtm)->CTOutputIncnstWithState = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetDerivCacheNeedsReset
|
||||
#define rtmGetDerivCacheNeedsReset(rtm) ((rtm)->derivCacheNeedsReset)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetDerivCacheNeedsReset
|
||||
#define rtmSetDerivCacheNeedsReset(rtm, val) ((rtm)->derivCacheNeedsReset = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetFinalTime
|
||||
#define rtmGetFinalTime(rtm) ((rtm)->Timing.tFinal)
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetIntgData
|
||||
#define rtmGetIntgData(rtm) ((rtm)->intgData)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetIntgData
|
||||
#define rtmSetIntgData(rtm, val) ((rtm)->intgData = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetOdeF
|
||||
#define rtmGetOdeF(rtm) ((rtm)->odeF)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetOdeF
|
||||
#define rtmSetOdeF(rtm, val) ((rtm)->odeF = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetOdeY
|
||||
#define rtmGetOdeY(rtm) ((rtm)->odeY)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetOdeY
|
||||
#define rtmSetOdeY(rtm, val) ((rtm)->odeY = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetPeriodicContStateIndices
|
||||
#define rtmGetPeriodicContStateIndices(rtm) ((rtm)->periodicContStateIndices)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetPeriodicContStateIndices
|
||||
#define rtmSetPeriodicContStateIndices(rtm, val) ((rtm)->periodicContStateIndices = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetPeriodicContStateRanges
|
||||
#define rtmGetPeriodicContStateRanges(rtm) ((rtm)->periodicContStateRanges)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetPeriodicContStateRanges
|
||||
#define rtmSetPeriodicContStateRanges(rtm, val) ((rtm)->periodicContStateRanges = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetRTWLogInfo
|
||||
#define rtmGetRTWLogInfo(rtm) ((rtm)->rtwLogInfo)
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetZCCacheNeedsReset
|
||||
#define rtmGetZCCacheNeedsReset(rtm) ((rtm)->zCCacheNeedsReset)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetZCCacheNeedsReset
|
||||
#define rtmSetZCCacheNeedsReset(rtm, val) ((rtm)->zCCacheNeedsReset = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetdX
|
||||
#define rtmGetdX(rtm) ((rtm)->derivs)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetdX
|
||||
#define rtmSetdX(rtm, val) ((rtm)->derivs = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetErrorStatus
|
||||
#define rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetErrorStatus
|
||||
#define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetStopRequested
|
||||
#define rtmGetStopRequested(rtm) ((rtm)->Timing.stopRequestedFlag)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetStopRequested
|
||||
#define rtmSetStopRequested(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetStopRequestedPtr
|
||||
#define rtmGetStopRequestedPtr(rtm) (&((rtm)->Timing.stopRequestedFlag))
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetT
|
||||
#define rtmGetT(rtm) (rtmGetTPtr((rtm))[0])
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetTFinal
|
||||
#define rtmGetTFinal(rtm) ((rtm)->Timing.tFinal)
|
||||
#endif
|
||||
|
||||
#ifndef rtmGetTPtr
|
||||
#define rtmGetTPtr(rtm) ((rtm)->Timing.t)
|
||||
#endif
|
||||
|
||||
/* Block signals (default storage) */
|
||||
struct B_Model_T {
|
||||
real_T Gain; /* '<S1>/Gain' */
|
||||
real_T Gain2; /* '<S1>/Gain2' */
|
||||
real_T Gain5; /* '<S1>/Gain5' */
|
||||
};
|
||||
|
||||
/* Continuous states (default storage) */
|
||||
struct X_Model_T {
|
||||
real_T Integrator1_CSTATE; /* '<S1>/Integrator1' */
|
||||
real_T Integrator_CSTATE; /* '<S1>/Integrator' */
|
||||
real_T Integrator2_CSTATE; /* '<S1>/Integrator2' */
|
||||
};
|
||||
|
||||
/* State derivatives (default storage) */
|
||||
struct XDot_Model_T {
|
||||
real_T Integrator1_CSTATE; /* '<S1>/Integrator1' */
|
||||
real_T Integrator_CSTATE; /* '<S1>/Integrator' */
|
||||
real_T Integrator2_CSTATE; /* '<S1>/Integrator2' */
|
||||
};
|
||||
|
||||
/* State disabled */
|
||||
struct XDis_Model_T {
|
||||
boolean_T Integrator1_CSTATE; /* '<S1>/Integrator1' */
|
||||
boolean_T Integrator_CSTATE; /* '<S1>/Integrator' */
|
||||
boolean_T Integrator2_CSTATE; /* '<S1>/Integrator2' */
|
||||
};
|
||||
|
||||
#ifndef ODE3_INTG
|
||||
#define ODE3_INTG
|
||||
|
||||
/* ODE3 Integration Data */
|
||||
struct ODE3_IntgData {
|
||||
real_T *y; /* output */
|
||||
real_T *f[3]; /* derivatives */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/* External inputs (root inport signals with default storage) */
|
||||
struct ExtU_Model_T {
|
||||
real_T Stellgrad; /* '<Root>/Stellgrad' */
|
||||
};
|
||||
|
||||
/* External outputs (root outports fed by signals with default storage) */
|
||||
struct ExtY_Model_T {
|
||||
real_T Temperatur; /* '<Root>/Temperatur' */
|
||||
};
|
||||
|
||||
/* Parameters (default storage) */
|
||||
struct P_Model_T_ {
|
||||
real_T AHD; /* Variable: AHD
|
||||
* Referenced by: '<S1>/Gain1'
|
||||
*/
|
||||
real_T A_Aussen; /* Variable: A_Aussen
|
||||
* Referenced by: '<S1>/Gain7'
|
||||
*/
|
||||
real_T Ai; /* Variable: Ai
|
||||
* Referenced by: '<S1>/Gain4'
|
||||
*/
|
||||
real_T CES; /* Variable: CES
|
||||
* Referenced by: '<S1>/Gain2'
|
||||
*/
|
||||
real_T CHD; /* Variable: CHD
|
||||
* Referenced by: '<S1>/Gain'
|
||||
*/
|
||||
real_T CSW; /* Variable: CSW
|
||||
* Referenced by: '<S1>/Gain5'
|
||||
*/
|
||||
real_T Cl; /* Variable: Cl
|
||||
* Referenced by: '<S1>/Gain2'
|
||||
*/
|
||||
real_T T_amb; /* Variable: T_amb
|
||||
* Referenced by:
|
||||
* '<S1>/Integrator'
|
||||
* '<S1>/Integrator1'
|
||||
* '<S1>/Integrator2'
|
||||
*/
|
||||
real_T alphaHD; /* Variable: alphaHD
|
||||
* Referenced by: '<S1>/Gain1'
|
||||
*/
|
||||
real_T alphaSW; /* Variable: alphaSW
|
||||
* Referenced by: '<S1>/Gain4'
|
||||
*/
|
||||
real_T alpha_aussen; /* Variable: alpha_aussen
|
||||
* Referenced by: '<S1>/Gain7'
|
||||
*/
|
||||
real_T mES; /* Variable: mES
|
||||
* Referenced by: '<S1>/Gain2'
|
||||
*/
|
||||
real_T mHD; /* Variable: mHD
|
||||
* Referenced by: '<S1>/Gain'
|
||||
*/
|
||||
real_T mSW; /* Variable: mSW
|
||||
* Referenced by: '<S1>/Gain5'
|
||||
*/
|
||||
real_T ml; /* Variable: ml
|
||||
* Referenced by: '<S1>/Gain2'
|
||||
*/
|
||||
real_T Constant_Value; /* Expression: 0
|
||||
* Referenced by: '<Root>/Constant'
|
||||
*/
|
||||
};
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct tag_RTM_Model_T {
|
||||
const char_T *errorStatus;
|
||||
RTWLogInfo *rtwLogInfo;
|
||||
RTWSolverInfo solverInfo;
|
||||
X_Model_T *contStates;
|
||||
int_T *periodicContStateIndices;
|
||||
real_T *periodicContStateRanges;
|
||||
real_T *derivs;
|
||||
boolean_T *contStateDisabled;
|
||||
boolean_T zCCacheNeedsReset;
|
||||
boolean_T derivCacheNeedsReset;
|
||||
boolean_T CTOutputIncnstWithState;
|
||||
real_T odeY[3];
|
||||
real_T odeF[3][3];
|
||||
ODE3_IntgData intgData;
|
||||
|
||||
/*
|
||||
* Sizes:
|
||||
* The following substructure contains sizes information
|
||||
* for many of the model attributes such as inputs, outputs,
|
||||
* dwork, sample times, etc.
|
||||
*/
|
||||
struct {
|
||||
int_T numContStates;
|
||||
int_T numPeriodicContStates;
|
||||
int_T numSampTimes;
|
||||
} Sizes;
|
||||
|
||||
/*
|
||||
* Timing:
|
||||
* The following substructure contains information regarding
|
||||
* the timing information for the model.
|
||||
*/
|
||||
struct {
|
||||
uint32_T clockTick0;
|
||||
uint32_T clockTickH0;
|
||||
time_T stepSize0;
|
||||
uint32_T clockTick1;
|
||||
uint32_T clockTickH1;
|
||||
time_T tFinal;
|
||||
SimTimeStep simTimeStep;
|
||||
boolean_T stopRequestedFlag;
|
||||
time_T *t;
|
||||
time_T tArray[2];
|
||||
} Timing;
|
||||
};
|
||||
|
||||
/* Block parameters (default storage) */
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
extern P_Model_T Model_P;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Block signals (default storage) */
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
extern struct B_Model_T Model_B;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Continuous states (default storage) */
|
||||
extern X_Model_T Model_X;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
/* External inputs (root inport signals with default storage) */
|
||||
extern struct ExtU_Model_T Model_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with default storage) */
|
||||
extern struct ExtY_Model_T Model_Y;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
/* Model entry point functions */
|
||||
extern void Model_initialize(void);
|
||||
extern void Model_step(void);
|
||||
extern void Model_terminate(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Real-time Model object */
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
extern RT_MODEL_Model_T *const Model_M;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/*-
|
||||
* The generated code includes comments that allow you to trace directly
|
||||
* back to the appropriate location in the model. The basic format
|
||||
* is <system>/block_name, where system is the system number (uniquely
|
||||
* assigned by Simulink) and block_name is the name of the block.
|
||||
*
|
||||
* Use the MATLAB hilite_system command to trace the generated code back
|
||||
* to the model. For example,
|
||||
*
|
||||
* hilite_system('<S3>') - opens system 3
|
||||
* hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
|
||||
*
|
||||
* Here is the system hierarchy for this model
|
||||
*
|
||||
* '<Root>' : 'Model'
|
||||
* '<S1>' : 'Model/Subsystem3'
|
||||
*/
|
||||
#endif /* RTW_HEADER_Model_h_ */
|
||||
426
ks/Models/FP56/Model_grt_rtw/Model.mk
Executable file
426
ks/Models/FP56/Model_grt_rtw/Model.mk
Executable file
@@ -0,0 +1,426 @@
|
||||
###########################################################################
|
||||
## Makefile generated for component 'Model'.
|
||||
##
|
||||
## Makefile : Model.mk
|
||||
## Generated on : Sat Mar 28 11:28:08 2026
|
||||
## Final product: $(RELATIVE_PATH_TO_ANCHOR)\Model.exe
|
||||
## Product type : executable
|
||||
##
|
||||
###########################################################################
|
||||
|
||||
###########################################################################
|
||||
## MACROS
|
||||
###########################################################################
|
||||
|
||||
# Macro Descriptions:
|
||||
# PRODUCT_NAME Name of the system to build
|
||||
# MAKEFILE Name of this makefile
|
||||
# COMPILER_COMMAND_FILE Compiler command listing model reference header paths
|
||||
# CMD_FILE Command file
|
||||
|
||||
PRODUCT_NAME = Model
|
||||
MAKEFILE = Model.mk
|
||||
MATLAB_ROOT = C:\PROGRA~1\MATLAB\R2022a
|
||||
MATLAB_BIN = C:\PROGRA~1\MATLAB\R2022a\bin
|
||||
MATLAB_ARCH_BIN = $(MATLAB_BIN)\win64
|
||||
START_DIR = E:\Repositories\Binder_Beispiel_ReglerBBR\Models\FP56
|
||||
SOLVER =
|
||||
SOLVER_OBJ =
|
||||
CLASSIC_INTERFACE = 0
|
||||
TGT_FCN_LIB = GNU
|
||||
MODEL_HAS_DYNAMICALLY_LOADED_SFCNS = 0
|
||||
RELATIVE_PATH_TO_ANCHOR = ..
|
||||
COMPILER_COMMAND_FILE = Model_comp.rsp
|
||||
CMD_FILE = Model.rsp
|
||||
C_STANDARD_OPTS =
|
||||
CPP_STANDARD_OPTS =
|
||||
NODEBUG = 1
|
||||
|
||||
###########################################################################
|
||||
## TOOLCHAIN SPECIFICATIONS
|
||||
###########################################################################
|
||||
|
||||
# Toolchain Name: Microsoft Visual C++ 2019 v16.0 | nmake (64-bit Windows)
|
||||
# Supported Version(s): 16.0
|
||||
# ToolchainInfo Version: 2022a
|
||||
# Specification Revision: 1.0
|
||||
#
|
||||
#-------------------------------------------
|
||||
# Macros assumed to be defined elsewhere
|
||||
#-------------------------------------------
|
||||
|
||||
# NODEBUG
|
||||
# cvarsdll
|
||||
# cvarsmt
|
||||
# conlibsmt
|
||||
# ldebug
|
||||
# conflags
|
||||
# cflags
|
||||
|
||||
#-----------
|
||||
# MACROS
|
||||
#-----------
|
||||
|
||||
MW_EXTERNLIB_DIR = $(MATLAB_ROOT)\extern\lib\win64\microsoft
|
||||
MW_LIB_DIR = $(MATLAB_ROOT)\lib\win64
|
||||
CPU = AMD64
|
||||
APPVER = 5.02
|
||||
CVARSFLAG = $(cvarsmt)
|
||||
CFLAGS_ADDITIONAL = -D_CRT_SECURE_NO_WARNINGS
|
||||
CPPFLAGS_ADDITIONAL = -EHs -D_CRT_SECURE_NO_WARNINGS /wd4251 /Zc:__cplusplus
|
||||
LIBS_TOOLCHAIN = $(conlibs)
|
||||
|
||||
TOOLCHAIN_SRCS =
|
||||
TOOLCHAIN_INCS =
|
||||
TOOLCHAIN_LIBS =
|
||||
|
||||
#------------------------
|
||||
# BUILD TOOL COMMANDS
|
||||
#------------------------
|
||||
|
||||
# C Compiler: Microsoft Visual C Compiler
|
||||
CC = cl
|
||||
|
||||
# Linker: Microsoft Visual C Linker
|
||||
LD = link
|
||||
|
||||
# C++ Compiler: Microsoft Visual C++ Compiler
|
||||
CPP = cl
|
||||
|
||||
# C++ Linker: Microsoft Visual C++ Linker
|
||||
CPP_LD = link
|
||||
|
||||
# Archiver: Microsoft Visual C/C++ Archiver
|
||||
AR = lib
|
||||
|
||||
# MEX Tool: MEX Tool
|
||||
MEX_PATH = $(MATLAB_ARCH_BIN)
|
||||
MEX = "$(MEX_PATH)\mex"
|
||||
|
||||
# Download: Download
|
||||
DOWNLOAD =
|
||||
|
||||
# Execute: Execute
|
||||
EXECUTE = $(PRODUCT)
|
||||
|
||||
# Builder: NMAKE Utility
|
||||
MAKE = nmake
|
||||
|
||||
|
||||
#-------------------------
|
||||
# Directives/Utilities
|
||||
#-------------------------
|
||||
|
||||
CDEBUG = -Zi
|
||||
C_OUTPUT_FLAG = -Fo
|
||||
LDDEBUG = /DEBUG
|
||||
OUTPUT_FLAG = -out:
|
||||
CPPDEBUG = -Zi
|
||||
CPP_OUTPUT_FLAG = -Fo
|
||||
CPPLDDEBUG = /DEBUG
|
||||
OUTPUT_FLAG = -out:
|
||||
ARDEBUG =
|
||||
STATICLIB_OUTPUT_FLAG = -out:
|
||||
MEX_DEBUG = -g
|
||||
RM = @del
|
||||
ECHO = @echo
|
||||
MV = @ren
|
||||
RUN = @cmd /C
|
||||
|
||||
#----------------------------------------
|
||||
# "Faster Builds" Build Configuration
|
||||
#----------------------------------------
|
||||
|
||||
ARFLAGS = /nologo
|
||||
CFLAGS = $(cflags) $(CVARSFLAG) $(CFLAGS_ADDITIONAL) \
|
||||
/Od /Oy-
|
||||
CPPFLAGS = /TP $(cflags) $(CVARSFLAG) $(CPPFLAGS_ADDITIONAL) \
|
||||
/Od /Oy-
|
||||
CPP_LDFLAGS = $(ldebug) $(conflags) $(LIBS_TOOLCHAIN)
|
||||
CPP_SHAREDLIB_LDFLAGS = $(ldebug) $(conflags) $(LIBS_TOOLCHAIN) \
|
||||
-dll -def:$(DEF_FILE)
|
||||
DOWNLOAD_FLAGS =
|
||||
EXECUTE_FLAGS =
|
||||
LDFLAGS = $(ldebug) $(conflags) $(LIBS_TOOLCHAIN)
|
||||
MEX_CPPFLAGS =
|
||||
MEX_CPPLDFLAGS =
|
||||
MEX_CFLAGS =
|
||||
MEX_LDFLAGS =
|
||||
MAKE_FLAGS = -f $(MAKEFILE)
|
||||
SHAREDLIB_LDFLAGS = $(ldebug) $(conflags) $(LIBS_TOOLCHAIN) \
|
||||
-dll -def:$(DEF_FILE)
|
||||
|
||||
|
||||
|
||||
###########################################################################
|
||||
## OUTPUT INFO
|
||||
###########################################################################
|
||||
|
||||
PRODUCT = $(RELATIVE_PATH_TO_ANCHOR)\Model.exe
|
||||
PRODUCT_TYPE = "executable"
|
||||
BUILD_TYPE = "Top-Level Standalone Executable"
|
||||
|
||||
###########################################################################
|
||||
## INCLUDE PATHS
|
||||
###########################################################################
|
||||
|
||||
INCLUDES_BUILDINFO =
|
||||
|
||||
INCLUDES = $(INCLUDES_BUILDINFO)
|
||||
|
||||
###########################################################################
|
||||
## DEFINES
|
||||
###########################################################################
|
||||
|
||||
DEFINES_BUILD_ARGS = -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DMAT_FILE=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=1 -DINTEGER_CODE=0 -DMT=0
|
||||
DEFINES_CUSTOM =
|
||||
DEFINES_OPTS = -DTID01EQ=1
|
||||
DEFINES_STANDARD = -DMODEL=Model -DNUMST=2 -DNCSTATES=3 -DHAVESTDIO -DRT -DUSE_RTMODEL
|
||||
|
||||
DEFINES = $(DEFINES_BUILD_ARGS) $(DEFINES_CUSTOM) $(DEFINES_OPTS) $(DEFINES_STANDARD)
|
||||
|
||||
###########################################################################
|
||||
## SOURCE FILES
|
||||
###########################################################################
|
||||
|
||||
SRCS = $(MATLAB_ROOT)\rtw\c\src\rt_logging.c $(START_DIR)\Model_grt_rtw\Model.cpp $(START_DIR)\Model_grt_rtw\Model_data.cpp $(START_DIR)\Model_grt_rtw\rtGetInf.cpp $(START_DIR)\Model_grt_rtw\rtGetNaN.cpp $(START_DIR)\Model_grt_rtw\rt_nonfinite.cpp
|
||||
|
||||
MAIN_SRC = $(MATLAB_ROOT)\rtw\c\src\common\rt_cppclass_main.cpp
|
||||
|
||||
ALL_SRCS = $(SRCS) $(MAIN_SRC)
|
||||
|
||||
###########################################################################
|
||||
## OBJECTS
|
||||
###########################################################################
|
||||
|
||||
OBJS = rt_logging.obj Model.obj Model_data.obj rtGetInf.obj rtGetNaN.obj rt_nonfinite.obj
|
||||
|
||||
MAIN_OBJ = rt_cppclass_main.obj
|
||||
|
||||
ALL_OBJS = $(OBJS) $(MAIN_OBJ)
|
||||
|
||||
###########################################################################
|
||||
## PREBUILT OBJECT FILES
|
||||
###########################################################################
|
||||
|
||||
PREBUILT_OBJS =
|
||||
|
||||
###########################################################################
|
||||
## LIBRARIES
|
||||
###########################################################################
|
||||
|
||||
LIBS =
|
||||
|
||||
###########################################################################
|
||||
## SYSTEM LIBRARIES
|
||||
###########################################################################
|
||||
|
||||
SYSTEM_LIBS =
|
||||
|
||||
###########################################################################
|
||||
## ADDITIONAL TOOLCHAIN FLAGS
|
||||
###########################################################################
|
||||
|
||||
#---------------
|
||||
# C Compiler
|
||||
#---------------
|
||||
|
||||
CFLAGS_BASIC = $(DEFINES) @$(COMPILER_COMMAND_FILE)
|
||||
|
||||
CFLAGS = $(CFLAGS) $(CFLAGS_BASIC)
|
||||
|
||||
#-----------------
|
||||
# C++ Compiler
|
||||
#-----------------
|
||||
|
||||
CPPFLAGS_BASIC = $(DEFINES) @$(COMPILER_COMMAND_FILE)
|
||||
|
||||
CPPFLAGS = $(CPPFLAGS) $(CPPFLAGS_BASIC)
|
||||
|
||||
###########################################################################
|
||||
## INLINED COMMANDS
|
||||
###########################################################################
|
||||
|
||||
|
||||
!include $(MATLAB_ROOT)\rtw\c\tools\vcdefs.mak
|
||||
|
||||
|
||||
###########################################################################
|
||||
## PHONY TARGETS
|
||||
###########################################################################
|
||||
|
||||
.PHONY : all build buildobj clean info prebuild download execute set_environment_variables
|
||||
|
||||
|
||||
all : build
|
||||
@cmd /C "@echo ### Successfully generated all binary outputs."
|
||||
|
||||
|
||||
build : set_environment_variables prebuild $(PRODUCT)
|
||||
|
||||
|
||||
buildobj : set_environment_variables prebuild $(OBJS) $(PREBUILT_OBJS)
|
||||
@cmd /C "@echo ### Successfully generated all binary outputs."
|
||||
|
||||
|
||||
prebuild :
|
||||
|
||||
|
||||
download : $(PRODUCT)
|
||||
|
||||
|
||||
execute : download
|
||||
@cmd /C "@echo ### Invoking postbuild tool "Execute" ..."
|
||||
$(EXECUTE) $(EXECUTE_FLAGS)
|
||||
@cmd /C "@echo ### Done invoking postbuild tool."
|
||||
|
||||
|
||||
set_environment_variables :
|
||||
@set INCLUDE=$(INCLUDES);$(INCLUDE)
|
||||
@set LIB=$(LIB)
|
||||
|
||||
|
||||
###########################################################################
|
||||
## FINAL TARGET
|
||||
###########################################################################
|
||||
|
||||
#-------------------------------------------
|
||||
# Create a standalone executable
|
||||
#-------------------------------------------
|
||||
|
||||
$(PRODUCT) : $(OBJS) $(PREBUILT_OBJS) $(MAIN_OBJ)
|
||||
@cmd /C "@echo ### Creating standalone executable "$(PRODUCT)" ..."
|
||||
$(CPP_LD) $(CPP_LDFLAGS) -out:$(PRODUCT) @$(CMD_FILE) $(SYSTEM_LIBS) $(TOOLCHAIN_LIBS)
|
||||
@cmd /C "@echo ### Created: $(PRODUCT)"
|
||||
|
||||
|
||||
###########################################################################
|
||||
## INTERMEDIATE TARGETS
|
||||
###########################################################################
|
||||
|
||||
#---------------------
|
||||
# SOURCE-TO-OBJECT
|
||||
#---------------------
|
||||
|
||||
.c.obj :
|
||||
$(CC) $(CFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
.cpp.obj :
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(RELATIVE_PATH_TO_ANCHOR)}.c.obj :
|
||||
$(CC) $(CFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(RELATIVE_PATH_TO_ANCHOR)}.cpp.obj :
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(START_DIR)}.c.obj :
|
||||
$(CC) $(CFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(START_DIR)}.cpp.obj :
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(START_DIR)\Model_grt_rtw}.c.obj :
|
||||
$(CC) $(CFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(START_DIR)\Model_grt_rtw}.cpp.obj :
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(MATLAB_ROOT)\rtw\c\src}.c.obj :
|
||||
$(CC) $(CFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(MATLAB_ROOT)\rtw\c\src}.cpp.obj :
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(MATLAB_ROOT)\simulink\src}.c.obj :
|
||||
$(CC) $(CFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
{$(MATLAB_ROOT)\simulink\src}.cpp.obj :
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$<"
|
||||
|
||||
|
||||
rt_logging.obj : "$(MATLAB_ROOT)\rtw\c\src\rt_logging.c"
|
||||
$(CC) $(CFLAGS) -Fo"$@" "$(MATLAB_ROOT)\rtw\c\src\rt_logging.c"
|
||||
|
||||
|
||||
Model.obj : "$(START_DIR)\Model_grt_rtw\Model.cpp"
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$(START_DIR)\Model_grt_rtw\Model.cpp"
|
||||
|
||||
|
||||
Model_data.obj : "$(START_DIR)\Model_grt_rtw\Model_data.cpp"
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$(START_DIR)\Model_grt_rtw\Model_data.cpp"
|
||||
|
||||
|
||||
rtGetInf.obj : "$(START_DIR)\Model_grt_rtw\rtGetInf.cpp"
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$(START_DIR)\Model_grt_rtw\rtGetInf.cpp"
|
||||
|
||||
|
||||
rtGetNaN.obj : "$(START_DIR)\Model_grt_rtw\rtGetNaN.cpp"
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$(START_DIR)\Model_grt_rtw\rtGetNaN.cpp"
|
||||
|
||||
|
||||
rt_nonfinite.obj : "$(START_DIR)\Model_grt_rtw\rt_nonfinite.cpp"
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$(START_DIR)\Model_grt_rtw\rt_nonfinite.cpp"
|
||||
|
||||
|
||||
rt_cppclass_main.obj : "$(MATLAB_ROOT)\rtw\c\src\common\rt_cppclass_main.cpp"
|
||||
$(CPP) $(CPPFLAGS) -Fo"$@" "$(MATLAB_ROOT)\rtw\c\src\common\rt_cppclass_main.cpp"
|
||||
|
||||
|
||||
###########################################################################
|
||||
## DEPENDENCIES
|
||||
###########################################################################
|
||||
|
||||
$(ALL_OBJS) : rtw_proj.tmw $(COMPILER_COMMAND_FILE) $(MAKEFILE)
|
||||
|
||||
|
||||
###########################################################################
|
||||
## MISCELLANEOUS TARGETS
|
||||
###########################################################################
|
||||
|
||||
info :
|
||||
@cmd /C "@echo ### PRODUCT = $(PRODUCT)"
|
||||
@cmd /C "@echo ### PRODUCT_TYPE = $(PRODUCT_TYPE)"
|
||||
@cmd /C "@echo ### BUILD_TYPE = $(BUILD_TYPE)"
|
||||
@cmd /C "@echo ### INCLUDES = $(INCLUDES)"
|
||||
@cmd /C "@echo ### DEFINES = $(DEFINES)"
|
||||
@cmd /C "@echo ### ALL_SRCS = $(ALL_SRCS)"
|
||||
@cmd /C "@echo ### ALL_OBJS = $(ALL_OBJS)"
|
||||
@cmd /C "@echo ### LIBS = $(LIBS)"
|
||||
@cmd /C "@echo ### MODELREF_LIBS = $(MODELREF_LIBS)"
|
||||
@cmd /C "@echo ### SYSTEM_LIBS = $(SYSTEM_LIBS)"
|
||||
@cmd /C "@echo ### TOOLCHAIN_LIBS = $(TOOLCHAIN_LIBS)"
|
||||
@cmd /C "@echo ### CFLAGS = $(CFLAGS)"
|
||||
@cmd /C "@echo ### LDFLAGS = $(LDFLAGS)"
|
||||
@cmd /C "@echo ### SHAREDLIB_LDFLAGS = $(SHAREDLIB_LDFLAGS)"
|
||||
@cmd /C "@echo ### CPPFLAGS = $(CPPFLAGS)"
|
||||
@cmd /C "@echo ### CPP_LDFLAGS = $(CPP_LDFLAGS)"
|
||||
@cmd /C "@echo ### CPP_SHAREDLIB_LDFLAGS = $(CPP_SHAREDLIB_LDFLAGS)"
|
||||
@cmd /C "@echo ### ARFLAGS = $(ARFLAGS)"
|
||||
@cmd /C "@echo ### MEX_CFLAGS = $(MEX_CFLAGS)"
|
||||
@cmd /C "@echo ### MEX_CPPFLAGS = $(MEX_CPPFLAGS)"
|
||||
@cmd /C "@echo ### MEX_LDFLAGS = $(MEX_LDFLAGS)"
|
||||
@cmd /C "@echo ### MEX_CPPLDFLAGS = $(MEX_CPPLDFLAGS)"
|
||||
@cmd /C "@echo ### DOWNLOAD_FLAGS = $(DOWNLOAD_FLAGS)"
|
||||
@cmd /C "@echo ### EXECUTE_FLAGS = $(EXECUTE_FLAGS)"
|
||||
@cmd /C "@echo ### MAKE_FLAGS = $(MAKE_FLAGS)"
|
||||
|
||||
|
||||
clean :
|
||||
$(ECHO) "### Deleting all derived files..."
|
||||
@if exist $(PRODUCT) $(RM) $(PRODUCT)
|
||||
$(RM) $(ALL_OBJS)
|
||||
$(ECHO) "### Deleted all derived files."
|
||||
|
||||
|
||||
7
ks/Models/FP56/Model_grt_rtw/Model.rsp
Executable file
7
ks/Models/FP56/Model_grt_rtw/Model.rsp
Executable file
@@ -0,0 +1,7 @@
|
||||
rt_logging.obj
|
||||
Model.obj
|
||||
Model_data.obj
|
||||
rtGetInf.obj
|
||||
rtGetNaN.obj
|
||||
rt_nonfinite.obj
|
||||
rt_cppclass_main.obj
|
||||
6
ks/Models/FP56/Model_grt_rtw/Model_comp.rsp
Executable file
6
ks/Models/FP56/Model_grt_rtw/Model_comp.rsp
Executable file
@@ -0,0 +1,6 @@
|
||||
-IE:\Repositories\Binder_Beispiel_ReglerBBR\Models\FP56
|
||||
-IE:\Repositories\Binder_Beispiel_ReglerBBR\Models\FP56\Model_grt_rtw
|
||||
-I"C:\Program Files\MATLAB\R2022a\extern\include"
|
||||
-I"C:\Program Files\MATLAB\R2022a\simulink\include"
|
||||
-I"C:\Program Files\MATLAB\R2022a\rtw\c\src"
|
||||
-I"C:\Program Files\MATLAB\R2022a\rtw\c\src\ext_mode\common"
|
||||
103
ks/Models/FP56/Model_grt_rtw/Model_data.cpp
Executable file
103
ks/Models/FP56/Model_grt_rtw/Model_data.cpp
Executable file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Model_data.cpp
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.2
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Sat Mar 28 11:28:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#include "Model.h"
|
||||
|
||||
/* Block parameters (default storage) */
|
||||
P_Model_T Model::Model_P{
|
||||
/* Variable: AHD
|
||||
* Referenced by: '<S1>/Gain1'
|
||||
*/
|
||||
0.0255,
|
||||
|
||||
/* Variable: A_Aussen
|
||||
* Referenced by: '<S1>/Gain7'
|
||||
*/
|
||||
4.361516,
|
||||
|
||||
/* Variable: Ai
|
||||
* Referenced by: '<S1>/Gain4'
|
||||
*/
|
||||
0.164002,
|
||||
|
||||
/* Variable: CES
|
||||
* Referenced by: '<S1>/Gain2'
|
||||
*/
|
||||
520.5763,
|
||||
|
||||
/* Variable: CHD
|
||||
* Referenced by: '<S1>/Gain'
|
||||
*/
|
||||
1002.4,
|
||||
|
||||
/* Variable: CSW
|
||||
* Referenced by: '<S1>/Gain5'
|
||||
*/
|
||||
966.0,
|
||||
|
||||
/* Variable: Cl
|
||||
* Referenced by: '<S1>/Gain2'
|
||||
*/
|
||||
900.0,
|
||||
|
||||
/* Variable: T_amb
|
||||
* Referenced by:
|
||||
* '<S1>/Integrator'
|
||||
* '<S1>/Integrator1'
|
||||
* '<S1>/Integrator2'
|
||||
*/
|
||||
25.0,
|
||||
|
||||
/* Variable: alphaHD
|
||||
* Referenced by: '<S1>/Gain1'
|
||||
*/
|
||||
397.2681,
|
||||
|
||||
/* Variable: alphaSW
|
||||
* Referenced by: '<S1>/Gain4'
|
||||
*/
|
||||
85.2918,
|
||||
|
||||
/* Variable: alpha_aussen
|
||||
* Referenced by: '<S1>/Gain7'
|
||||
*/
|
||||
0.4507,
|
||||
|
||||
/* Variable: mES
|
||||
* Referenced by: '<S1>/Gain2'
|
||||
*/
|
||||
5.914,
|
||||
|
||||
/* Variable: mHD
|
||||
* Referenced by: '<S1>/Gain'
|
||||
*/
|
||||
0.12,
|
||||
|
||||
/* Variable: mSW
|
||||
* Referenced by: '<S1>/Gain5'
|
||||
*/
|
||||
2.82,
|
||||
|
||||
/* Variable: ml
|
||||
* Referenced by: '<S1>/Gain2'
|
||||
*/
|
||||
0.078321408,
|
||||
|
||||
/* Expression: 0
|
||||
* Referenced by: '<Root>/Constant'
|
||||
*/
|
||||
0.0
|
||||
};
|
||||
43
ks/Models/FP56/Model_grt_rtw/Model_private.h
Normal file
43
ks/Models/FP56/Model_grt_rtw/Model_private.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Model_private.h
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.1
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Thu Mar 26 17:54:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_Model_private_h_
|
||||
#define RTW_HEADER_Model_private_h_
|
||||
#include "rtwtypes.h"
|
||||
#include "builtin_typeid_types.h"
|
||||
#include "multiword_types.h"
|
||||
|
||||
/* Private macros used by the generated code to access rtModel */
|
||||
#ifndef rtmIsMajorTimeStep
|
||||
#define rtmIsMajorTimeStep(rtm) (((rtm)->Timing.simTimeStep) == MAJOR_TIME_STEP)
|
||||
#endif
|
||||
|
||||
#ifndef rtmIsMinorTimeStep
|
||||
#define rtmIsMinorTimeStep(rtm) (((rtm)->Timing.simTimeStep) == MINOR_TIME_STEP)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetTFinal
|
||||
#define rtmSetTFinal(rtm, val) ((rtm)->Timing.tFinal = (val))
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetTPtr
|
||||
#define rtmSetTPtr(rtm, val) ((rtm)->Timing.t = (val))
|
||||
#endif
|
||||
|
||||
/* private model entry point functions */
|
||||
extern void Model_derivatives(void);
|
||||
|
||||
#endif /* RTW_HEADER_Model_private_h_ */
|
||||
1
ks/Models/FP56/Model_grt_rtw/Model_ref.rsp
Executable file
1
ks/Models/FP56/Model_grt_rtw/Model_ref.rsp
Executable file
@@ -0,0 +1 @@
|
||||
|
||||
28
ks/Models/FP56/Model_grt_rtw/Model_types.h
Normal file
28
ks/Models/FP56/Model_grt_rtw/Model_types.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Model_types.h
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.1
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Thu Mar 26 17:54:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_Model_types_h_
|
||||
#define RTW_HEADER_Model_types_h_
|
||||
|
||||
/* Model Code Variants */
|
||||
|
||||
/* Parameters (default storage) */
|
||||
typedef struct P_Model_T_ P_Model_T;
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct tag_RTM_Model_T RT_MODEL_Model_T;
|
||||
|
||||
#endif /* RTW_HEADER_Model_types_h_ */
|
||||
BIN
ks/Models/FP56/Model_grt_rtw/buildInfo.mat
Executable file
BIN
ks/Models/FP56/Model_grt_rtw/buildInfo.mat
Executable file
Binary file not shown.
52
ks/Models/FP56/Model_grt_rtw/builtin_typeid_types.h
Normal file
52
ks/Models/FP56/Model_grt_rtw/builtin_typeid_types.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* builtin_typeid_types.h
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.1
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Thu Mar 26 17:54:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef BUILTIN_TYPEID_TYPES_H
|
||||
#define BUILTIN_TYPEID_TYPES_H
|
||||
#include "rtwtypes.h"
|
||||
#ifndef BUILTIN_TYPEID_TYPES
|
||||
#define BUILTIN_TYPEID_TYPES
|
||||
|
||||
/* Enumeration of built-in data types */
|
||||
typedef enum {
|
||||
SS_DOUBLE = 0, /* real_T */
|
||||
SS_SINGLE = 1, /* real32_T */
|
||||
SS_INT8 = 2, /* int8_T */
|
||||
SS_UINT8 = 3, /* uint8_T */
|
||||
SS_INT16 = 4, /* int16_T */
|
||||
SS_UINT16 = 5, /* uint16_T */
|
||||
SS_INT32 = 6, /* int32_T */
|
||||
SS_UINT32 = 7, /* uint32_T */
|
||||
SS_BOOLEAN = 8 /* boolean_T */
|
||||
} BuiltInDTypeId;
|
||||
|
||||
#define SS_NUM_BUILT_IN_DTYPE ((int_T)SS_BOOLEAN+1)
|
||||
|
||||
/* Enumeration for MAT-file logging code */
|
||||
typedef int_T DTypeId;
|
||||
|
||||
/* Enumeration of pre-defined data types */
|
||||
typedef enum {
|
||||
SS_FCN_CALL = 9,
|
||||
SS_INTEGER = 10,
|
||||
SS_POINTER = 11,
|
||||
SS_INTERNAL_DTYPE2 = 12,
|
||||
SS_TIMER_UINT32_PAIR = 13,
|
||||
SS_CONNECTION_TYPE = 14
|
||||
} PreDefinedDTypeId;
|
||||
|
||||
#endif /* BUILTIN_TYPEID_TYPES */
|
||||
#endif /* BUILTIN_TYPEID_TYPES_H */
|
||||
BIN
ks/Models/FP56/Model_grt_rtw/codeInfo.mat
Executable file
BIN
ks/Models/FP56/Model_grt_rtw/codeInfo.mat
Executable file
Binary file not shown.
BIN
ks/Models/FP56/Model_grt_rtw/codedescriptor.dmr
Executable file
BIN
ks/Models/FP56/Model_grt_rtw/codedescriptor.dmr
Executable file
Binary file not shown.
BIN
ks/Models/FP56/Model_grt_rtw/compileInfo.mat
Executable file
BIN
ks/Models/FP56/Model_grt_rtw/compileInfo.mat
Executable file
Binary file not shown.
1169
ks/Models/FP56/Model_grt_rtw/multiword_types.h
Normal file
1169
ks/Models/FP56/Model_grt_rtw/multiword_types.h
Normal file
File diff suppressed because it is too large
Load Diff
163
ks/Models/FP56/Model_grt_rtw/rtGetInf.cpp
Executable file
163
ks/Models/FP56/Model_grt_rtw/rtGetInf.cpp
Executable file
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* rtGetInf.cpp
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.2
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Sat Mar 28 11:28:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#include "rtwtypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "rtGetInf.h"
|
||||
|
||||
}
|
||||
#include <stddef.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "rt_nonfinite.h"
|
||||
|
||||
}
|
||||
#define NumBitsPerChar 8U
|
||||
|
||||
extern "C" {
|
||||
/*
|
||||
* Initialize rtInf needed by the generated code.
|
||||
* Inf is initialized as non-signaling. Assumes IEEE.
|
||||
*/
|
||||
real_T rtGetInf(void)
|
||||
{
|
||||
size_t bitsPerReal{ sizeof(real_T) * (NumBitsPerChar) };
|
||||
|
||||
real_T inf{ 0.0 };
|
||||
|
||||
if (bitsPerReal == 32U) {
|
||||
inf = rtGetInfF();
|
||||
} else {
|
||||
uint16_T one{ 1U };
|
||||
|
||||
enum {
|
||||
LittleEndian,
|
||||
BigEndian
|
||||
} machByteOrder
|
||||
{
|
||||
(*((uint8_T *) &one) == 1U) ? LittleEndian : BigEndian
|
||||
};
|
||||
switch (machByteOrder) {
|
||||
case LittleEndian:
|
||||
{
|
||||
union {
|
||||
LittleEndianIEEEDouble bitVal;
|
||||
real_T fltVal;
|
||||
} tmpVal;
|
||||
|
||||
tmpVal.bitVal.words.wordH = 0x7FF00000U;
|
||||
tmpVal.bitVal.words.wordL = 0x00000000U;
|
||||
inf = tmpVal.fltVal;
|
||||
break;
|
||||
}
|
||||
|
||||
case BigEndian:
|
||||
{
|
||||
union {
|
||||
BigEndianIEEEDouble bitVal;
|
||||
real_T fltVal;
|
||||
} tmpVal;
|
||||
|
||||
tmpVal.bitVal.words.wordH = 0x7FF00000U;
|
||||
tmpVal.bitVal.words.wordL = 0x00000000U;
|
||||
inf = tmpVal.fltVal;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return inf;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize rtInfF needed by the generated code.
|
||||
* Inf is initialized as non-signaling. Assumes IEEE.
|
||||
*/
|
||||
real32_T rtGetInfF(void)
|
||||
{
|
||||
IEEESingle infF;
|
||||
infF.wordL.wordLuint = 0x7F800000U;
|
||||
return infF.wordL.wordLreal;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize rtMinusInf needed by the generated code.
|
||||
* Inf is initialized as non-signaling. Assumes IEEE.
|
||||
*/
|
||||
real_T rtGetMinusInf(void)
|
||||
{
|
||||
size_t bitsPerReal{ sizeof(real_T) * (NumBitsPerChar) };
|
||||
|
||||
real_T minf{ 0.0 };
|
||||
|
||||
if (bitsPerReal == 32U) {
|
||||
minf = rtGetMinusInfF();
|
||||
} else {
|
||||
uint16_T one{ 1U };
|
||||
|
||||
enum {
|
||||
LittleEndian,
|
||||
BigEndian
|
||||
} machByteOrder
|
||||
{
|
||||
(*((uint8_T *) &one) == 1U) ? LittleEndian : BigEndian
|
||||
};
|
||||
switch (machByteOrder) {
|
||||
case LittleEndian:
|
||||
{
|
||||
union {
|
||||
LittleEndianIEEEDouble bitVal;
|
||||
real_T fltVal;
|
||||
} tmpVal;
|
||||
|
||||
tmpVal.bitVal.words.wordH = 0xFFF00000U;
|
||||
tmpVal.bitVal.words.wordL = 0x00000000U;
|
||||
minf = tmpVal.fltVal;
|
||||
break;
|
||||
}
|
||||
|
||||
case BigEndian:
|
||||
{
|
||||
union {
|
||||
BigEndianIEEEDouble bitVal;
|
||||
real_T fltVal;
|
||||
} tmpVal;
|
||||
|
||||
tmpVal.bitVal.words.wordH = 0xFFF00000U;
|
||||
tmpVal.bitVal.words.wordL = 0x00000000U;
|
||||
minf = tmpVal.fltVal;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return minf;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize rtMinusInfF needed by the generated code.
|
||||
* Inf is initialized as non-signaling. Assumes IEEE.
|
||||
*/
|
||||
real32_T rtGetMinusInfF(void)
|
||||
{
|
||||
IEEESingle minfF;
|
||||
minfF.wordL.wordLuint = 0xFF800000U;
|
||||
return minfF.wordL.wordLreal;
|
||||
}
|
||||
}
|
||||
36
ks/Models/FP56/Model_grt_rtw/rtGetInf.h
Normal file
36
ks/Models/FP56/Model_grt_rtw/rtGetInf.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* rtGetInf.h
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.1
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Thu Mar 26 17:54:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_rtGetInf_h_
|
||||
#define RTW_HEADER_rtGetInf_h_
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "tmwtypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
extern real_T rtGetInf(void);
|
||||
extern real32_T rtGetInfF(void);
|
||||
extern real_T rtGetMinusInf(void);
|
||||
extern real32_T rtGetMinusInfF(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
#endif /* RTW_HEADER_rtGetInf_h_ */
|
||||
120
ks/Models/FP56/Model_grt_rtw/rtGetNaN.cpp
Executable file
120
ks/Models/FP56/Model_grt_rtw/rtGetNaN.cpp
Executable file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* rtGetNaN.cpp
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.2
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Sat Mar 28 11:28:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#include "rtwtypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "rtGetNaN.h"
|
||||
|
||||
}
|
||||
#include <stddef.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "rt_nonfinite.h"
|
||||
|
||||
}
|
||||
#define NumBitsPerChar 8U
|
||||
|
||||
extern "C" {
|
||||
/*
|
||||
* Initialize rtNaN needed by the generated code.
|
||||
* NaN is initialized as non-signaling. Assumes IEEE.
|
||||
*/
|
||||
real_T rtGetNaN(void)
|
||||
{
|
||||
size_t bitsPerReal{ sizeof(real_T) * (NumBitsPerChar) };
|
||||
|
||||
real_T nan{ 0.0 };
|
||||
|
||||
if (bitsPerReal == 32U) {
|
||||
nan = rtGetNaNF();
|
||||
} else {
|
||||
uint16_T one = 1U;
|
||||
enum {
|
||||
LittleEndian,
|
||||
BigEndian
|
||||
} machByteOrder
|
||||
{
|
||||
(*((uint8_T *) &one) == 1U) ? LittleEndian : BigEndian
|
||||
};
|
||||
switch (machByteOrder) {
|
||||
case LittleEndian:
|
||||
{
|
||||
union {
|
||||
LittleEndianIEEEDouble bitVal;
|
||||
real_T fltVal;
|
||||
} tmpVal;
|
||||
|
||||
tmpVal.bitVal.words.wordH = 0xFFF80000U;
|
||||
tmpVal.bitVal.words.wordL = 0x00000000U;
|
||||
nan = tmpVal.fltVal;
|
||||
break;
|
||||
}
|
||||
|
||||
case BigEndian:
|
||||
{
|
||||
union {
|
||||
BigEndianIEEEDouble bitVal;
|
||||
real_T fltVal;
|
||||
} tmpVal;
|
||||
|
||||
tmpVal.bitVal.words.wordH = 0x7FFFFFFFU;
|
||||
tmpVal.bitVal.words.wordL = 0xFFFFFFFFU;
|
||||
nan = tmpVal.fltVal;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nan;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize rtNaNF needed by the generated code.
|
||||
* NaN is initialized as non-signaling. Assumes IEEE.
|
||||
*/
|
||||
real32_T rtGetNaNF(void)
|
||||
{
|
||||
IEEESingle nanF{ { 0.0F } };
|
||||
|
||||
uint16_T one{ 1U };
|
||||
|
||||
enum {
|
||||
LittleEndian,
|
||||
BigEndian
|
||||
} machByteOrder
|
||||
{
|
||||
(*((uint8_T *) &one) == 1U) ? LittleEndian : BigEndian
|
||||
};
|
||||
switch (machByteOrder) {
|
||||
case LittleEndian:
|
||||
{
|
||||
nanF.wordL.wordLuint = 0xFFC00000U;
|
||||
break;
|
||||
}
|
||||
|
||||
case BigEndian:
|
||||
{
|
||||
nanF.wordL.wordLuint = 0x7FFFFFFFU;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return nanF.wordL.wordLreal;
|
||||
}
|
||||
}
|
||||
34
ks/Models/FP56/Model_grt_rtw/rtGetNaN.h
Normal file
34
ks/Models/FP56/Model_grt_rtw/rtGetNaN.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* rtGetNaN.h
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.1
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Thu Mar 26 17:54:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_rtGetNaN_h_
|
||||
#define RTW_HEADER_rtGetNaN_h_
|
||||
|
||||
#include "tmwtypes.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern real_T rtGetNaN(void);
|
||||
extern real32_T rtGetNaNF(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
#endif /* RTW_HEADER_rtGetNaN_h_ */
|
||||
0
ks/Models/FP56/Model_grt_rtw/rt_logging.h
Normal file
0
ks/Models/FP56/Model_grt_rtw/rt_logging.h
Normal file
109
ks/Models/FP56/Model_grt_rtw/rt_nonfinite.cpp
Executable file
109
ks/Models/FP56/Model_grt_rtw/rt_nonfinite.cpp
Executable file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* rt_nonfinite.cpp
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.2
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Sat Mar 28 11:28:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "rtGetNaN.h"
|
||||
|
||||
}
|
||||
extern "C"
|
||||
{
|
||||
|
||||
#include "rtGetInf.h"
|
||||
|
||||
}
|
||||
|
||||
#include <stddef.h>
|
||||
#include "rtwtypes.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "rt_nonfinite.h"
|
||||
|
||||
}
|
||||
#define NumBitsPerChar 8U
|
||||
|
||||
extern "C" {
|
||||
real_T rtInf;
|
||||
real_T rtMinusInf;
|
||||
real_T rtNaN;
|
||||
real32_T rtInfF;
|
||||
real32_T rtMinusInfF;
|
||||
real32_T rtNaNF;
|
||||
}
|
||||
extern "C"
|
||||
{
|
||||
/*
|
||||
* Initialize the rtInf, rtMinusInf, and rtNaN needed by the
|
||||
* generated code. NaN is initialized as non-signaling. Assumes IEEE.
|
||||
*/
|
||||
void rt_InitInfAndNaN(size_t realSize)
|
||||
{
|
||||
(void) (realSize);
|
||||
rtNaN = rtGetNaN();
|
||||
rtNaNF = rtGetNaNF();
|
||||
rtInf = rtGetInf();
|
||||
rtInfF = rtGetInfF();
|
||||
rtMinusInf = rtGetMinusInf();
|
||||
rtMinusInfF = rtGetMinusInfF();
|
||||
}
|
||||
|
||||
/* Test if value is infinite */
|
||||
boolean_T rtIsInf(real_T value)
|
||||
{
|
||||
return (boolean_T)((value==rtInf || value==rtMinusInf) ? 1U : 0U);
|
||||
}
|
||||
|
||||
/* Test if single-precision value is infinite */
|
||||
boolean_T rtIsInfF(real32_T value)
|
||||
{
|
||||
return (boolean_T)(((value)==rtInfF || (value)==rtMinusInfF) ? 1U : 0U);
|
||||
}
|
||||
|
||||
/* Test if value is not a number */
|
||||
boolean_T rtIsNaN(real_T value)
|
||||
{
|
||||
boolean_T result{ (boolean_T) 0 };
|
||||
|
||||
size_t bitsPerReal{ sizeof(real_T) * (NumBitsPerChar) };
|
||||
|
||||
if (bitsPerReal == 32U) {
|
||||
result = rtIsNaNF((real32_T)value);
|
||||
} else {
|
||||
union {
|
||||
LittleEndianIEEEDouble bitVal;
|
||||
real_T fltVal;
|
||||
} tmpVal;
|
||||
|
||||
tmpVal.fltVal = value;
|
||||
result = (boolean_T)((tmpVal.bitVal.words.wordH & 0x7FF00000) ==
|
||||
0x7FF00000 &&
|
||||
( (tmpVal.bitVal.words.wordH & 0x000FFFFF) != 0 ||
|
||||
(tmpVal.bitVal.words.wordL != 0) ));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Test if single-precision value is not a number */
|
||||
boolean_T rtIsNaNF(real32_T value)
|
||||
{
|
||||
IEEESingle tmp;
|
||||
tmp.wordL.wordLreal = value;
|
||||
return (boolean_T)( (tmp.wordL.wordLuint & 0x7F800000) == 0x7F800000 &&
|
||||
(tmp.wordL.wordLuint & 0x007FFFFF) != 0 );
|
||||
}
|
||||
}
|
||||
64
ks/Models/FP56/Model_grt_rtw/rt_nonfinite.h
Normal file
64
ks/Models/FP56/Model_grt_rtw/rt_nonfinite.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* rt_nonfinite.h
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.1
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Thu Mar 26 17:54:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_rt_nonfinite_h_
|
||||
#define RTW_HEADER_rt_nonfinite_h_
|
||||
#include <stddef.h>
|
||||
#include "tmwtypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
extern real_T rtInf;
|
||||
extern real_T rtMinusInf;
|
||||
extern real_T rtNaN;
|
||||
extern real32_T rtInfF;
|
||||
extern real32_T rtMinusInfF;
|
||||
extern real32_T rtNaNF;
|
||||
extern void rt_InitInfAndNaN(size_t realSize);
|
||||
extern boolean_T rtIsInf(real_T value);
|
||||
extern boolean_T rtIsInfF(real32_T value);
|
||||
extern boolean_T rtIsNaN(real_T value);
|
||||
extern boolean_T rtIsNaNF(real32_T value);
|
||||
struct BigEndianIEEEDouble {
|
||||
struct {
|
||||
uint32_T wordH;
|
||||
uint32_T wordL;
|
||||
} words;
|
||||
};
|
||||
|
||||
struct LittleEndianIEEEDouble {
|
||||
struct {
|
||||
uint32_T wordL;
|
||||
uint32_T wordH;
|
||||
} words;
|
||||
};
|
||||
|
||||
struct IEEESingle {
|
||||
union {
|
||||
real32_T wordLreal;
|
||||
uint32_T wordLuint;
|
||||
} wordL;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
#endif /* RTW_HEADER_rt_nonfinite_h_ */
|
||||
21
ks/Models/FP56/Model_grt_rtw/rtmodel.h
Normal file
21
ks/Models/FP56/Model_grt_rtw/rtmodel.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* rtmodel.h:
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.1
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Thu Mar 26 17:54:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_rtmodel_h_
|
||||
#define RTW_HEADER_rtmodel_h_
|
||||
#include "Model.h"
|
||||
#define GRTINTERFACE 0
|
||||
#endif /* RTW_HEADER_rtmodel_h_ */
|
||||
0
ks/Models/FP56/Model_grt_rtw/rtw_continuous.h
Normal file
0
ks/Models/FP56/Model_grt_rtw/rtw_continuous.h
Normal file
4
ks/Models/FP56/Model_grt_rtw/rtw_proj.tmw
Executable file
4
ks/Models/FP56/Model_grt_rtw/rtw_proj.tmw
Executable file
@@ -0,0 +1,4 @@
|
||||
Simulink Coder project for Model using . MATLAB root = C:\Program Files\MATLAB\R2022a. SimStruct date: 13-Nov-2021 07:40:36
|
||||
This file is generated by Simulink Coder for use by the make utility
|
||||
to determine when to rebuild objects when the name of the current Simulink Coder project changes.
|
||||
The rtwinfomat located at: ..\slprj\grt\Model\tmwinternal\binfo.mat
|
||||
0
ks/Models/FP56/Model_grt_rtw/rtw_solver.h
Normal file
0
ks/Models/FP56/Model_grt_rtw/rtw_solver.h
Normal file
37
ks/Models/FP56/Model_grt_rtw/rtwtypes.h
Normal file
37
ks/Models/FP56/Model_grt_rtw/rtwtypes.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* rtwtypes.h
|
||||
*
|
||||
* Code generation for model "Model".
|
||||
*
|
||||
* Model version : 1.1
|
||||
* Simulink Coder version : 9.7 (R2022a) 13-Nov-2021
|
||||
* C++ source code generated on : Thu Mar 26 17:54:04 2026
|
||||
*
|
||||
* Target selection: grt.tlc
|
||||
* Note: GRT includes extra infrastructure and instrumentation for prototyping
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTWTYPES_H
|
||||
#define RTWTYPES_H
|
||||
#ifndef POINTER_T
|
||||
#define POINTER_T
|
||||
|
||||
|
||||
typedef void * pointer_T;
|
||||
|
||||
#endif
|
||||
|
||||
/* Logical type definitions */
|
||||
#if (!defined(__cplusplus))
|
||||
#ifndef false
|
||||
#define false (0U)
|
||||
#endif
|
||||
|
||||
#ifndef true
|
||||
#define true (1U)
|
||||
#endif
|
||||
#endif
|
||||
#endif /* RTWTYPES_H */
|
||||
BIN
ks/Models/FP56/Model_grt_rtw/rtwtypeschksum.mat
Executable file
BIN
ks/Models/FP56/Model_grt_rtw/rtwtypeschksum.mat
Executable file
Binary file not shown.
2
ks/Models/FP56/Model_grt_rtw/setup_msvc.bat
Executable file
2
ks/Models/FP56/Model_grt_rtw/setup_msvc.bat
Executable file
@@ -0,0 +1,2 @@
|
||||
set "VSCMD_START_DIR=%CD%"
|
||||
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\VCVARSALL.BAT " amd64
|
||||
6
ks/Models/FP56/Model_grt_rtw/tmwinternal/simulink_cache.xml
Executable file
6
ks/Models/FP56/Model_grt_rtw/tmwinternal/simulink_cache.xml
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MF0 version="1.1" packageUris="http://schema.mathworks.com/mf0/SlCache/19700101">
|
||||
<slcache.FileAttributes type="slcache.FileAttributes" uuid="4627df2f-e397-46c6-ada1-b8556b8aa2bb">
|
||||
<checksum>NTDKrwFlC2KuvSUsd+ruOI8Dyv3nMQrYVV99I0a14oaIUdnclSWEQvWIPl0hwuNNm1YfQasnRGmWFrGc9HOJzA==</checksum>
|
||||
</slcache.FileAttributes>
|
||||
</MF0>
|
||||
888
ks/Models/FP56/Model_grt_rtw/tmwtypes.h
Executable file
888
ks/Models/FP56/Model_grt_rtw/tmwtypes.h
Executable file
@@ -0,0 +1,888 @@
|
||||
/*
|
||||
* Copyright 1984-2018 The MathWorks, Inc.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3))
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#ifndef tmwtypes_h
|
||||
#define tmwtypes_h
|
||||
|
||||
#ifndef __TMWTYPES__
|
||||
#define __TMWTYPES__
|
||||
/*
|
||||
* File : tmwtypes.h
|
||||
* Abstract:
|
||||
* Data types for use with MATLAB/SIMULINK and the Real-Time Workshop.
|
||||
*
|
||||
* When compiling stand-alone model code, data types can be overridden
|
||||
* via compiler switches.
|
||||
*
|
||||
* Define NO_FLOATS to eliminate reference to real_T, etc.
|
||||
*/
|
||||
|
||||
#ifdef MW_LIBTOOLING
|
||||
#include "mwstdint.h"
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
/* __STDC_VERSION__ version check below means "check for a C99 compiler".
|
||||
|
||||
Visual Studio (checked on versions 2015 and 2017) does
|
||||
not define __STDC_VERSION__, however it has stdbool.h available,
|
||||
thus a separate check for _MSC_VER below.
|
||||
*/
|
||||
#if defined(__APPLE_CC__) \
|
||||
|| (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) \
|
||||
|| (defined(_MSC_VER) && (_MSC_VER >= 1900))
|
||||
#ifndef tmwtypes_do_not_include_stdbool
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define LOGICAL_IS_A_TYPE
|
||||
#define SPARSE_GENERALIZATION
|
||||
|
||||
#ifdef NO_FLOATS
|
||||
# define double double_not_allowed
|
||||
# define float float_not_allowed
|
||||
#endif /*NO_FLOATS*/
|
||||
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef __MWERKS__
|
||||
# ifdef __STDC__
|
||||
# include <float.h>
|
||||
# else
|
||||
# ifndef FLT_MANT_DIG
|
||||
# define FLT_MANT_DIG 24
|
||||
# endif
|
||||
# ifndef DBL_MANT_DIG
|
||||
# define DBL_MANT_DIG 53
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /*NO_FLOATS*/
|
||||
|
||||
/*
|
||||
* The following data types cannot be overridden when building MEX files.
|
||||
*/
|
||||
#ifdef MATLAB_MEX_FILE
|
||||
# undef CHARACTER_T
|
||||
# undef INTEGER_T
|
||||
# undef BOOLEAN_T
|
||||
# undef REAL_T
|
||||
# undef TIME_T
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The uchar_T, ushort_T and ulong_T types are needed for compilers which do
|
||||
* not allow defines to be specified, at the command line, with spaces in them.
|
||||
*/
|
||||
|
||||
typedef unsigned char uchar_T;
|
||||
typedef unsigned short ushort_T;
|
||||
typedef unsigned long ulong_T;
|
||||
|
||||
#if (defined(_MSC_VER) && _MSC_VER >= 1500) \
|
||||
|| defined(__x86_64__) || defined(__LP64__) \
|
||||
|| defined(__LCC64__)
|
||||
|
||||
typedef unsigned long long ulonglong_T;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*=======================================================================*
|
||||
* Fixed width word size data types: *
|
||||
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
|
||||
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
|
||||
* real32_T, real64_T - 32 and 64 bit floating point numbers *
|
||||
*=======================================================================*/
|
||||
|
||||
/* When used with Real Time Workshop generated code, this
|
||||
* header file can be used with a variety of compilers.
|
||||
*
|
||||
* The compiler could be for an 8 bit embedded processor that
|
||||
* only had 8 bits per integer and 16 bits per long.
|
||||
* In that example, a 32 bit integer size is not even available.
|
||||
* This header file should be robust to that.
|
||||
*
|
||||
* For the case of an 8 bit processor, the preprocessor
|
||||
* may be limited to 16 bit math like its target. That limitation
|
||||
* would mean that 32 bit comparisons can't be done accurately.
|
||||
* To increase robustness to this, comparisons are done against
|
||||
* smaller values first. An inaccurate 32 bit comparison isn't
|
||||
* attempted if the 16 bit comparison has already succeeded.
|
||||
*
|
||||
* Limitations on preprocessor math can also be stricter than
|
||||
* for the target. There are known cases where a compiler
|
||||
* targeting processors with 64 bit longs can't do accurate
|
||||
* preprocessor comparisons on more than 32 bits.
|
||||
*/
|
||||
|
||||
/* Determine the number of bits for int, long, short, and char.
|
||||
* If one fails to be determined, set the number of bits to -1
|
||||
*/
|
||||
|
||||
#ifndef TMW_BITS_PER_INT
|
||||
# if INT_MAX == 0x7FL
|
||||
# define TMW_BITS_PER_INT 8
|
||||
# elif INT_MAX == 0x7FFFL
|
||||
# define TMW_BITS_PER_INT 16
|
||||
# elif INT_MAX == 0x7FFFFFFFL
|
||||
# define TMW_BITS_PER_INT 32
|
||||
# else
|
||||
# define TMW_BITS_PER_INT -1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_BITS_PER_LONG
|
||||
# if LONG_MAX == 0x7FL
|
||||
# define TMW_BITS_PER_LONG 8
|
||||
# elif LONG_MAX == 0x7FFFL
|
||||
# define TMW_BITS_PER_LONG 16
|
||||
# elif LONG_MAX == 0x7FFFFFFFL
|
||||
# define TMW_BITS_PER_LONG 32
|
||||
# else
|
||||
# define TMW_BITS_PER_LONG -1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_BITS_PER_SHRT
|
||||
# if SHRT_MAX == 0x7FL
|
||||
# define TMW_BITS_PER_SHRT 8
|
||||
# elif SHRT_MAX == 0x7FFFL
|
||||
# define TMW_BITS_PER_SHRT 16
|
||||
# elif SHRT_MAX == 0x7FFFFFFFL
|
||||
# define TMW_BITS_PER_SHRT 32
|
||||
# else
|
||||
# define TMW_BITS_PER_SHRT -1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_BITS_PER_SCHAR
|
||||
# if SCHAR_MAX == 0x7FL
|
||||
# define TMW_BITS_PER_SCHAR 8
|
||||
# elif SCHAR_MAX == 0x7FFFL
|
||||
# define TMW_BITS_PER_SCHAR 16
|
||||
# elif SCHAR_MAX == 0x7FFFFFFFL
|
||||
# define TMW_BITS_PER_SCHAR 32
|
||||
# else
|
||||
# define TMW_BITS_PER_SCHAR -1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef TMW_CHAR_SIGNED
|
||||
# if SCHAR_MAX == CHAR_MAX
|
||||
# define TMW_CHAR_SIGNED 1
|
||||
# else
|
||||
# define TMW_CHAR_SIGNED 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* It is common for one or more of the integer types
|
||||
* to be the same size. For example, on many embedded
|
||||
* processors, both shorts and ints are 16 bits. On
|
||||
* processors used for workstations, it is quite common
|
||||
* for both int and long to be 32 bits.
|
||||
* When there is more than one choice for typdef'ing
|
||||
* a portable type like int16_T or uint32_T, in
|
||||
* concept, it should not matter which choice is made.
|
||||
* However, some style guides and some code checking
|
||||
* tools do identify and complain about seemingly
|
||||
* irrelevant differences. For example, a code
|
||||
* checking tool may complain about an implicit
|
||||
* conversion from int to short even though both
|
||||
* are 16 bits. To reduce these types of
|
||||
* complaints, it is best to make int the
|
||||
* preferred choice when more than one is available.
|
||||
*/
|
||||
|
||||
#ifndef INT8_T
|
||||
# if defined(MW_LIBTOOLING)
|
||||
# define INT8_T int8_t
|
||||
# elif TMW_BITS_PER_INT == 8
|
||||
# define INT8_T int
|
||||
# elif TMW_BITS_PER_LONG == 8
|
||||
# define INT8_T long
|
||||
# elif TMW_BITS_PER_SCHAR == 8
|
||||
# define INT8_T signed char
|
||||
# elif TMW_BITS_PER_SHRT == 8
|
||||
# define INT8_T short
|
||||
# endif
|
||||
#endif
|
||||
#ifdef INT8_T
|
||||
typedef INT8_T int8_T;
|
||||
#endif
|
||||
|
||||
#ifndef UINT8_T
|
||||
# if defined(MW_LIBTOOLING)
|
||||
# define UINT8_T uint8_t
|
||||
# elif TMW_BITS_PER_INT == 8
|
||||
# define UINT8_T unsigned int
|
||||
# elif TMW_BITS_PER_LONG == 8
|
||||
# define UINT8_T unsigned long
|
||||
# elif TMW_BITS_PER_SCHAR == 8
|
||||
# define UINT8_T unsigned char
|
||||
# elif TMW_BITS_PER_SHRT == 8
|
||||
# define UINT8_T unsigned short
|
||||
# endif
|
||||
#endif
|
||||
#ifdef UINT8_T
|
||||
typedef UINT8_T uint8_T;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef INT16_T
|
||||
# if defined(MW_LIBTOOLING)
|
||||
# define INT16_T int16_t
|
||||
# elif TMW_BITS_PER_INT == 16
|
||||
# define INT16_T int
|
||||
# elif TMW_BITS_PER_LONG == 16
|
||||
# define INT16_T long
|
||||
# elif TMW_BITS_PER_SCHAR == 16
|
||||
# define INT16_T signed char
|
||||
# elif TMW_BITS_PER_SHRT == 16
|
||||
# define INT16_T short
|
||||
# endif
|
||||
#endif
|
||||
#ifdef INT16_T
|
||||
typedef INT16_T int16_T;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef UINT16_T
|
||||
# if defined(MW_LIBTOOLING)
|
||||
# define UINT16_T uint16_t
|
||||
# elif TMW_BITS_PER_INT == 16
|
||||
# define UINT16_T unsigned int
|
||||
# elif TMW_BITS_PER_LONG == 16
|
||||
# define UINT16_T unsigned long
|
||||
# elif TMW_BITS_PER_SCHAR == 16
|
||||
# define UINT16_T unsigned char
|
||||
# elif TMW_BITS_PER_SHRT == 16
|
||||
# define UINT16_T unsigned short
|
||||
# endif
|
||||
#endif
|
||||
#ifdef UINT16_T
|
||||
typedef UINT16_T uint16_T;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef INT32_T
|
||||
# if defined(MW_LIBTOOLING)
|
||||
# define INT32_T int32_t
|
||||
# elif TMW_BITS_PER_INT == 32
|
||||
# define INT32_T int
|
||||
# elif TMW_BITS_PER_LONG == 32
|
||||
# define INT32_T long
|
||||
# elif TMW_BITS_PER_SCHAR == 32
|
||||
# define INT32_T signed char
|
||||
# elif TMW_BITS_PER_SHRT == 32
|
||||
# define INT32_T short
|
||||
# endif
|
||||
#endif
|
||||
#ifdef INT32_T
|
||||
typedef INT32_T int32_T;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef UINT32_T
|
||||
# if defined(MW_LIBTOOLING)
|
||||
# define UINT32_T uint32_t
|
||||
# elif TMW_BITS_PER_INT == 32
|
||||
# define UINT32_T unsigned int
|
||||
# elif TMW_BITS_PER_LONG == 32
|
||||
# define UINT32_T unsigned long
|
||||
# elif TMW_BITS_PER_SCHAR == 32
|
||||
# define UINT32_T unsigned char
|
||||
# elif TMW_BITS_PER_SHRT == 32
|
||||
# define UINT32_T unsigned short
|
||||
# endif
|
||||
#endif
|
||||
#ifdef UINT32_T
|
||||
typedef UINT32_T uint32_T;
|
||||
#endif
|
||||
|
||||
/* The following is used to emulate smaller integer types when only
|
||||
* larger types are available. For example, compilers for TI C3x/C4x DSPs
|
||||
* define char and short to be 32 bits, so 8 and 16 bits are not directly
|
||||
* available. This target is commonly used with RTW rapid prototyping.
|
||||
* Other DSPs define char to be 16 bits, so 8 bits is not directly
|
||||
* available.
|
||||
*/
|
||||
#ifndef INT8_T
|
||||
# ifdef INT16_T
|
||||
# define INT8_T INT16_T
|
||||
typedef INT8_T int8_T;
|
||||
# else
|
||||
# ifdef INT32_T
|
||||
# define INT8_T INT32_T
|
||||
typedef INT8_T int8_T;
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT8_T
|
||||
# ifdef UINT16_T
|
||||
# define UINT8_T UINT16_T
|
||||
typedef UINT8_T uint8_T;
|
||||
# else
|
||||
# ifdef UINT32_T
|
||||
# define UINT8_T UINT32_T
|
||||
typedef UINT8_T uint8_T;
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef INT16_T
|
||||
# ifdef INT32_T
|
||||
# define INT16_T INT32_T
|
||||
typedef INT16_T int16_T;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_T
|
||||
# ifdef UINT32_T
|
||||
# define UINT16_T UINT32_T
|
||||
typedef UINT16_T uint16_T;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef REAL32_T
|
||||
# ifndef __MWERKS__
|
||||
# if FLT_MANT_DIG >= 23
|
||||
# define REAL32_T float
|
||||
# endif
|
||||
# else
|
||||
# define REAL32_T float
|
||||
# endif
|
||||
#endif
|
||||
#ifdef REAL32_T
|
||||
typedef REAL32_T real32_T;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef REAL64_T
|
||||
# ifndef __MWERKS__
|
||||
# if DBL_MANT_DIG >= 52
|
||||
# define REAL64_T double
|
||||
# endif
|
||||
# else
|
||||
# define REAL64_T double
|
||||
# endif
|
||||
#endif
|
||||
#ifdef REAL64_T
|
||||
typedef REAL64_T real64_T;
|
||||
#endif
|
||||
|
||||
#endif /* NO_FLOATS*/
|
||||
|
||||
/*=======================================================================*
|
||||
* Fixed width word size data types: *
|
||||
* int64_T - signed 64 bit integers *
|
||||
* uint64_T - unsigned 64 bit integers *
|
||||
*=======================================================================*/
|
||||
|
||||
# if defined(MW_LIBTOOLING)
|
||||
# ifdef INT64_T
|
||||
# undef INT64_T
|
||||
# endif
|
||||
# define INT64_T int64_t
|
||||
# ifdef UINT64_T
|
||||
# undef UINT64_T
|
||||
# endif
|
||||
# define UINT64_T uint64_t
|
||||
# endif
|
||||
#if !defined(INT64_T) || !defined(UINT64_T) || !defined(FMT64)
|
||||
# if defined(__APPLE__) || defined(__clang__)
|
||||
# ifndef INT64_T
|
||||
# define INT64_T long long
|
||||
# endif
|
||||
# ifndef UINT64_T
|
||||
# define UINT64_T unsigned long long
|
||||
# endif
|
||||
# ifndef FMT64
|
||||
# define FMT64 "ll"
|
||||
# endif
|
||||
# if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
|
||||
# define INT_TYPE_64_IS_LONG
|
||||
# endif
|
||||
# elif (defined(__x86_64__) || defined(__LP64__))&& !defined(__MINGW64__)
|
||||
# ifndef INT64_T
|
||||
# define INT64_T long
|
||||
# endif
|
||||
# ifndef UINT64_T
|
||||
# define UINT64_T unsigned long
|
||||
# endif
|
||||
# ifndef FMT64
|
||||
# define FMT64 "l"
|
||||
# endif
|
||||
# if !defined(INT_TYPE_64_IS_LONG)
|
||||
# define INT_TYPE_64_IS_LONG
|
||||
# endif
|
||||
# elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \
|
||||
|| (defined(__WATCOMC__) && __WATCOMC__ >= 1100)
|
||||
# ifndef INT64_T
|
||||
# define INT64_T __int64
|
||||
# endif
|
||||
# ifndef UINT64_T
|
||||
# define UINT64_T unsigned __int64
|
||||
# endif
|
||||
# ifndef FMT64
|
||||
# define FMT64 "I64"
|
||||
# endif
|
||||
# elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) \
|
||||
|| defined(__LCC64__)
|
||||
# ifndef INT64_T
|
||||
# define INT64_T long long
|
||||
# endif
|
||||
# ifndef UINT64_T
|
||||
# define UINT64_T unsigned long long
|
||||
# endif
|
||||
# ifndef FMT64
|
||||
# define FMT64 "ll"
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(INT64_T)
|
||||
# if defined(__GNUC__) && \
|
||||
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >=9)))
|
||||
__extension__
|
||||
# endif
|
||||
typedef INT64_T int64_T;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64) || (defined(__APPLE__) && defined(__LP64__)) \
|
||||
|| defined(__x86_64__) \
|
||||
|| defined(__LP64__)
|
||||
# define INT_TYPE_64_IS_SUPPORTED
|
||||
#endif
|
||||
|
||||
#if defined(UINT64_T)
|
||||
# if defined(__GNUC__) && \
|
||||
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >=9)))
|
||||
__extension__
|
||||
# endif
|
||||
typedef UINT64_T uint64_T;
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
* Format string modifiers for using size_t variables in printf statements. *
|
||||
*===========================================================================*/
|
||||
|
||||
#ifndef FMT_SIZE_T
|
||||
# if (defined( __GNUC__ ) || defined(_STDC_C99))&& !defined(__MINGW64__)
|
||||
# define FMT_SIZE_T "z"
|
||||
# elif defined (__WATCOMC__)
|
||||
# define FMT_SIZE_T "l"
|
||||
# elif defined (_WIN32 )
|
||||
# define FMT_SIZE_T "I"
|
||||
# else
|
||||
# define FMT_SIZE_T "l"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef FMT_PTRDIFF_T
|
||||
# if defined(__APPLE__)
|
||||
# define FMT_PTRDIFF_T "l"
|
||||
# elif defined( __GNUC__ ) || defined(_STDC_C99)
|
||||
# define FMT_PTRDIFF_T "t"
|
||||
# elif defined (__WATCOMC__)
|
||||
# define FMT_PTRDIFF_T "l"
|
||||
# elif defined (_WIN32 )
|
||||
# define FMT_PTRDIFF_T "I"
|
||||
# else
|
||||
# define FMT_PTRDIFF_T "l"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
* General or logical data types where the word size is not guaranteed. *
|
||||
* real_T - possible settings include real32_T or real64_T *
|
||||
* time_T - possible settings include real32_T or real64_T *
|
||||
* boolean_T *
|
||||
* char_T *
|
||||
* int_T *
|
||||
* uint_T *
|
||||
* byte_T *
|
||||
*===========================================================================*/
|
||||
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef REAL_T
|
||||
# ifdef REAL64_T
|
||||
# define REAL_T real64_T
|
||||
# else
|
||||
# ifdef REAL32_T
|
||||
# define REAL_T real32_T
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#ifdef REAL_T
|
||||
typedef REAL_T real_T;
|
||||
#endif
|
||||
|
||||
#ifndef TIME_T
|
||||
# ifdef REAL_T
|
||||
# define TIME_T real_T
|
||||
# endif
|
||||
#endif
|
||||
#ifdef TIME_T
|
||||
typedef TIME_T time_T;
|
||||
#endif
|
||||
|
||||
#endif /* NO_FLOATS */
|
||||
|
||||
#ifndef BOOLEAN_T
|
||||
# if defined(UINT8_T)
|
||||
# define BOOLEAN_T UINT8_T
|
||||
# else
|
||||
# define BOOLEAN_T unsigned int
|
||||
# endif
|
||||
#endif
|
||||
typedef BOOLEAN_T boolean_T;
|
||||
|
||||
|
||||
#ifndef CHARACTER_T
|
||||
# define CHARACTER_T char
|
||||
#endif
|
||||
typedef CHARACTER_T char_T;
|
||||
|
||||
|
||||
#ifndef INTEGER_T
|
||||
# define INTEGER_T int
|
||||
#endif
|
||||
typedef INTEGER_T int_T;
|
||||
|
||||
|
||||
#ifndef UINTEGER_T
|
||||
# define UINTEGER_T unsigned
|
||||
#endif
|
||||
typedef UINTEGER_T uint_T;
|
||||
|
||||
|
||||
#ifndef BYTE_T
|
||||
# define BYTE_T unsigned char
|
||||
#endif
|
||||
typedef BYTE_T byte_T;
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* Define Complex Structures *
|
||||
*===========================================================================*/
|
||||
#ifndef NO_FLOATS
|
||||
|
||||
#ifndef CREAL32_T
|
||||
# ifdef REAL32_T
|
||||
typedef struct {
|
||||
real32_T re, im;
|
||||
} creal32_T;
|
||||
# define CREAL32_T creal32_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CREAL64_T
|
||||
# ifdef REAL64_T
|
||||
typedef struct {
|
||||
real64_T re, im;
|
||||
} creal64_T;
|
||||
# define CREAL64_T creal64_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CREAL_T
|
||||
# ifdef REAL_T
|
||||
typedef struct {
|
||||
real_T re, im;
|
||||
} creal_T;
|
||||
# define CREAL_T creal_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* NO_FLOATS */
|
||||
|
||||
#ifndef CINT8_T
|
||||
# ifdef INT8_T
|
||||
typedef struct {
|
||||
int8_T re, im;
|
||||
} cint8_T;
|
||||
# define CINT8_T cint8_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT8_T
|
||||
# ifdef UINT8_T
|
||||
typedef struct {
|
||||
uint8_T re, im;
|
||||
} cuint8_T;
|
||||
# define CUINT8_T cuint8_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CINT16_T
|
||||
# ifdef INT16_T
|
||||
typedef struct {
|
||||
int16_T re, im;
|
||||
} cint16_T;
|
||||
# define CINT16_T cint16_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT16_T
|
||||
# ifdef UINT16_T
|
||||
typedef struct {
|
||||
uint16_T re, im;
|
||||
} cuint16_T;
|
||||
# define CUINT16_T cuint16_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CINT32_T
|
||||
# ifdef INT32_T
|
||||
typedef struct {
|
||||
int32_T re, im;
|
||||
} cint32_T;
|
||||
# define CINT32_T cint32_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT32_T
|
||||
# ifdef UINT32_T
|
||||
typedef struct {
|
||||
uint32_T re, im;
|
||||
} cuint32_T;
|
||||
# define CUINT32_T cuint32_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CINT64_T
|
||||
# ifdef INT64_T
|
||||
typedef struct {
|
||||
int64_T re, im;
|
||||
} cint64_T;
|
||||
# define CINT64_T cint64_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CUINT64_T
|
||||
# ifdef UINT64_T
|
||||
typedef struct {
|
||||
uint64_T re, im;
|
||||
} cuint64_T;
|
||||
# define CUINT64_T cuint64_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*=======================================================================*
|
||||
* Min and Max: *
|
||||
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
|
||||
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
|
||||
*=======================================================================*/
|
||||
|
||||
#define MAX_int8_T ((int8_T)(127)) /* 127 */
|
||||
#define MIN_int8_T ((int8_T)(-128)) /* -128 */
|
||||
#define MAX_uint8_T ((uint8_T)(255)) /* 255 */
|
||||
#define MIN_uint8_T ((uint8_T)(0))
|
||||
|
||||
#define MAX_int16_T ((int16_T)(32767)) /* 32767 */
|
||||
#define MIN_int16_T ((int16_T)(-32768)) /* -32768 */
|
||||
#define MAX_uint16_T ((uint16_T)(65535)) /* 65535 */
|
||||
#define MIN_uint16_T ((uint16_T)(0))
|
||||
|
||||
#define MAX_int32_T ((int32_T)(2147483647)) /* 2147483647 */
|
||||
#define MIN_int32_T ((int32_T)(-2147483647-1)) /* -2147483648 */
|
||||
#define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU)) /* 4294967295 */
|
||||
#define MIN_uint32_T ((uint32_T)(0))
|
||||
|
||||
#if defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \
|
||||
|| (defined(__WATCOMC__) && __WATCOMC__ >= 1100) \
|
||||
|| defined(__LCC64__)
|
||||
# ifdef INT64_T
|
||||
# define MAX_int64_T ((int64_T)(9223372036854775807LL))
|
||||
# define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL))
|
||||
# endif
|
||||
# ifdef UINT64_T
|
||||
# define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL))
|
||||
# define MIN_uint64_T ((uint64_T)(0))
|
||||
# endif
|
||||
#else
|
||||
# ifdef INT64_T
|
||||
# ifdef INT_TYPE_64_IS_LONG
|
||||
# define MAX_int64_T ((int64_T)(9223372036854775807L))
|
||||
# define MIN_int64_T ((int64_T)(-9223372036854775807L-1L))
|
||||
# else
|
||||
# define MAX_int64_T ((int64_T)(9223372036854775807LL))
|
||||
# define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL))
|
||||
# endif
|
||||
# endif
|
||||
# ifdef UINT64_T
|
||||
# ifdef INT_TYPE_64_IS_LONG
|
||||
# define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFUL))
|
||||
# define MIN_uint64_T ((uint64_T)(0))
|
||||
# else
|
||||
# define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL))
|
||||
# define MIN_uint64_T ((uint64_T)(0))
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) && !defined(__clang__))
|
||||
|
||||
/* Conversion from unsigned __int64 to double is not implemented in Visual Studio
|
||||
* and results in a compile error, thus the value must first be cast to
|
||||
* signed __int64, and then to double.
|
||||
*
|
||||
* If the 64 bit int value is greater than 2^63-1, which is the signed int64 max,
|
||||
* the macro below provides a workaround for casting a uint64 value to a double
|
||||
* in windows.
|
||||
*/
|
||||
# define uint64_to_double(u) ( ((u) > _I64_MAX) ? \
|
||||
(double)(__int64)((u) - _I64_MAX - 1) + (double)_I64_MAX + 1: \
|
||||
(double)(__int64)(u) )
|
||||
|
||||
/* The following inline function should only be used in the macro double_to_uint64,
|
||||
* as it only handles the specfic range of double between 2^63 and 2^64-1 */
|
||||
__forceinline
|
||||
uint64_T double_to_uint64_helper(double d) {
|
||||
union double_to_uint64_union_type {
|
||||
double dd;
|
||||
uint64_T i64;
|
||||
} di;
|
||||
di.dd = d;
|
||||
return (((di.i64 & 0x000fffffffffffff) | 0x0010000000000000) << 11);
|
||||
}
|
||||
|
||||
/* The largest double value that can be cast to uint64 in windows is the
|
||||
* signed int64 max, which is 2^63-1. The macro below provides
|
||||
* a workaround for casting large double values to uint64 in windows.
|
||||
*/
|
||||
/* The magic number 18446744073709551616.0 is 2^64 */
|
||||
/* The magic number 9223372036854775808.0 is 2^63 */
|
||||
# define double_to_uint64(d) ( ((d) >= 18446744073709551616.0) ? \
|
||||
0xffffffffffffffffULL : \
|
||||
((d) >= 0.0) ? \
|
||||
((d) >= 9223372036854775808.0) ? \
|
||||
double_to_uint64_helper(d) : \
|
||||
(unsigned __int64)(d) : \
|
||||
0ULL )
|
||||
#else
|
||||
# define uint64_to_double(u) ((double)(u))
|
||||
# if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__TICCSC__)
|
||||
/* double_to_uint64 defined only for MSVC and UNIX */
|
||||
# else
|
||||
# define double_to_uint64(d) ( ((d) >= 18446744073709551616.0) ? \
|
||||
(unsigned long long) 0xffffffffffffffffULL : \
|
||||
((d) >= 0) ? (unsigned long long)(d) : (unsigned long long) 0 )
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
|
||||
|
||||
#ifndef _bool_T
|
||||
#define _bool_T
|
||||
|
||||
typedef boolean_T bool;
|
||||
|
||||
#ifndef false
|
||||
#define false (0)
|
||||
#endif
|
||||
#ifndef true
|
||||
#define true (1)
|
||||
#endif
|
||||
|
||||
#endif /* _bool_T */
|
||||
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
/*
|
||||
* This software assumes that the code is being compiled on a target using a
|
||||
* 2's complement representation for signed integer values.
|
||||
*/
|
||||
#if ((SCHAR_MIN + 1) != -SCHAR_MAX)
|
||||
#error "This code must be compiled using a 2's complement representation for signed integer values"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Maximum length of a MATLAB identifier (function/variable/model)
|
||||
* including the null-termination character.
|
||||
*/
|
||||
#define TMW_NAME_LENGTH_MAX 64
|
||||
|
||||
/*
|
||||
* Maximum values for indices and dimensions
|
||||
*/
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef MX_COMPAT_32
|
||||
typedef int mwSize;
|
||||
typedef int mwIndex;
|
||||
typedef int mwSignedIndex;
|
||||
#else
|
||||
typedef size_t mwSize; /* unsigned pointer-width integer */
|
||||
typedef size_t mwIndex; /* unsigned pointer-width integer */
|
||||
typedef ptrdiff_t mwSignedIndex; /* a signed pointer-width integer */
|
||||
#endif
|
||||
|
||||
/* for the individual dim */
|
||||
/* If updating SLSize or SLIndex, update defintions in sl_types_def.h
|
||||
as well. */
|
||||
#ifndef SLSIZE_SLINDEX
|
||||
#define SLSIZE_SLINDEX
|
||||
#ifdef INT_TYPE_64_IS_SUPPORTED
|
||||
typedef int64_T SLIndex;
|
||||
typedef int64_T SLSize;
|
||||
#else
|
||||
typedef int SLIndex;
|
||||
typedef int SLSize;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* for the total size */
|
||||
#define SLIndexType size_t
|
||||
#define INVALID_SIZET_VALUE (std::numeric_limits<SLIndexType>::max())
|
||||
#define MAX_VALID_SIZET_VALUE (std::numeric_limits<SLIndexType>::max() -1)
|
||||
|
||||
|
||||
#if (defined(_LP64) || defined(_WIN64)) && !defined(MX_COMPAT_32)
|
||||
/* Currently 2^48 based on hardware limitations */
|
||||
# define MWSIZE_MAX 281474976710655UL
|
||||
# define MWINDEX_MAX 281474976710655UL
|
||||
# define MWSINDEX_MAX 281474976710655L
|
||||
# define MWSINDEX_MIN -281474976710655L
|
||||
#else
|
||||
# define MWSIZE_MAX 2147483647UL
|
||||
# define MWINDEX_MAX 2147483647UL
|
||||
# define MWSINDEX_MAX 2147483647L
|
||||
# define MWSINDEX_MIN -2147483647L
|
||||
#endif
|
||||
#define MWSIZE_MIN 0UL
|
||||
#define MWINDEX_MIN 0UL
|
||||
|
||||
/** UTF-16 character type */
|
||||
|
||||
#if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT)
|
||||
typedef char16_t CHAR16_T;
|
||||
#define U16_STRING_LITERAL_PREFIX u
|
||||
#elif defined(_MSC_VER)
|
||||
typedef wchar_t CHAR16_T;
|
||||
#define U16_STRING_LITERAL_PREFIX L
|
||||
#else
|
||||
typedef UINT16_T CHAR16_T;
|
||||
#endif
|
||||
|
||||
#endif /* __TMWTYPES__ */
|
||||
|
||||
#endif /* tmwtypes_h */
|
||||
Reference in New Issue
Block a user