tasmet/src/tasmet_pyeval.h

38 lines
949 B
C++

// tasmet_pyeval.h
//
// Author: J.A. de Jong
//
// Description: This file implements a helper class to evaluate simple
// 1D single-parameter python math functions
//////////////////////////////////////////////////////////////////////
#pragma once
#ifndef TASMET_PYEVAL_H
#define TASMET_PYEVAL_H
#include "tasmet_types.h"
class PythonQt;
// Helper class to evaluate simple 1D math function evaluations in Python
class EvaluateFun {
PythonQt* _pyqt;
public:
EvaluateFun(const string& fun_return);
// Add a global definition to the namespace
void addGlobalDef(const string& name,
const d value);
// Evaluate a single function at multiple points and return
// the result for each point
vd operator()(const vd& points);
// Used to cleanup the python namespace
~EvaluateFun();
};
#endif // TASMET_PYEVAL_H
//////////////////////////////////////////////////////////////////////