#include <linlsq.h>
List of all members.
Detailed Description
Definition at line 26 of file linlsq.h.
Constructor & Destructor Documentation
Member Function Documentation
Definition at line 49 of file linlsq.cpp.
{
total_weight++;
sigx += x;
sigy += y;
sigxx += x * x;
sigxy += x * y;
sigyy += y * y;
}
void LLSQ::add |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
weight |
|
) |
| |
Definition at line 58 of file linlsq.cpp.
{
total_weight += weight;
sigx += x * weight;
sigy += y * weight;
sigxx += x * x * weight;
sigxy += x * y * weight;
sigyy += y * y * weight;
}
Definition at line 67 of file linlsq.cpp.
{
total_weight += other.total_weight;
sigx += other.sigx;
sigy += other.sigy;
sigxx += other.sigxx;
sigxy += other.sigxy;
sigyy += other.sigyy;
}
Definition at line 117 of file linlsq.cpp.
{
if (total_weight > 0.0)
return (sigy - m * sigx) / total_weight;
else
return 0;
}
Definition at line 33 of file linlsq.cpp.
{
total_weight = 0.0;
sigx = 0.0;
sigy = 0.0;
sigxx = 0.0;
sigxy = 0.0;
sigyy = 0.0;
}
Definition at line 41 of file linlsq.h.
{
return static_cast<int>(total_weight + 0.5);
}
Definition at line 73 of file linlsq.h.
{
if (total_weight > 0.0)
return (sigxy - sigx * sigy / total_weight) / total_weight;
else
return 0.0;
}
Definition at line 167 of file linlsq.cpp.
{
if (total_weight > 0.0) {
return FCOORD(sigx / total_weight, sigy / total_weight);
} else {
return FCOORD(0.0f, 0.0f);
}
}
Definition at line 154 of file linlsq.cpp.
{
double r = 0.0;
double covar = covariance();
if (covar != 0.0) {
double var_product = x_variance() * y_variance();
if (var_product > 0.0)
r = covar / sqrt(var_product);
}
return r;
}
Definition at line 83 of file linlsq.cpp.
{
if (total_weight <= 0.0)
EMPTY_LLSQ.error("LLSQ::remove", ABORT, NULL);
total_weight--;
sigx -= x;
sigy -= y;
sigxx -= x * x;
sigxy -= x * y;
sigyy -= y * y;
}
double LLSQ::rms |
( |
double |
m, |
|
|
double |
c |
|
) |
| const |
Definition at line 131 of file linlsq.cpp.
{
double error;
if (total_weight > 0) {
error = sigyy + m * (m * sigxx + 2 * (c * sigx - sigxy)) + c *
(total_weight * c - 2 * sigy);
if (error >= 0)
error = sqrt(error / total_weight);
else
error = 0;
} else {
error = 0;
}
return error;
}
Definition at line 79 of file linlsq.h.
{
if (total_weight > 0.0)
return (sigxx - sigx * sigx / total_weight) / total_weight;
else
return 0.0;
}
Definition at line 85 of file linlsq.h.
{
if (total_weight > 0.0)
return (sigyy - sigy * sigy / total_weight) / total_weight;
else
return 0.0;
}
The documentation for this class was generated from the following files:
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/linlsq.h
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/linlsq.cpp