NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
Solver.h
1 // Solver.h
2 //
3 // Author : Jeromy Tompkins
4 // Date : 8/14/2013
5 
6 #ifndef SOLVER_H
7 #define SOLVER_H
8 
9 
10 #include <deque>
11 #include "TObject.h"
12 
13 namespace TrAnal
14 {
15 
17 
22 class Solver
23 {
24 
25  public:
27 
31  virtual double operator()(const std::deque<double>& que) const =0;
32 
34  virtual unsigned int npoints() const = 0;
35 
36  // ROOT dictionary generating code
38  ClassDef(Solver,0);
40 
41 }; // end Solver
42 
45 class LinearSolver : public Solver
46 {
47 
48  public:
50 
57  virtual double operator() (const std::deque<double>& que) const;
58 
60  virtual unsigned int npoints() const {return 2;}
61 
62  // ROOT dictionary generating code
64  ClassDef(LinearSolver,0);
66 
67 }; // end LinearSolver
68 
69 } // end namespace
70 
71 #endif
virtual double operator()(const std::deque< double > &que) const
Interpolates between two points linear to find a zero crossing.
Definition: Solver.cpp:11
Pure abstract base class for root-finding algorithms.
Definition: Solver.h:22
virtual unsigned int npoints() const =0
The minimum number of points required by the algorithm to define unique solution. ...
virtual double operator()(const std::deque< double > &que) const =0
The root-finding algorithm.
Definition: AlgoIterator.hpp:12
virtual unsigned int npoints() const
Number of points required for a unique solution.
Definition: Solver.h:60
Root finder based on linear interpolation.
Definition: Solver.h:45