FuncSketch
Loading...
Searching...
No Matches
expression_evaluator.h
Go to the documentation of this file.
1/*
2 * Copyright 2026 MusicScience37 (Kenta Kabashima)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
20#pragma once
21
24
25namespace func_sketch::expressions {
26
31public:
39 static void operator()(
40 const Expression& expression, Real parameter, Real& result);
41
42private:
50 static void evaluate(
51 const Expression& expression, Number parameter, Number& result);
52
59 static void evaluate(const ConstantExpression& expression,
60 Number /*parameter*/, Number& result);
61
68 static void evaluate(const ParameterExpression& /*expression*/,
69 Number parameter, Number& result);
70
78 static void evaluate(
79 const UnaryExpression& expression, Number parameter, Number& result);
80
88 static void evaluate(
89 const BinaryExpression& expression, Number parameter, Number& result);
90
98 static void evaluate(const FunctionCallExpression& expression,
99 Number parameter, Number& result);
100};
101
102} // namespace func_sketch::expressions
static void evaluate(const Expression &expression, Number parameter, Number &result)
Evaluate an expression.
static void operator()(const Expression &expression, Real parameter, Real &result)
Evaluate an expression.
Definitions of common types.
double Real
Type of real numbers in this project.
std::variant< Integer, Real, Complex > Number
Type of numbers.
Definition of Expression class.