thermometer.h
1 /***************************************************************************
2  Copyright (C) 2002-2015 Kentaro Kitagawa
3  kitagawa@phys.s.u-tokyo.ac.jp
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  You should have received a copy of the GNU Library General
11  Public License and a list of authors along with this program;
12  see the files COPYING and AUTHORS.
13 ***************************************************************************/
14 //---------------------------------------------------------------------------
15 
16 #ifndef thermometerH
17 #define thermometerH
18 
19 #include "xnode.h"
20 #include "xlistnode.h"
21 #include "cspline.h"
22 
23 class XThermometer : public XNode {
24 public:
25  XThermometer(const char *name, bool runtime);
26  virtual ~XThermometer() {}
27 
28  virtual double getTemp(double res) const = 0;
29  virtual double getRawValue(double temp) const = 0;
30 
31  const shared_ptr<XDoubleNode> &tempMin() const {return m_tempMin;}
32  const shared_ptr<XDoubleNode> &tempMax() const {return m_tempMax;}
33 private:
34  const shared_ptr<XDoubleNode> m_tempMin, m_tempMax;
35 };
36 
37 class XThermometerList : public XCustomTypeListNode<XThermometer> {
38 public:
39  XThermometerList(const char *name, bool runtime);
40  virtual ~XThermometerList() {}
41 
42  DEFINE_TYPE_HOLDER()
43 protected:
44  virtual shared_ptr<XNode> createByTypename(
45  const XString &type, const XString &name) {
46  shared_ptr<XNode> ptr = (creator(type))(name.c_str(), false);
47  if(ptr) insert(ptr);
48  return ptr;
49  }
50 };
51 
52 //chebichev polynominal
53 class XLakeShore : public XThermometer {
54 public:
55  XLakeShore(const char *name, bool runtime);
56  virtual ~XLakeShore() {}
57 
58  double getTemp(double res) const;
59  double getRawValue(double temp) const;
60 
61  const shared_ptr<XDoubleNode> &resMin() const {return m_resMin;}
62  const shared_ptr<XDoubleNode> &resMax() const {return m_resMax;}
64  const shared_ptr<XDoubleListNode> &zu() const {return m_zu;}
65  const shared_ptr<XDoubleListNode> &zl() const {return m_zl;}
67  const shared_ptr<XDouble2DNode> &ai() const {return m_ai;}
68 private:
69  const shared_ptr<XDoubleNode> m_resMin, m_resMax;
70  const shared_ptr<XDoubleListNode> m_zu, m_zl;
71  const shared_ptr<XDouble2DNode> m_ai;
72 
73 };
74 
76 public:
77  XScientificInstruments(const char *name, bool runtime);
78  virtual ~XScientificInstruments() {}
79 
80  double getTemp(double res) const;
81  double getRawValue(double temp) const;
82 
83  const shared_ptr<XDoubleNode> &resMin() const {return m_resMin;}
84  const shared_ptr<XDoubleNode> &resMax() const {return m_resMax;}
86  const shared_ptr<XDoubleListNode> &abcde() const {return m_abcde;}
87  const shared_ptr<XDoubleListNode> &abc() const {return m_abc;}
88  const shared_ptr<XDoubleNode> &rCrossover() const {return m_rCrossover;}
89 private:
90  const shared_ptr<XDoubleNode> m_resMin, m_resMax;
91  const shared_ptr<XDoubleListNode> m_abcde, m_abc;
92  const shared_ptr<XDoubleNode> m_rCrossover;
93 };
94 
95 //! Cubic (natural) spline approximation.
97 public:
98  XApproxThermometer(const char *name, bool runtime);
99 
100  double getTemp(double res) const;
101  double getRawValue(double temp) const;
102 
104  const shared_ptr<XDoubleListNode> &resList() const {return m_resList;}
105  const shared_ptr<XDoubleListNode> &tempList() const {return m_tempList;}
106 private:
107  const shared_ptr<XDoubleListNode> m_resList, m_tempList;
108  mutable atomic_shared_ptr<CSplineApprox> m_approx, m_approx_inv;
109 };
110 
111 //---------------------------------------------------------------------------
112 #endif

Generated for KAME4 by  doxygen 1.8.3