Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef P_POLYNOMIAL_INCLUDED
00030 #define P_POLYNOMIAL_INCLUDED
00031
00032 #if defined __GNUC__
00033 # pragma GCC system_header
00034 #endif
00035
00036 #include <vector>
00037 #include "polynomial.h"
00038
00039 namespace pcl
00040 {
00041 namespace poisson
00042 {
00043 template<int Degree>
00044 class StartingPolynomial{
00045 public:
00046 Polynomial<Degree> p;
00047 double start;
00048
00049 template<int Degree2>
00050 StartingPolynomial<Degree+Degree2> operator * (const StartingPolynomial<Degree2>& p) const;
00051 StartingPolynomial scale(double s) const;
00052 StartingPolynomial shift(double t) const;
00053 int operator < (const StartingPolynomial& sp) const;
00054 static int Compare(const void* v1,const void* v2);
00055 };
00056
00057 template<int Degree>
00058 class PPolynomial
00059 {
00060 public:
00061 size_t polyCount;
00062 StartingPolynomial<Degree>* polys;
00063
00064 PPolynomial(void);
00065 PPolynomial(const PPolynomial<Degree>& p);
00066 ~PPolynomial(void);
00067
00068 PPolynomial& operator = (const PPolynomial& p);
00069
00070 int size(void) const;
00071
00072 void set( size_t size );
00073
00074 void set( StartingPolynomial<Degree>* sps , int count );
00075 void reset( size_t newSize );
00076
00077
00078 double operator()( double t ) const;
00079 double integral( double tMin , double tMax ) const;
00080 double Integral( void ) const;
00081
00082 template<int Degree2>
00083 PPolynomial<Degree>& operator = (const PPolynomial<Degree2>& p);
00084
00085 PPolynomial operator + (const PPolynomial& p) const;
00086 PPolynomial operator - (const PPolynomial& p) const;
00087
00088 template<int Degree2>
00089 PPolynomial<Degree+Degree2> operator * (const Polynomial<Degree2>& p) const;
00090
00091 template<int Degree2>
00092 PPolynomial<Degree+Degree2> operator * (const PPolynomial<Degree2>& p) const;
00093
00094
00095 PPolynomial& operator += ( double s );
00096 PPolynomial& operator -= ( double s );
00097 PPolynomial& operator *= ( double s );
00098 PPolynomial& operator /= ( double s );
00099 PPolynomial operator + ( double s ) const;
00100 PPolynomial operator - ( double s ) const;
00101 PPolynomial operator * ( double s ) const;
00102 PPolynomial operator / ( double s ) const;
00103
00104 PPolynomial& addScaled(const PPolynomial& poly,double scale);
00105
00106 PPolynomial scale( double s ) const;
00107 PPolynomial shift( double t ) const;
00108
00109 PPolynomial< Degree-1 > derivative(void) const;
00110 PPolynomial< Degree+1 > integral(void) const;
00111
00112 void getSolutions(double c,std::vector<double>& roots,double EPS,double min=-DBL_MAX,double max=DBL_MAX) const;
00113
00114 void printnl( void ) const;
00115
00116 PPolynomial< Degree+1 > MovingAverage( double radius );
00117 static PPolynomial BSpline( double radius=0.5 );
00118
00119 void write( FILE* fp , int samples , double min , double max ) const;
00120 };
00121
00122
00123 }
00124 }
00125
00126
00127 #include "ppolynomial.hpp"
00128 #endif // P_POLYNOMIAL_INCLUDED