13 #include "Constants.h"
75 inline void setCoeff(
int row,
int col,
double val);
78 inline double getCoeff(
int row,
int col)
const;
81 double eval(
double azi,
double rng)
const;
105 if ((row < 0) || (row > azimuthOrder)) {
106 std::string errstr =
"Poly2d::setCoeff - Trying to set coefficient for row " +
107 std::to_string(row+1) +
" out of " +
108 std::to_string(azimuthOrder+1);
109 throw std::out_of_range(errstr);
111 if ((col < 0) || (col > rangeOrder)) {
112 std::string errstr =
"Poly2d::setCoeff - Trying to set coefficient for col " +
113 std::to_string(col+1) +
" out of " + std::to_string(rangeOrder+1);
114 throw std::out_of_range(errstr);
116 coeffs[IDX1D(row,col,rangeOrder+1)] = val;
124 if ((row < 0) || (row > azimuthOrder)) {
125 std::string errstr =
"Poly2d::getCoeff - Trying to get coefficient for row " +
126 std::to_string(row+1) +
" out of " +
127 std::to_string(azimuthOrder+1);
128 throw std::out_of_range(errstr);
130 if ((col < 0) || (col > rangeOrder)) {
131 std::string errstr =
"Poly2d::getCoeff - Trying to get coefficient for col " +
132 std::to_string(col+1) +
" out of " + std::to_string(rangeOrder+1);
133 throw std::out_of_range(errstr);
135 return coeffs[IDX1D(row,col,rangeOrder+1)];
Data structure for representing 1D polynomials.
Definition: Poly2d.h:25
Poly2d & operator=(const Poly2d &)
Assignment operator.
Definition: Poly2d.h:88
int rangeOrder
Order of polynomial in range or x.
Definition: Poly2d.h:29
int azimuthOrder
Order of polynomial in azimuth or y.
Definition: Poly2d.h:31
double getCoeff(int row, int col) const
Get coefficient by indices.
Definition: Poly2d.h:123
Poly2d()
Empty constructor.
Definition: Poly2d.h:61
double azimuthNorm
Norm in azimuth or y direction.
Definition: Poly2d.h:39
std::vector< double > coeffs
Linearized vector of coefficients in row-major format.
Definition: Poly2d.h:41
Poly2d(int ro, int ao, double rm, double am, double rn, double an)
Simple constructor.
Definition: Poly2d.h:51
double rangeNorm
Norm in range or x direction.
Definition: Poly2d.h:37
double azimuthMean
Mean in azimuth or y direction.
Definition: Poly2d.h:35
void printPoly() const
Printing for debugging.
Definition: Poly2d.cpp:32
void setCoeff(int row, int col, double val)
Set coefficient by indices.
Definition: Poly2d.h:104
Poly2d(const Poly2d &p)
Copy constructor.
Definition: Poly2d.h:66
double rangeMean
Mean in range or x direction.
Definition: Poly2d.h:33
double eval(double azi, double rng) const
Evaluate polynomial at given y,x.
Definition: Poly2d.cpp:14