Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef EVALUATOR_H_
- #define EVALUATOR_H_
- #include "Expression.h"
- #include "ValueModel.h"
- #include <vector>
- namespace core {
- template<class T> class Evaluator
- {
- public:
- typedef std::pair <std::vector<T>, std::vector<T>> Shape;
- static Shape BuildShape (const T&, const T&, const T&, ValueModel<T>*, Expression<T>*);
- };
- template<class T>
- typename Evaluator<T>::Shape Evaluator<T>::BuildShape (const T& min, const T& max, const T& step, ValueModel<T>* v, Expression<T>* e)
- {
- std::vector<T> x,y;
- for (T i=min; i <= max; i+= step)
- {
- v->setValue(i);
- x.push_back(i);
- y.push_back(e->evaluate());
- }
- return Shape(x,y);
- }
- }
- #endif
Add Comment
Please, Sign In to add comment