22 mfunname(
"Parabol::Parabol(double x[3], double y[3])");
25 "x[2]=" << x[2] <<
" y[0]=" <<
y[0] <<
" y[1]=" <<
y[1]
26 <<
" y[2]=" <<
y[2] <<
'\n',
29 "x[1]=" << x[1] <<
" y[0]=" <<
y[0] <<
" y[1]=" <<
y[1]
30 <<
" y[2]=" <<
y[2] <<
'\n',
33 "x[0]=" << x[0] <<
" y[0]=" <<
y[0] <<
" y[1]=" <<
y[1]
34 <<
" y[2]=" <<
y[2] <<
'\n',
39 for (
int i = 0; i < 3; ++i) {
43 mat.
ac(i, 0) = x[i] * x[i];
73 mat.
ac(1, 1) = mat.
ac(0, 1);
74 mat.
ac(1, 2) = mat.
ac(0, 2);
81 "should never happen\nmat=" << mat <<
"\ns_var=" << s_var
82 <<
"\nmat_inv=" << mat_inv,
94 : s_det(0), s_dxzero(0) {
95 mfunname(
"Parabol::Parabol(double x[3], double y[3])");
97 check_econd12a(x1, ==, x2,
"x3=" << x3 <<
" y1=" << y1 <<
" y2=" << y2
98 <<
" y3=" << y3 <<
'\n',
100 check_econd12a(x1, ==, x3,
"x2=" << x2 <<
" y1=" << y1 <<
" y2=" << y2
101 <<
" y3=" << y3 <<
'\n',
103 check_econd12a(x2, ==, x3,
"x1=" << x1 <<
" y1=" << y1 <<
" y2=" << y2
104 <<
" y3=" << y3 <<
'\n',
112 mat.
ac(0, 0) = x1 * x1;
116 mat.
ac(1, 0) = x2 * x2;
120 mat.
ac(2, 0) = x3 * x3;
150 mat.
ac(1, 1) = mat.
ac(0, 1);
151 mat.
ac(1, 2) = mat.
ac(0, 2);
158 "should never happen\nmat=" << mat <<
"\ns_var=" << s_var
159 <<
"\nmat_inv=" << mat_inv,
170 mfunname(
"Parabol::Parabol(double x[3], double y[3], int)");
179 for (
int i = 0; i < 3; ++i)
181 for (
int i = 0; i < 2; ++i) {
185 mat.
ac(i, 0) = x[i] * x[i];
189 mat.
ac(2, 0) = 2.0 * x[2];
209 if (
fabs(par[0]) == 0.0) {
235 mfunnamep(
"int Parabol::find_zero(double xzero[2]) const");
243 mcerr <<
"can not find zero\n";
247 t.dxzero[0] = -dc / db;
256 t.dxzero[0] = -db / (2.0 * da);
261 t.dxzero[0] = (-db - sq) / (2.0 * da);
262 t.dxzero[1] = (-db + sq) / (2.0 * da);
264 t.dxzero[1] = (-db - sq) / (2.0 * da);
265 t.dxzero[0] = (-db + sq) / (2.0 * da);
274 xzero[0] = dxzero[0];
275 xzero[1] = dxzero[1];
280 mfunname(
"double Parabol::find_maxmin(void)");
282 return -db / (2.0 * da);
288 Ifile <<
"Parabol: a=" << f.
a() <<
" b=" << f.
b() <<
" c=" << f.
c()
290 if (q > 0) file <<
" xzero=" << xz[0];
291 if (q > 1) file <<
' ' << xz[1];
DoubleAc sqrt(const DoubleAc &f)
DoubleAc fabs(const DoubleAc &f)
#define check_econd11(a, signb, stream)
#define check_econd11a(a, signb, add, stream)
#define check_econd12a(a, sign, b, add, stream)
#define mfunnamep(string)
#define check_econd12(a, sign, b, stream)
double determinant(void) const
int find_zero(double xzero[2]) const
void inverse_DynArr_prot(const DynArr< DoubleAc > &mi, DynArr< DoubleAc > &mr, int &szero, int &serr, int s_stop)
std::ostream & operator<<(std::ostream &file, const Parabol &f)