CMS 3D CMS Logo

RealQuadEquation.h
Go to the documentation of this file.
1 #ifndef RealQuadEquation_H
2 #define RealQuadEquation_H
3 
4 #include <cmath>
6 
12 
13  double first;
14  double second;
16 
17  RealQuadEquation( double A, double B, double C) {
18  double D = B*B - 4*A*C;
19  if (D<0) hasSolution = false;
20  else {
21  hasSolution = true;
22  auto q = -0.5*(B + std::copysign(std::sqrt(D),B));
23  first = q/A;
24  second = C/q;
25  }
26  }
27 
28 };
29 
30 #endif
RealQuadEquation(double A, double B, double C)
T sqrt(T t)
Definition: SSEVec.h:18
static const std::string B
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
#define dso_internal