123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- //
- // File: CGaussianFilter.cpp
- //
- // MATLAB Coder version : 4.3
- // C/C++ source code generated on : 12-Jan-2022 14:46:32
- //
- // Include Files
- #include "CGaussianFilter.h"
- #include "GaussianFilter_data.h"
- #include "GaussianFilter_emxutil.h"
- #include "conv2AXPY.h"
- #include <math.h>
- // Function Definitions
- //
- // Arguments : void
- // Return Type : void
- //
- CGaussianFilter::~CGaussianFilter()
- {
- omp_destroy_nest_lock(&emlrtNestLockGlobal);
- }
- //
- // Arguments : void
- // Return Type : void
- //
- CGaussianFilter::CGaussianFilter()
- {
- omp_init_nest_lock(&emlrtNestLockGlobal);
- }
- //
- // Arguments : const emxArray_real_T *x
- // emxArray_real_T *xlpf
- // Return Type : void
- //
- void CGaussianFilter::GaussianFilter(const emxArray_real_T *x, emxArray_real_T
- *xlpf)
- {
- emxArray_real_T *work;
- int32_T rank;
- int32_T k;
- static const real_T s[25] = { 0.22354978351691851, 0.0, 0.0, 0.0, 0.0, 0.0,
- 3.1892324657149476E-17, 0.0, 0.0, 0.0, 0.0, 0.0, 8.1422304240527224E-18, 0.0,
- 0.0, 0.0, 0.0, 0.0, 6.5350494864904178E-19, 0.0, 0.0, 0.0, 0.0, 0.0,
- 2.4277338668394078E-34 };
- int32_T nb;
- int32_T i;
- int32_T u1;
- int32_T jlo;
- int32_T ix;
- static const real_T hrow[5] = { 0.1200783842432135, 0.23388075658535037,
- 0.29208171834287255, 0.23388075658535035, 0.1200783842432135 };
- emxInit_real_T(&work, 2);
- if (25 <= x->size[1]) {
- frexp(2.4277338668394078E-34, &rank);
- rank = 0;
- for (k = 0; k < 5; k++) {
- if (s[k + 5 * k] > 2.1382117680737565E-49) {
- rank++;
- }
- }
- if (rank == 1) {
- nb = x->size[1];
- i = work->size[0] * work->size[1];
- work->size[0] = 1;
- work->size[1] = x->size[1];
- emxEnsureCapacity_real_T(work, i);
- rank = x->size[1];
- for (i = 0; i < rank; i++) {
- work->data[i] = 0.0;
- }
- i = xlpf->size[0] * xlpf->size[1];
- xlpf->size[0] = 1;
- xlpf->size[1] = x->size[1];
- emxEnsureCapacity_real_T(xlpf, i);
- rank = x->size[1];
- for (i = 0; i < rank; i++) {
- xlpf->data[i] = 0.0;
- }
- for (rank = 0; rank < nb; rank++) {
- work->data[rank] += 0.29208171834287244 * x->data[rank];
- }
- u1 = x->size[1] + 2;
- if (5 < u1) {
- u1 = 5;
- }
- for (k = 1; k <= u1; k++) {
- if (k - 2 > 0) {
- jlo = k - 3;
- } else {
- jlo = 0;
- }
- rank = (nb + k) - 3;
- if (rank > nb) {
- rank = nb;
- }
- rank -= jlo;
- if (rank >= 1) {
- ix = (jlo - k) + 3;
- i = rank - 1;
- for (rank = 0; rank <= i; rank++) {
- xlpf->data[jlo] += hrow[k - 1] * work->data[ix];
- ix++;
- jlo++;
- }
- }
- }
- } else {
- conv2AXPYSameCMP(x, xlpf);
- }
- } else {
- conv2AXPYSameCMP(x, xlpf);
- }
- emxFree_real_T(&work);
- }
- void CGaussianFilter::SetPdoa1dEnable(bool bEnable)
- {
- s_enabled_pdoa1d = bEnable;
- }
- bool CGaussianFilter::GetPdoa1dEnable()
- {
- return s_enabled_pdoa1d;
- }
- void CGaussianFilter::SetPdoa1dDist(double dist)
- {
- s_pdoa1d_act_dist = dist;
- }
- double CGaussianFilter::GetPdoa1dDist()
- {
- return 25;
- //return s_pdoa1d_act_dist;
- }
- bool CGaussianFilter::s_enabled_pdoa1d = false;
- double CGaussianFilter::s_pdoa1d_act_dist = 0.0;
- //
- // File trailer for CGaussianFilter.cpp
- //
- // [EOF]
- //
|