CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RealQuadEquation.h
Go to the documentation of this file.
1 #ifndef RealQuadEquation_H
2 #define RealQuadEquation_H
3 
4 #include <utility>
5 #include <cmath>
7 
13 
15  double first;
16  double second;
17 
18  RealQuadEquation( double A, double B, double C) {
19  double D = B*B - 4*A*C;
20  if (D<0) hasSolution = false;
21  else {
22  hasSolution = true;
23  double q = -0.5*(B + (B>0 ? sqrt(D) : -sqrt(D)));
24  first = q/A;
25  second = C/q;
26  }
27  }
28 
29 };
30 
31 #endif
RealQuadEquation(double A, double B, double C)
U second(std::pair< T, U > const &p)
T sqrt(T t)
Definition: SSEVec.h:46
#define dso_internal
Definition: Visibility.h:13
bool first
Definition: L1TdeRCT.cc:94
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150