Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// G4JTPolynomialSolver
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -37,86 +37,80 @@
|
||||
// op - double precision vector of coefficients in order of
|
||||
// decreasing powers
|
||||
// degree - integer degree of polynomial
|
||||
//
|
||||
//
|
||||
// ----------------------------- OUTPUT -------------------------------
|
||||
//
|
||||
// zeror,zeroi - double precision vectors of the
|
||||
// real and imaginary parts of the zeros
|
||||
//
|
||||
//
|
||||
// ---------------------------- EXAMPLE -------------------------------
|
||||
//
|
||||
//
|
||||
// G4JTPolynomialSolver trapEq ;
|
||||
// G4double coef[8] ;
|
||||
// G4double zr[7] , zi[7] ;
|
||||
// G4int num = trapEq.FindRoots(coef,7,zr,zi);
|
||||
|
||||
// ---------------------------- HISTORY -------------------------------
|
||||
//
|
||||
// Translated from original TOMS493 Fortran77 routine (ANSI C, by C.Bond).
|
||||
// Translated to C++ and adapted to use STL vectors,
|
||||
// by Oliver Link (Oliver.Link@cern.ch)
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Author: Oliver Link, 15.02.2005
|
||||
// Translated to C++ and adapted to use STL vectors.
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4JTPOLYNOMIALSOLVER_HH
|
||||
#define G4JTPOLYNOMIALSOLVER_HH
|
||||
#define G4JTPOLYNOMIALSOLVER_HH 1
|
||||
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
class G4JTPolynomialSolver
|
||||
class G4JTPolynomialSolver
|
||||
{
|
||||
public:
|
||||
G4JTPolynomialSolver();
|
||||
~G4JTPolynomialSolver();
|
||||
|
||||
public:
|
||||
G4int FindRoots(G4double* op, G4int degree, G4double* zeror, G4double* zeroi);
|
||||
|
||||
G4JTPolynomialSolver();
|
||||
~G4JTPolynomialSolver();
|
||||
|
||||
G4int FindRoots(G4double *op, G4int degree,
|
||||
G4double *zeror, G4double *zeroi);
|
||||
private:
|
||||
void Quadratic(G4double a, G4double b1, G4double c, G4double* sr,
|
||||
G4double* si, G4double* lr, G4double* li);
|
||||
void ComputeFixedShiftPolynomial(G4int l2, G4int* nz);
|
||||
void QuadraticPolynomialIteration(G4double* uu, G4double* vv, G4int* nz);
|
||||
void RealPolynomialIteration(G4double* sss, G4int* nz, G4int* iflag);
|
||||
void ComputeScalarFactors(G4int* type);
|
||||
void ComputeNextPolynomial(G4int* type);
|
||||
void ComputeNewEstimate(G4int type, G4double* uu, G4double* vv);
|
||||
void QuadraticSyntheticDivision(G4int n, G4double* u, G4double* v,
|
||||
std::vector<G4double>& p,
|
||||
std::vector<G4double>& q, G4double* a,
|
||||
G4double* b);
|
||||
|
||||
private:
|
||||
private:
|
||||
std::vector<G4double> p;
|
||||
std::vector<G4double> qp;
|
||||
std::vector<G4double> k;
|
||||
std::vector<G4double> qk;
|
||||
std::vector<G4double> svk;
|
||||
|
||||
std::vector<G4double> p;
|
||||
std::vector<G4double> qp;
|
||||
std::vector<G4double> k;
|
||||
std::vector<G4double> qk;
|
||||
std::vector<G4double> svk;
|
||||
G4double sr = 0.0;
|
||||
G4double si = 0.0;
|
||||
G4double u = 0.0, v = 0.0;
|
||||
G4double a = 0.0, b = 0.0, c = 0.0, d = 0.0;
|
||||
G4double a1 = 0.0, a3 = 0.0, a7 = 0.0;
|
||||
G4double e = 0.0, f = 0.0, g = 0.0, h = 0.0;
|
||||
G4double szr = 0.0, szi = 0.0;
|
||||
G4double lzr = 0.0, lzi = 0.0;
|
||||
G4int n = 0;
|
||||
|
||||
G4double sr;
|
||||
G4double si;
|
||||
G4double u,v;
|
||||
G4double a,b,c,d;
|
||||
G4double a1,a3,a7;
|
||||
G4double e,f,g,h;
|
||||
G4double szr,szi;
|
||||
G4double lzr,lzi;
|
||||
G4int n;
|
||||
|
||||
/* The following statements set machine constants */
|
||||
/* The following statements set machine constants */
|
||||
|
||||
static const G4double base;
|
||||
static const G4double eta;
|
||||
static const G4double infin;
|
||||
static const G4double smalno;
|
||||
static const G4double are;
|
||||
static const G4double mre;
|
||||
static const G4double lo;
|
||||
|
||||
void Quadratic(G4double a,G4double b1,G4double c,
|
||||
G4double *sr,G4double *si, G4double *lr,G4double *li);
|
||||
void ComputeFixedShiftPolynomial(G4int l2, G4int *nz);
|
||||
void QuadraticPolynomialIteration(G4double *uu,G4double *vv,G4int *nz);
|
||||
void RealPolynomialIteration(G4double *sss, G4int *nz, G4int *iflag);
|
||||
void ComputeScalarFactors(G4int *type);
|
||||
void ComputeNextPolynomial(G4int *type);
|
||||
void ComputeNewEstimate(G4int type,G4double *uu,G4double *vv);
|
||||
void QuadraticSyntheticDivision(G4int n, G4double *u, G4double *v,
|
||||
std::vector<G4double> &p,
|
||||
std::vector<G4double> &q,
|
||||
G4double *a, G4double *b);
|
||||
static const G4double base;
|
||||
static const G4double eta;
|
||||
static const G4double infin;
|
||||
static const G4double smalno;
|
||||
static const G4double are;
|
||||
static const G4double mre;
|
||||
static const G4double lo;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user