/* lmath.h This file is part of a program that implements a Software-Defined Radio. Copyright (C) 2015, 2023 Warren Pratt, NR0V Copyright (C) 2024 Edouard Griffiths, F4EXB Adapted to SDRangel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The author can be reached by email at warren@wpratt.com */ #ifndef wdsp_bldr_h #define wdsp_bldr_h #include #include "export.h" namespace WDSP { class WDSP_API BLDR { public: double* catxy; std::vector sx; std::vector sy; std::vector h; std::vector p; std::vector np; std::vector taa; std::vector tab; std::vector tag; std::vector tad; std::vector tbb; std::vector tbg; std::vector tbd; std::vector tgg; std::vector tgd; std::vector tdd; std::vector A; std::vector B; std::vector C; std::vector D; std::vector E; std::vector F; std::vector G; std::vector MAT; std::vector RHS; std::vector SLN; std::vector z; std::vector zp; std::vector wrk; std::vector ipiv; BLDR(int points, int ints); BLDR(const BLDR&) = delete; BLDR& operator=(const BLDR& other) = delete; ~BLDR(); void flush(int points); void execute(int points, const double* x, const double* y, int ints, const double* t, int* info, double* c, double ptol); private: static int fcompare(const void* a, const void* b); static void decomp(int n, std::vector& a, std::vector& piv, int* info, std::vector& wrk); static void dsolve(int n, std::vector& a, std::vector& piv, std::vector& b, std::vector& x); static void cull(int* n, int ints, std::vector& x, const double* t, double ptol); }; } // namespace WDSP #endif