PolyFit_T.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
39 #include "PolyFit.hpp"
40 #include "Vector.hpp"
41 #include "TestUtil.hpp"
42 #include <iostream>
43 
44 class PolyFit_T
45 {
46 public:
47  PolyFit_T(){eps = 1e-11;}// Default Constructor, set the precision value
48  ~PolyFit_T() {} // Default Desructor
49 
50 //==========================================================================================================================
51 // constructorTest ensures the constructors set the object properly
52 //==========================================================================================================================
53  int constructorTest(void)
54  {
55  gnsstk::TestUtil testFramework( "PolyFit", "Constructor", __FILE__, __LINE__ );
56  try
57  {
58  //---------------------------------------------------------------------
59  //Test the default constructor
60  //---------------------------------------------------------------------
61  try
62  {
63  gnsstk::PolyFit<double> PolyCheck;
64  testFramework.assert(true, "Default constructor successfully built a PolyFit object", __LINE__);
65  }
66  catch(...){testFramework.assert(false, "Unexpected exception thrown during default construction of a PolyFit object", __LINE__); }
68  testFramework.assert((unsigned) 0 == Poly.N() , "Default constructor created an object with data in it" , __LINE__);
69  testFramework.assert((unsigned) 0 == Poly.Degree(), "Default constructor allows for non-constant fits" , __LINE__);
70  testFramework.assert(Poly.isSingular() , "The fit found after default construction was not singular", __LINE__);
71 
72  //---------------------------------------------------------------------
73  //Test the explicit constructor
74  //---------------------------------------------------------------------
75  try
76  {
77  gnsstk::PolyFit<double> PolyCheck(4);
78  testFramework.assert(true, "Explicit constructor successfully built a PolyFit object", __LINE__);
79  }
80  catch(...){testFramework.assert(false, "Unexpected exception thrown during explicit construction of a PolyFit object", __LINE__); }
81  gnsstk::PolyFit<double> Poly4((unsigned) 4);
82  testFramework.assert((unsigned) 0 == Poly4.N() , "Explicit constructor created an object with data in it" , __LINE__);
83  testFramework.assert((unsigned) 4 == Poly4.Degree(), "Explicit constructor does not fit polynomials of the correct order", __LINE__);
84  testFramework.assert(Poly4.isSingular() , "The fit found after explicit construction was not singular" , __LINE__);
85  }
86  catch (gnsstk::Exception& e) {}
87 
88  return testFramework.countFails();
89  }
90 
91 
92 //==========================================================================================================================
93 // Test to add data. Want to add single values to empty Stats class.
94 // Then add another stat on top with weight. I will use the average to check
95 // that data was added and that the data added was correct.
96 //==========================================================================================================================
97  int AddTest()
98  {
99  gnsstk::TestUtil testFramework( "PolyFit", "Add", __FILE__, __LINE__ );
100  std::string failMesg;
101 
102  int n = 4;
103  gnsstk::PolyFit<double> testSingle(n), testGnsstkVector(n), testStdVector(n);
104  double indepSingle[6] = {0, 1, 2, 3, 4, 5}, depSingle[6] = {0, 1, 8, 27, 64, 125};
105  gnsstk::Vector<double> indepGnsstkVector(6,0.), depGnsstkVector(6,0.);
106  std::vector<double> indepStdVector(6,0.) , depStdVector(6,0.);
107 
108  for(int i=0; i<6; i++)
109  {
110  indepGnsstkVector[i] = indepSingle[i];
111  indepStdVector[i] = indepSingle[i];
112  depGnsstkVector[i] = depSingle[i];
113  depStdVector[i] = depSingle[i];
114  }
115 
116  //---------------------------------------------------------------------
117  //Test the single entry Add
118  //---------------------------------------------------------------------
119  try
120  {
121  //Can single values be added
122  for(int i=0; i<6; i++)
123  {
124  testSingle.Add(depSingle[i],indepSingle[i]);
125  }
126  //Were all single values added successfully?
127  testFramework.assert(testSingle.N() == 6, "Not all single adds were successful", __LINE__);
128 
129  }
130  catch(...){testFramework.assert(false, "Exception thrown during Single add", __LINE__);}
131 
132  //---------------------------------------------------------------------
133  //Test the gnsstk::Vector Add
134  //---------------------------------------------------------------------
135  try
136  {
137  //Check that all values can be added with a gnsstk::Vector
138  testGnsstkVector.Add(indepGnsstkVector, depGnsstkVector);
139  testFramework.assert(testGnsstkVector.N() == 6, "Not all gnsstk::Vector adds were successful", __LINE__);
140  }
141  catch(...){testFramework.assert(false, "Exception thrown during gnsstk::Vector add", __LINE__);}
142 
143 
144  //---------------------------------------------------------------------
145  //Test the std::vector Add
146  //---------------------------------------------------------------------
147  try
148  {
149  //Check that all values can be added with a std::Vector
150  testStdVector.Add(indepStdVector, depStdVector);
151  testFramework.assert(testStdVector.N() == 6, "Not all std::vector adds were successful", __LINE__);
152  }
153  catch(...){testFramework.assert(false, "Exception thrown during std::vector add", __LINE__);}
154 
155 
156  return testFramework.countFails();
157  }
158 
159 
160 
161 //==========================================================================================================================
162 // This test is designed to test the validity of the reset member of the PolyFit class
163 // Reset is tested by first adding data to a blank PolyFit object and then clearing
164 // that data (Please note this dad was already tested in the previous test)
165 
166 // Please note isSingular, Solution, Degreem N and Solve were tested inderectly here
167 //==========================================================================================================================
168  int resetTest(void)
169  {
170  gnsstk::TestUtil testFramework( "PolyFit", "Reset", __FILE__, __LINE__ );
171  bool covMatDiffBool = true;
172  bool solnDiffBool = true;
173 
174  //Polynomial will be reset without user inputed parameter
175  gnsstk::PolyFit<double> resetPolyD(2);
176 
177  //Poly will be reset with a parameter
178  gnsstk::PolyFit<double> resetPolyP(2);
179 
180 
181  double data[4] = {0.,2.,4.,-1.};
182  double time[4] = {3.,3.,4.,2.,};
183 
184  for (int i =0;i<4;i++)
185  {
186  resetPolyD.Add(time[i],data[i]);
187  resetPolyP.Add(time[i],data[i]);
188  }
189 
190  //---------------------------------------------------------------------
191  //Test Reset()
192  //---------------------------------------------------------------------
193  resetPolyD.Reset();
194 
195  gnsstk::Matrix<double> Blank(2,2,0.);
196  gnsstk::Vector<double> Zero(2,0.);
197 
198  gnsstk::Vector<double> resetPolyDSolution = resetPolyD.Solution();
199  gnsstk::Matrix<double> resetPolyDCov = resetPolyD.Covariance();
200 
201  testFramework.assert((unsigned) 0 == resetPolyD.N() , "Reset did not set the datapoint counter to zero" , __LINE__);
202  testFramework.assert((unsigned) 2 == resetPolyD.Degree(), "Reset did not maintain the maximum fit degree as 2", __LINE__);
203  testFramework.assert(resetPolyD.isSingular() , "The fit found after Reset was not singular" , __LINE__);
204  for (int i = 0; i<2; i++)
205  {
206  for (int j = 0; j<2; j++)
207  {
208  covMatDiffBool = covMatDiffBool && (Blank[i][j] == resetPolyDCov[i][j]);
209  }
210  solnDiffBool = solnDiffBool && (fabs(resetPolyDSolution[i]) < eps);
211  }
212  testFramework.assert(covMatDiffBool, "Covariance matrix found to be nonzero after Reset", __LINE__);
213  testFramework.assert(solnDiffBool , "Solution vector found to be nonzero after Reset" , __LINE__);
214 
215 
216  //---------------------------------------------------------------------
217  //Test Reset(int)
218  //---------------------------------------------------------------------
219  resetPolyP.Reset((unsigned) 3);
220 
221  covMatDiffBool = true;
222  solnDiffBool = true;
223 
224  gnsstk::Matrix<double> BlankP(3,3,0.);
225  gnsstk::Vector<double> ZeroP(3,0.);
226 
227  gnsstk::Vector<double> resetPolyPSolution = resetPolyP.Solution();
228  gnsstk::Matrix<double> resetPolyPCov = resetPolyP.Covariance();
229 
230  testFramework.assert((unsigned) 0 == resetPolyP.N() , "Reset(int) did not set the datapoint counter to zero" , __LINE__);
231  testFramework.assert((unsigned) 3 == resetPolyP.Degree(), "Reset(int) did not change the maximum fit degree to 3", __LINE__);
232  testFramework.assert(resetPolyP.isSingular() , "The fit found after Reset(int) was not singular" , __LINE__);
233  for (int i = 0; i<3; i++)
234  {
235  for (int j = 0; j<3; j++)
236  {
237  covMatDiffBool = covMatDiffBool && (fabs(resetPolyPCov[i][j]) < eps);
238  }
239  solnDiffBool = solnDiffBool && (fabs(resetPolyPSolution[i]) < eps);
240  }
241  testFramework.assert(covMatDiffBool, "Covariance matrix found to be nonzero after Reset(int)", __LINE__);
242  testFramework.assert(solnDiffBool , "Solution vector found to be nonzero after Reset(int)" , __LINE__);
243 
244  return testFramework.countFails();
245  }
246 
247 
248 
249 //==========================================================================================================================
250 // Test to check that the correct solution is found.
251 // The result should be only a 3rd order term.
252 //==========================================================================================================================
254  {
255  gnsstk::TestUtil testFramework( "PolyFit", "Solution", __FILE__, __LINE__ );
256  std::string failMesg;
257 
258  int n = 4; //Highest order in polynomial fit + 1 (constant term)
259  int errorCounter = 0;
260  gnsstk::PolyFit<double> test(n);
261  gnsstk::Vector<double> soln; // To store the solution
262  // Data values to create the fit
263  double indep[6] = {0, 1, 2, 3, 4, 5}, dep[6] = {0, 1, 8, 27, 64, 125};
264  // Add the data to the PolyFit object
265  for(int i=0; i<6; i++)
266  {
267  test.Add(dep[i],indep[i]);
268  }
269  // Store the solution
270  soln = test.Solution();
271  //std::cout << "Solution is: " << soln << std::endl;
272  for (int i = 0; i<4; i++) // Loop over the solution values
273  {
274 
275  // Make sure the data matches what is expected
276  // Expect soln = {0, 0, 0, 1}
277  if ((i != 3 && std::abs(soln[i]) > eps) || (i == 3 && std::abs(soln[i] - 1) > eps))
278  {
279  //std::cout << "i: " << i << " value: " << soln[i] << " absVal: " << fabs(soln[i]) << " fabsVal(soln-1): " << fabs(soln[i]-1) << std::endl;
280  errorCounter += 1; // Increment the return value for each wrong value
281  }
282  }
283  failMesg = "Was the solution computed correct?";
284  testFramework.assert(errorCounter == 0, failMesg, __LINE__);
285 
286  return testFramework.countFails(); // Return the result of the test.
287  }
288 
289 
290 
291 //==========================================================================================================================
292 // Test to check that the correct solution is found.
293 // The result should be only a 2nd order term.
294 //==========================================================================================================================
296  {
297  gnsstk::TestUtil testFramework( "PolyFit", "Solution", __FILE__, __LINE__ );
298  std::string failMesg;
299 
300  int n = 4;
301  int errorCounter = 0;
302  gnsstk::PolyFit<double> test(n);
304  double indep[6] = {0, 1, 2, 3, 4, 5}, dep[6] = {0, 1, 4, 9, 16, 25};
305 
306  for(int i=0; i<6; i++)
307  {
308  test.Add(dep[i],indep[i]);
309  }
310 
311 
312  soln = test.Solution();
313  //std::cout << "Solution is: " << soln << std::endl;
314  for (int i = 0; i<4; i++)
315  {
316  // Make sure the data matches what is expected
317  // Expect soln = {0, 0, 1, 0}
318  if ((i != 2 && std::abs(soln[i]) > eps) || (i == 2 && std::abs(soln[i] - 1) > eps))
319  {
320  //std::cout << "i: " << i << " value: " << soln[i] << " absVal: " << fabs(soln[i]) << " fabsVal(soln-1): " << fabs(soln[i]-1) << std::endl;
321  errorCounter += 1; // Increment the return value for each wrong value
322  }
323  }
324 
325  failMesg = "Was the solution computed correct?";
326  testFramework.assert(errorCounter==0, failMesg, __LINE__);
327 
328  return testFramework.countFails(); // Return the result of the test.
329  }
330 
331 
332 //==========================================================================================================================
333 // Test to check that the correct solution is found.
334 // The result should be only a 1st order term.
335 //==========================================================================================================================
337  {
338  gnsstk::TestUtil testFramework( "PolyFit", "Solution", __FILE__, __LINE__ );
339  std::string failMesg;
340 
341  int n = 4;
342  int errorCounter = 0;
343  gnsstk::PolyFit<double> test(n);
345  double indep[6] = {0, 1, 2, 3, 4, 5}, dep[6] = {0, 1, 2, 3, 4, 5};
346 
347  for(int i=0; i<6; i++)
348  {
349  test.Add(dep[i],indep[i]);
350  }
351 
352 
353  soln = test.Solution();
354  //std::cout << "Solution is: " << soln << std::endl;
355  for (int i = 0; i<4; i++)
356  {
357  // Make sure the data matches what is expected
358  // Expect soln = {0, 1, 0, 0}
359  if ((i != 1 && std::abs(soln[i]) > eps) || (i == 1 && std::abs(soln[i] - 1) > eps))
360  {
361  //std::cout << "i: " << i << " value: " << soln[i] << " absVal: " << fabs(soln[i]) << " fabsVal(soln-1): " << fabs(soln[i]-1) << std::endl;
362  errorCounter += 1; // Increment the return value for each wrong value
363  }
364  }
365 
366  failMesg = "Was the solution computed correct?";
367  testFramework.assert(errorCounter==0, failMesg, __LINE__);
368 
369  return testFramework.countFails(); // Return the result of the test.
370  }
371 
372 
373 //==========================================================================================================================
374 // Test to check that the correct solution is found.
375 // The result should be only a 0th order term.
376 //==========================================================================================================================
378  {
379  gnsstk::TestUtil testFramework( "PolyFit", "Solution", __FILE__, __LINE__ );
380  std::string failMesg;
381 
382  int n = 4;
383  int errorCounter = 0;
384  gnsstk::PolyFit<double> test(n);
386  double indep[6] = {0, 1, 2, 3, 4, 5}, dep[6] = {7, 7, 7, 7, 7, 7};
387 
388  for(int i=0; i<6; i++)
389  {
390  test.Add(dep[i],indep[i]);
391  }
392 
393 
394  soln = test.Solution();
395  //std::cout << "Solution is: " << soln << std::endl;
396  for (int i = 0; i<4; i++)
397  {
398  // Make sure the data matches what is expected
399  // Expect soln = {7, 0, 0, 0}
400  if ((i != 0 && std::abs(soln[i]) > eps) || (i == 0 && std::abs(soln[i] - 7) > eps))
401  {
402  //std::cout << "i: " << i << " value: " << soln[i] << " absVal: " << fabs(soln[i]) << " fabsVal(soln-1): " << fabs(soln[i]-1) << std::endl;
403  errorCounter += 1; // Increment the return value for each wrong value
404  }
405  }
406 
407  failMesg = "Was the solution computed correct?";
408  testFramework.assert(errorCounter==0, failMesg, __LINE__);
409 
410  return testFramework.countFails(); // Return the result of the test.
411  }
412 
413 
414 //==========================================================================================================================
415 // Test to check that the correct solution is found.
416 //==========================================================================================================================
418  {
419  gnsstk::TestUtil testFramework( "PolyFit", "Solution", __FILE__, __LINE__ );
420  std::string failMesg;
421 
422  int n = 4;
423  int errorCounter = 0;
424  gnsstk::PolyFit<double> test(n);
426  double indep[6] = {0, 1, 2, 3, 4, 5}, dep[6] = {2, 8, 30, 80, 170, 312};
427 
428  for(int i=0; i<6; i++)
429  {
430  test.Add(dep[i],indep[i]);
431  }
432 
433 
434  soln = test.Solution();
435  //std::cout << "Solution is: " << soln << std::endl;
436  for (int i = 0; i<4; i++)
437  {
438  // Make sure the data matches what is expected
439  // Expect soln = {2, 2, 2, 2}
440  if (fabs(soln[i] - 2) > eps)
441  {
442  //std::cout << "i: " << i << " value: " << soln[i] << " absVal: " << fabs(soln[i]) << " fabs(val-2): " << fabs(soln[i] - 2) << std::endl;
443  errorCounter += 1; // Increment the return value for each wrong value
444  }
445  }
446 
447  failMesg = "Was the solution computed correct?";
448  testFramework.assert(errorCounter==0, failMesg, __LINE__);
449 
450  return testFramework.countFails(); // Return the result of the test.
451  }
452 
453 
454 //==========================================================================================================================
455 // Test to check that the correct solution is found.
456 // In this case the problem is singular.
457 //==========================================================================================================================
459  {
460  gnsstk::TestUtil testFramework( "PolyFit", "Solution", __FILE__, __LINE__ );
461  std::string failMesg;
462 
463  int n = 4;
464  gnsstk::PolyFit<double> test(n);
466  // Set the independent variable to the same value
467  double indep[6] = {1, 1, 1, 1, 1, 1}, dep[6] = {1, 2, 3, 4, 5, 6};
468 
469  for(int i=0; i<6; i++)
470  {
471  test.Add(dep[i],indep[i]);
472  }
473 
474  soln = test.Solution(); // This might NaN
475 
476  //std::cout << "Solution is: " << test.isSingular() << std::endl;
477 
478  failMesg = "Was the solution computed singular?";
479  testFramework.assert(test.isSingular(), failMesg, __LINE__); // The singular flag should be set
480 
481  return testFramework.countFails();
482  }
483 
484 
485 //==========================================================================================================================
486 // Test to verify the evaluate method with a vector input.
487 //==========================================================================================================================
489  {
490  gnsstk::TestUtil testFramework( "PolyFit", "Evaluate", __FILE__, __LINE__ );
491  std::string failMesg;
492 
493  int n = 4;
494  gnsstk::PolyFit<double> test(n);
495  gnsstk::Vector<double> soln(3,0.), eval(3,0.);
496  double indep[6] = {0, 1, 2, 3, 4, 5}, dep[6] = {0, 1, 4, 9, 16, 25};
497 
498  eval[0] = 6;
499  eval[1] = 8;
500  eval[2] = 10;
501 
502  for(int i=0; i<6; i++)
503  {
504  test.Add(dep[i],indep[i]);
505  }
506 
507 
508  soln = test.Evaluate(eval);
509  //std::cout << "Solution is: " << soln << std::endl;
510  n = 0;
511  for (int i = 0; i<3; i++)
512  {
513 
514  // Using relative error since the soln >> 1
515  if (fabs(soln[i] - eval[i]*eval[i])/(eval[i]*eval[i]) > eps)
516  {
517  n += 1; // Increment the return value for each wrong value
518  }
519  }
520  failMesg = "Was the solution computed correct?";
521  testFramework.assert(n==0, failMesg, __LINE__);
522 
523  return testFramework.countFails(); // Return the result of the test.
524  }
525 
526 
527 //==========================================================================================================================
528 // Test to verify the evaluate method with a single input.
529 //==========================================================================================================================
531  {
532  gnsstk::TestUtil testFramework( "PolyFit", "Evaluate", __FILE__, __LINE__ );
533  std::string failMesg;
534 
535  int n = 4;
536  gnsstk::PolyFit<double> test(n);
537  double soln, eval;
538  double indep[6] = {0, 1, 2, 3, 4, 5}, dep[6] = {0, 1, 4, 9, 16, 25};
539 
540  eval = 6;
541 
542  for(int i=0; i<6; i++)
543  {
544  test.Add(dep[i],indep[i]);
545  }
546 
547 
548  soln = test.Evaluate(eval);
549 
550  failMesg = "Was the solution computed correct?";
551  testFramework.assert(fabs(soln - eval*eval) < eps, failMesg, __LINE__);
552 
553  return testFramework.countFails();
554  }
555 private:
556  double eps;
557 };
558 
559 int main() //Main function to initialize and run all tests above
560 {
561  int check, errorCounter = 0;
562  PolyFit_T testClass;
563 
564  check = testClass.constructorTest();
565  errorCounter += check;
566 
567  check = testClass.AddTest();
568  errorCounter += check;
569 
570  check = testClass.resetTest();
571  errorCounter += check;
572 
573  check = testClass.SolutionTest3rdOrderResult();
574  errorCounter += check;
575 
576  check = testClass.SolutionTest2ndOrderResult();
577  errorCounter += check;
578 
579  check = testClass.SolutionTest1stOrderResult();
580  errorCounter += check;
581 
582  check = testClass.SolutionTest0thOrderResult();
583  errorCounter += check;
584 
585  check = testClass.SolutionTest();
586  errorCounter += check;
587 
588  check = testClass.SolutionFailTest();
589  errorCounter += check;
590 
591  check = testClass.EvaluateTest();
592  errorCounter += check;
593 
594  check = testClass.EvaluateVectorTest();
595  errorCounter += check;
596 
597  std::cout << "Total Errors: " << errorCounter << std::endl;
598 
599  std::cout << "Total Failures for " << __FILE__ << ": " << errorCounter << std::endl;
600 
601  return errorCounter; //Return the total number of errors
602 }
gnsstk::TestUtil::countFails
int countFails(void)
Definition: TestUtil.hpp:771
main
int main()
Definition: PolyFit_T.cpp:559
gnsstk::TestUtil::assert
void assert(bool testExpression, const std::string &testMsg, const int lineNumber)
Definition: TestUtil.hpp:607
gnsstk::PolyFit::Add
void Add(T d, T t, T w=T(1))
Add a single (optional: weighted) datum to the estimation.
Definition: PolyFit.hpp:110
PolyFit_T::EvaluateTest
int EvaluateTest()
Definition: PolyFit_T.cpp:530
PolyFit_T::SolutionFailTest
int SolutionFailTest()
Definition: PolyFit_T.cpp:458
PolyFit_T::eps
double eps
Definition: PolyFit_T.cpp:556
PolyFit_T::~PolyFit_T
~PolyFit_T()
Definition: PolyFit_T.cpp:48
gnsstk::PolyFit::Evaluate
T Evaluate(T t)
Definition: PolyFit.hpp:177
gnsstk::PolyFit::N
unsigned int N(void) const
get the number of data points processed
Definition: PolyFit.hpp:224
gnsstk::Exception
Definition: Exception.hpp:151
PolyFit_T::SolutionTest1stOrderResult
int SolutionTest1stOrderResult()
Definition: PolyFit_T.cpp:336
TestUtil.hpp
gnsstk::PolyFit< double >
gnsstk::Matrix< double >
PolyFit_T::constructorTest
int constructorTest(void)
Definition: PolyFit_T.cpp:53
example4.time
time
Definition: example4.py:103
PolyFit_T
Definition: PolyFit_T.cpp:44
gnsstk::PolyFit::Covariance
Matrix< T > Covariance(void)
get the covariance matrix
Definition: PolyFit.hpp:220
PolyFit_T::EvaluateVectorTest
int EvaluateVectorTest()
Definition: PolyFit_T.cpp:488
PolyFit_T::SolutionTest2ndOrderResult
int SolutionTest2ndOrderResult()
Definition: PolyFit_T.cpp:295
PolyFit_T::resetTest
int resetTest(void)
Definition: PolyFit_T.cpp:168
gnsstk::PolyFit::isSingular
bool isSingular(void)
is the problem singular?
Definition: PolyFit.hpp:216
gnsstk::Vector< double >
example3.data
data
Definition: example3.py:22
gnsstk::PolyFit::Solution
Vector< T > Solution(void)
get the solution vector (coefficients)
Definition: PolyFit.hpp:218
PolyFit_T::SolutionTest3rdOrderResult
int SolutionTest3rdOrderResult()
Definition: PolyFit_T.cpp:253
gnsstk::PolyFit::Degree
unsigned int Degree(void) const
get the degree of the polynomial
Definition: PolyFit.hpp:222
PolyFit_T::PolyFit_T
PolyFit_T()
Definition: PolyFit_T.cpp:47
PolyFit_T::SolutionTest0thOrderResult
int SolutionTest0thOrderResult()
Definition: PolyFit_T.cpp:377
PolyFit_T::AddTest
int AddTest()
Definition: PolyFit_T.cpp:97
PolyFit.hpp
gnsstk::TestUtil
Definition: TestUtil.hpp:265
PolyFit_T::SolutionTest
int SolutionTest()
Definition: PolyFit_T.cpp:417
Vector.hpp
gnsstk::PolyFit::Reset
void Reset(unsigned int n=0)
Definition: PolyFit.hpp:91


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:40