OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
PolynomialTimeDependence.h
Go to the documentation of this file.
1//
2// Copyright (c) 2026, Paul Scherrer Institute, Villigen PSI, Switzerland
3// All rights reserved
4//
5// This file is part of OPAL.
6//
7// OPAL is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// You should have received a copy of the GNU General License
13// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
14//
15
16#ifndef ALGORITHMS_POLYNOMIALTIMEDEPENDENCE_H_
17#define ALGORITHMS_POLYNOMIALTIMEDEPENDENCE_H_
18
19#include <vector>
21
22class Inform;
23
30public:
36 explicit PolynomialTimeDependence(const std::vector<double>& ptd) : coeffs(ptd) {}
37
40
42 ~PolynomialTimeDependence() override = default;
43
45 double getValue(double time) override;
46
48 double getIntegral(double time) override;
49
56
61 Inform& print(Inform& os) const;
62
64 const std::vector<double>& getCoefficients() const { return coeffs; }
65
66private:
67 std::vector<double> coeffs;
68};
69
70inline Inform& operator<<(Inform& os, const PolynomialTimeDependence& p) { return p.print(os); }
71
72#endif
Inform & operator<<(Inform &os, const PolynomialTimeDependence &p)
const std::vector< double > & getCoefficients() const
~PolynomialTimeDependence() override=default
Inform & print(Inform &os) const
PolynomialTimeDependence(const std::vector< double > &ptd)
PolynomialTimeDependence()=default
PolynomialTimeDependence * clone() override
double getIntegral(double time) override
double getValue(double time) override