Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
cubic.cpp File Reference

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &file, const Cubic &f)
 

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  file,
const Cubic f 
)

Definition at line 150 of file cubic.cpp.

150 {
154 Ifile << "Cubic: s_xzero=" << f.s_xzero() << '\n';
155 indn.n += 2;
156 f.find_zero(z1, z2, z3);
157 Ifile << "Cubic: a=" << f.a() << " b=" << f.b() << " c=" << f.c()
158 << " d=" << f.d() << '\n';
159 file << " z1,2,3=" << z1 << ' ' << z2 << ' ' << z3 << '\n';
160 double r[3];
161 int q;
162 q = f.find_real_zero(r);
163 Ifile << "The number of real zeros =" << q << '\n';
164 int n;
165 Ifile << "Solutions=";
166 for (n = 0; n < q; n++)
167 file << ' ' << r[n];
168 file << '\n';
169 double xmm[2];
170 double ymm[2];
171 int s_mm[2];
172 q = f.find_maxmin(xmm, ymm, s_mm);
173 Ifile << "Max/Min, q=" << q << '\n';
174 indn.n += 2;
175 for (n = 0; n < q; n++) {
176 Ifile << "n=" << n << " xmm[n]=" << std::setw(13) << xmm[n]
177 << " ymm[n]=" << std::setw(13) << ymm[n]
178 << " s_mm[n]=" << std::setw(13) << s_mm[n] << '\n';
179 }
180 indn.n -= 2;
181 indn.n -= 2;
182
183 return file;
184}
double s_xzero(void) const
Definition: cubic.h:25
double b(void) const
Definition: cubic.h:22
int find_maxmin(double xmm[2], double ymm[2], int s_mm[2]) const
Definition: cubic.cpp:122
int find_real_zero(double z[3]) const
Definition: cubic.cpp:76
double c(void) const
Definition: cubic.h:23
double d(void) const
Definition: cubic.h:24
double a(void) const
Definition: cubic.h:21
void find_zero(double_complex &z1, double_complex &z2, double_complex &z3) const
Definition: cubic.cpp:25
std::complex< double > double_complex
Definition: cubic.h:20
indentation indn
Definition: prstream.cpp:13
#define Ifile
Definition: prstream.h:207