NanoStructures  1.0
DMFT solver for layered, strongly correlated nanostructures
pfunction.h
1 #ifndef PFUNCTION_H
2 #define PFUNCTION_H
3 
4 #include "../utils/mpreal.h"
5 
6 namespace math {
7 class CFunction;
8 class PFunction
9 {
10 public:
11  PFunction();
12  PFunction(int length);
13  PFunction(const PFunction& orig);
14  PFunction& operator=(const PFunction& orig);
15 
16  PFunction(const CFunction& orig);
17  PFunction& operator=(const CFunction& orig);
18 
19  virtual ~PFunction();
20 
21  void resize(int length);
22  int getSize() const { return m_length; }
23 
24  void set(int index, mpfr::mpreal argument, mpfr::mpreal value);
25  void setArgument(int index, mpfr::mpreal argument);
26  void setValue(int index, mpfr::mpreal value);
27  mpfr::mpreal getArgument(int index) const;
28  mpfr::mpreal getValue(int index) const;
29 
30  //convenience
31  mpfr::mpreal integrate(mpfr::mpreal x_1, mpfr::mpreal x_2) const;
32  mpfr::mpreal integrate_arg(mpfr::mpreal x_1, mpfr::mpreal x_2) const;
33 
34 protected:
35  mpfr::mpreal* m_arguments;
36  mpfr::mpreal* m_values;
37  int m_length;
38 
39  //befriend output operator
40  friend std::ostream& operator<<(std::ostream& stream, const math::PFunction& p);
41 
42 };
43 std::ostream& operator<<(std::ostream& stream, const math::PFunction& p);
44 }
45 
46 #endif // PFUNCTION_H
Definition: mpreal.h:52
Definition: pfunction.h:8
Discretized complex-valued function for real arguments.
Definition: cfunction.h:34