Point Cloud Library (PCL) 1.14.0
Loading...
Searching...
No Matches
ppolynomial.h
1/*
2Copyright (c) 2006, Michael Kazhdan and Matthew Bolitho
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without modification,
6are permitted provided that the following conditions are met:
7
8Redistributions of source code must retain the above copyright notice, this list of
9conditions and the following disclaimer. Redistributions in binary form must reproduce
10the above copyright notice, this list of conditions and the following disclaimer
11in the documentation and/or other materials provided with the distribution.
12
13Neither the name of the Johns Hopkins University nor the names of its contributors
14may be used to endorse or promote products derived from this software without specific
15prior written permission.
16
17THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
18EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
19OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
20SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26DAMAGE.
27*/
28
29#ifndef P_POLYNOMIAL_INCLUDED
30#define P_POLYNOMIAL_INCLUDED
31
32#if defined __GNUC__
33# pragma GCC system_header
34#endif
35
36#include <vector>
37#include "polynomial.h"
38
39namespace pcl
40{
41 namespace poisson
42 {
43 template<int Degree>
45 public:
47 double start;
48
49 template<int Degree2>
51 StartingPolynomial scale(double s) const;
52 StartingPolynomial shift(double t) const;
53 int operator < (const StartingPolynomial& sp) const;
54 static int Compare(const void* v1,const void* v2);
55 };
56
57 template<int Degree>
59 {
60 public:
61 std::size_t polyCount;
63
64 PPolynomial(void);
66 ~PPolynomial(void);
67
69
70 int size(void) const;
71
72 void set( std::size_t size );
73 // Note: this method will sort the elements in sps
74 void set( StartingPolynomial<Degree>* sps , int count );
75 void reset( std::size_t newSize );
76
77
78 double operator()( double t ) const;
79 double integral( double tMin , double tMax ) const;
80 double Integral( void ) const;
81
82 template<int Degree2>
84
85 PPolynomial operator + (const PPolynomial& p) const;
86 PPolynomial operator - (const PPolynomial& p) const;
87
88 template<int Degree2>
90
91 template<int Degree2>
93
94
95 PPolynomial& operator += ( double s );
96 PPolynomial& operator -= ( double s );
97 PPolynomial& operator *= ( double s );
98 PPolynomial& operator /= ( double s );
99 PPolynomial operator + ( double s ) const;
100 PPolynomial operator - ( double s ) const;
101 PPolynomial operator * ( double s ) const;
102 PPolynomial operator / ( double s ) const;
103
104 PPolynomial& addScaled(const PPolynomial& poly,double scale);
105
106 PPolynomial scale( double s ) const;
107 PPolynomial shift( double t ) const;
108
109 PPolynomial< Degree-1 > derivative(void) const;
111
112 void getSolutions(double c,std::vector<double>& roots,double EPS,double min=-DBL_MAX,double max=DBL_MAX) const;
113
114 void printnl( void ) const;
115
116 PPolynomial< Degree+1 > MovingAverage( double radius );
117 static PPolynomial BSpline( double radius=0.5 );
118
119 void write( FILE* fp , int samples , double min , double max ) const;
120 };
121
122
123 }
124}
125
126
127#include "ppolynomial.hpp"
128#endif // P_POLYNOMIAL_INCLUDED
PPolynomial operator-(const PPolynomial &p) const
PPolynomial operator/(double s) const
StartingPolynomial< Degree > * polys
Definition ppolynomial.h:62
PPolynomial & operator-=(double s)
PPolynomial shift(double t) const
void getSolutions(double c, std::vector< double > &roots, double EPS, double min=-DBL_MAX, double max=DBL_MAX) const
PPolynomial & operator=(const PPolynomial &p)
double operator()(double t) const
PPolynomial & operator+=(double s)
PPolynomial & operator/=(double s)
PPolynomial & operator*=(double s)
void write(FILE *fp, int samples, double min, double max) const
void reset(std::size_t newSize)
PPolynomial operator+(const PPolynomial &p) const
PPolynomial scale(double s) const
PPolynomial< Degree+1 > integral(void) const
static PPolynomial BSpline(double radius=0.5)
PPolynomial< Degree+Degree2 > operator*(const Polynomial< Degree2 > &p) const
void set(std::size_t size)
PPolynomial & addScaled(const PPolynomial &poly, double scale)
PPolynomial< Degree-1 > derivative(void) const
PPolynomial< Degree+1 > MovingAverage(double radius)
double Integral(void) const
StartingPolynomial shift(double t) const
StartingPolynomial< Degree+Degree2 > operator*(const StartingPolynomial< Degree2 > &p) const
StartingPolynomial scale(double s) const
int operator<(const StartingPolynomial &sp) const
static int Compare(const void *v1, const void *v2)