MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / lrinternal

Function lrinternal

src/linreg.cpp:807–1155  ·  view source on GitHub ↗

Internal linear regression subroutine *************************************************************************/

Source from the content-addressed store, hash-verified

805Internal linear regression subroutine
806*************************************************************************/
807static void lrinternal(const ap::real_2d_array& xy,
808 const ap::real_1d_array& s,
809 int npoints,
810 int nvars,
811 int& info,
812 linearmodel& lm,
813 lrreport& ar)
814{
815 ap::real_2d_array a;
816 ap::real_2d_array u;
817 ap::real_2d_array vt;
818 ap::real_2d_array vm;
819 ap::real_2d_array xym;
820 ap::real_1d_array b;
821 ap::real_1d_array sv;
822 ap::real_1d_array t;
823 ap::real_1d_array svi;
824 ap::real_1d_array work;
825 int i;
826 int j;
827 int k;
828 int ncv;
829 int na;
830 int nacv;
831 double r;
832 double p;
833 double epstol;
834 lrreport ar2;
835 int offs;
836 linearmodel tlm;
837
838 epstol = 1000;
839
840 //
841 // Check for errors in data
842 //
843 if( npoints<nvars||nvars<1 )
844 {
845 info = -1;
846 return;
847 }
848 for(i = 0; i <= npoints-1; i++)
849 {
850 if( ap::fp_less_eq(s(i),0) )
851 {
852 info = -2;
853 return;
854 }
855 }
856 info = 1;
857
858 //
859 // Create design matrix
860 //
861 a.setbounds(0, npoints-1, 0, nvars-1);
862 b.setbounds(0, npoints-1);
863 for(i = 0; i <= npoints-1; i++)
864 {

Callers 2

lrbuildsFunction · 0.85
lrbuildzsFunction · 0.85

Calls 10

vmoveFunction · 0.85
rmatrixsvdFunction · 0.85
lrrmserrorFunction · 0.85
lravgerrorFunction · 0.85
lravgrelerrorFunction · 0.85
vdotproductFunction · 0.85
vaddFunction · 0.85
matrixmatrixmultiplyFunction · 0.85
getstrideMethod · 0.80
setboundsMethod · 0.45

Tested by

no test coverage detected