46 Poly2d(
int xo,
int yo,
double xm,
double ym,
double xn,
double yn) :
xOrder(xo),
70 inline void setCoeff(
int row,
int col,
double val);
73 inline double getCoeff(
int row,
int col)
const;
76 double eval(
double y,
double x)
const;
99setCoeff(
int row,
int col,
double val) {
100 if ((row < 0) || (row >
yOrder)) {
101 std::string errstr =
"Poly2d::setCoeff - Trying to set coefficient for row " +
102 std::to_string(row+1) +
" out of " +
104 throw std::out_of_range(errstr);
106 if ((col < 0) || (col >
xOrder)) {
107 std::string errstr =
"Poly2d::setCoeff - Trying to set coefficient for col " +
108 std::to_string(col+1) +
" out of " + std::to_string(
xOrder+1);
109 throw std::out_of_range(errstr);
119 if ((row < 0) || (row >
yOrder)) {
120 std::string errstr =
"Poly2d::getCoeff - Trying to get coefficient for row " +
121 std::to_string(row+1) +
" out of " +
123 throw std::out_of_range(errstr);
125 if ((col < 0) || (col >
xOrder)) {
126 std::string errstr =
"Poly2d::getCoeff - Trying to get coefficient for col " +
127 std::to_string(col+1) +
" out of " + std::to_string(
xOrder+1);
128 throw std::out_of_range(errstr);
Data structure for representing 2D polynomials.
Definition Poly2d.h:20
double getCoeff(int row, int col) const
Get coefficient by indices.
Definition Poly2d.h:118
int yOrder
Order of polynomial in azimuth or y.
Definition Poly2d.h:26
Poly2d(int xo, int yo, double xm, double ym, double xn, double yn)
Simple constructor.
Definition Poly2d.h:46
double yNorm
Norm in azimuth or y direction.
Definition Poly2d.h:34
void setCoeff(int row, int col, double val)
Set coefficient by indices.
Definition Poly2d.h:99
void printPoly() const
Printing for debugging.
Definition Poly2d.cpp:27
double yMean
Mean in azimuth or y direction.
Definition Poly2d.h:30
Poly2d()
Empty constructor.
Definition Poly2d.h:56
double xNorm
Norm in range or x direction.
Definition Poly2d.h:32
int xOrder
Order of polynomial in range or x.
Definition Poly2d.h:24
std::vector< double > coeffs
Linearized vector of coefficients in row-major format.
Definition Poly2d.h:36
Poly2d(const Poly2d &p)
Copy constructor.
Definition Poly2d.h:61
double eval(double y, double x) const
Evaluate polynomial at given y/azimuth/row ,x/range/col.
Definition Poly2d.cpp:9
Poly2d & operator=(const Poly2d &)
Assignment operator.
Definition Poly2d.h:83
double xMean
Mean in range or x direction.
Definition Poly2d.h:28