添加了lib ;删除了重复定义的.c;添加了未包含的.c .h

This commit is contained in:
zhouzan
2023-07-08 14:03:16 +08:00
parent 2db6cfab9f
commit 7514929f24
11 changed files with 522 additions and 410 deletions
@@ -1,80 +0,0 @@
/*
* File: look1_binlcapw.c
*
* Code generated for Simulink model 'cr929_SIL'.
*
* Model version : 1.2568
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Thu Jul 6 14:12:38 2023
*/
#include "rtwtypes.h"
#include "look1_binlcapw.h"
real_T look1_binlcapw(real_T u0, const real_T bp0[], const real_T table[],
uint32_T maxIndex)
{
real_T y;
real_T frac;
uint32_T iRght;
uint32_T iLeft;
uint32_T bpIdx;
/* Column-major Lookup 1-D
Search method: 'binary'
Use previous index: 'off'
Interpolation method: 'Linear point-slope'
Extrapolation method: 'Clip'
Use last breakpoint for index at or above upper limit: 'on'
Remove protection against out-of-range input in generated code: 'off'
*/
/* Prelookup - Index and Fraction
Index Search method: 'binary'
Extrapolation method: 'Clip'
Use previous index: 'off'
Use last breakpoint for index at or above upper limit: 'on'
Remove protection against out-of-range input in generated code: 'off'
*/
if (u0 <= bp0[0U]) {
iLeft = 0U;
frac = 0.0;
} else if (u0 < bp0[maxIndex]) {
/* Binary Search */
bpIdx = maxIndex >> 1U;
iLeft = 0U;
iRght = maxIndex;
while (iRght - iLeft > 1U) {
if (u0 < bp0[bpIdx]) {
iRght = bpIdx;
} else {
iLeft = bpIdx;
}
bpIdx = (iRght + iLeft) >> 1U;
}
frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]);
} else {
iLeft = maxIndex;
frac = 0.0;
}
/* Column-major Interpolation 1-D
Interpolation method: 'Linear point-slope'
Use last breakpoint for index at or above upper limit: 'on'
Overflow mode: 'portable wrapping'
*/
if (iLeft == maxIndex) {
y = table[iLeft];
} else {
y = (table[iLeft + 1U] - table[iLeft]) * frac + table[iLeft];
}
return y;
}
/*
* File trailer for generated code.
*
* [EOF]
*/
@@ -1,73 +0,0 @@
/*
* File: look1_binlxpw.c
*
* Code generated for Simulink model 'cr929_SIL'.
*
* Model version : 1.2568
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Thu Jul 6 14:12:38 2023
*/
#include "rtwtypes.h"
#include "look1_binlxpw.h"
real_T look1_binlxpw(real_T u0, const real_T bp0[], const real_T table[],
uint32_T maxIndex)
{
real_T frac;
uint32_T iRght;
uint32_T iLeft;
uint32_T bpIdx;
/* Column-major Lookup 1-D
Search method: 'binary'
Use previous index: 'off'
Interpolation method: 'Linear point-slope'
Extrapolation method: 'Linear'
Use last breakpoint for index at or above upper limit: 'off'
Remove protection against out-of-range input in generated code: 'off'
*/
/* Prelookup - Index and Fraction
Index Search method: 'binary'
Extrapolation method: 'Linear'
Use previous index: 'off'
Use last breakpoint for index at or above upper limit: 'off'
Remove protection against out-of-range input in generated code: 'off'
*/
if (u0 <= bp0[0U]) {
iLeft = 0U;
frac = (u0 - bp0[0U]) / (bp0[1U] - bp0[0U]);
} else if (u0 < bp0[maxIndex]) {
/* Binary Search */
bpIdx = maxIndex >> 1U;
iLeft = 0U;
iRght = maxIndex;
while (iRght - iLeft > 1U) {
if (u0 < bp0[bpIdx]) {
iRght = bpIdx;
} else {
iLeft = bpIdx;
}
bpIdx = (iRght + iLeft) >> 1U;
}
frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]);
} else {
iLeft = maxIndex - 1U;
frac = (u0 - bp0[maxIndex - 1U]) / (bp0[maxIndex] - bp0[maxIndex - 1U]);
}
/* Column-major Interpolation 1-D
Interpolation method: 'Linear point-slope'
Use last breakpoint for index at or above upper limit: 'off'
Overflow mode: 'portable wrapping'
*/
return (table[iLeft + 1U] - table[iLeft]) * frac + table[iLeft];
}
/*
* File trailer for generated code.
*
* [EOF]
*/
@@ -1,131 +0,0 @@
/*
* File: look2_binlcapw.c
*
* Code generated for Simulink model 'cr929_SIL'.
*
* Model version : 1.2568
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Thu Jul 6 14:12:38 2023
*/
#include "rtwtypes.h"
#include "look2_binlcapw.h"
real_T look2_binlcapw(real_T u0, real_T u1, const real_T bp0[], const real_T
bp1[], const real_T table[], const uint32_T maxIndex[],
uint32_T stride)
{
real_T y;
real_T frac;
uint32_T bpIndices[2];
real_T fractions[2];
real_T yR_1d;
uint32_T iRght;
uint32_T bpIdx;
uint32_T iLeft;
/* Column-major Lookup 2-D
Search method: 'binary'
Use previous index: 'off'
Interpolation method: 'Linear point-slope'
Extrapolation method: 'Clip'
Use last breakpoint for index at or above upper limit: 'on'
Remove protection against out-of-range input in generated code: 'off'
*/
/* Prelookup - Index and Fraction
Index Search method: 'binary'
Extrapolation method: 'Clip'
Use previous index: 'off'
Use last breakpoint for index at or above upper limit: 'on'
Remove protection against out-of-range input in generated code: 'off'
*/
if (u0 <= bp0[0U]) {
iLeft = 0U;
frac = 0.0;
} else if (u0 < bp0[maxIndex[0U]]) {
/* Binary Search */
bpIdx = maxIndex[0U] >> 1U;
iLeft = 0U;
iRght = maxIndex[0U];
while (iRght - iLeft > 1U) {
if (u0 < bp0[bpIdx]) {
iRght = bpIdx;
} else {
iLeft = bpIdx;
}
bpIdx = (iRght + iLeft) >> 1U;
}
frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]);
} else {
iLeft = maxIndex[0U];
frac = 0.0;
}
fractions[0U] = frac;
bpIndices[0U] = iLeft;
/* Prelookup - Index and Fraction
Index Search method: 'binary'
Extrapolation method: 'Clip'
Use previous index: 'off'
Use last breakpoint for index at or above upper limit: 'on'
Remove protection against out-of-range input in generated code: 'off'
*/
if (u1 <= bp1[0U]) {
iLeft = 0U;
frac = 0.0;
} else if (u1 < bp1[maxIndex[1U]]) {
/* Binary Search */
bpIdx = maxIndex[1U] >> 1U;
iLeft = 0U;
iRght = maxIndex[1U];
while (iRght - iLeft > 1U) {
if (u1 < bp1[bpIdx]) {
iRght = bpIdx;
} else {
iLeft = bpIdx;
}
bpIdx = (iRght + iLeft) >> 1U;
}
frac = (u1 - bp1[iLeft]) / (bp1[iLeft + 1U] - bp1[iLeft]);
} else {
iLeft = maxIndex[1U];
frac = 0.0;
}
/* Column-major Interpolation 2-D
Interpolation method: 'Linear point-slope'
Use last breakpoint for index at or above upper limit: 'on'
Overflow mode: 'portable wrapping'
*/
bpIdx = iLeft * stride + bpIndices[0U];
if (bpIndices[0U] == maxIndex[0U]) {
y = table[bpIdx];
} else {
y = (table[bpIdx + 1U] - table[bpIdx]) * fractions[0U] + table[bpIdx];
}
if (iLeft == maxIndex[1U]) {
} else {
bpIdx += stride;
if (bpIndices[0U] == maxIndex[0U]) {
yR_1d = table[bpIdx];
} else {
yR_1d = (table[bpIdx + 1U] - table[bpIdx]) * fractions[0U] + table[bpIdx];
}
y += (yR_1d - y) * frac;
}
return y;
}
/*
* File trailer for generated code.
*
* [EOF]
*/
@@ -1,56 +0,0 @@
/*
* File: rt_modd_snf.c
*
* Code generated for Simulink model 'cr929_SIL'.
*
* Model version : 1.2568
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Thu Jul 6 14:12:38 2023
*/
#include "rtwtypes.h"
#include "rtGetNaN.h"
#include "rt_nonfinite.h"
#include <float.h>
#include <math.h>
#include "rt_modd_snf.h"
real_T rt_modd_snf(real_T u0, real_T u1)
{
real_T y;
boolean_T yEq;
real_T q;
y = u0;
if (rtIsNaN(u0) || rtIsInf(u0) || (rtIsNaN(u1) || rtIsInf(u1))) {
if (u1 != 0.0) {
y = (rtNaN);
}
} else if (u0 == 0.0) {
y = u1 * 0.0;
} else {
if (u1 != 0.0) {
y = fmod(u0, u1);
yEq = (y == 0.0);
if ((!yEq) && (u1 > floor(u1))) {
q = fabs(u0 / u1);
yEq = (fabs(q - floor(q + 0.5)) <= DBL_EPSILON * q);
}
if (yEq) {
y = u1 * 0.0;
} else {
if ((u0 < 0.0) != (u1 < 0.0)) {
y += u1;
}
}
}
}
return y;
}
/*
* File trailer for generated code.
*
* [EOF]
*/
@@ -1,68 +0,0 @@
/*
* File: rt_powd_snf.c
*
* Code generated for Simulink model 'cr929_SIL'.
*
* Model version : 1.2568
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Thu Jul 6 14:12:38 2023
*/
#include "rtwtypes.h"
#include "rtGetNaN.h"
#include "rt_nonfinite.h"
#include "rtGetInf.h"
#include <math.h>
#include "rt_powd_snf.h"
real_T rt_powd_snf(real_T u0, real_T u1)
{
real_T y;
real_T tmp;
real_T tmp_0;
if (rtIsNaN(u0) || rtIsNaN(u1)) {
y = (rtNaN);
} else {
tmp = fabs(u0);
tmp_0 = fabs(u1);
if (rtIsInf(u1)) {
if (tmp == 1.0) {
y = 1.0;
} else if (tmp > 1.0) {
if (u1 > 0.0) {
y = (rtInf);
} else {
y = 0.0;
}
} else if (u1 > 0.0) {
y = 0.0;
} else {
y = (rtInf);
}
} else if (tmp_0 == 0.0) {
y = 1.0;
} else if (tmp_0 == 1.0) {
if (u1 > 0.0) {
y = u0;
} else {
y = 1.0 / u0;
}
} else if (u1 == 2.0) {
y = u0 * u0;
} else if ((u1 == 0.5) && (u0 >= 0.0)) {
y = sqrt(u0);
} else if ((u0 < 0.0) && (u1 > floor(u1))) {
y = (rtNaN);
} else {
y = pow(u0, u1);
}
}
return y;
}
/*
* File trailer for generated code.
*
* [EOF]
*/