FuncSketch
Loading...
Searching...
No Matches
complex.cpp
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 */
21
26
27namespace func_sketch::math {
28
30 return MathFunction(
32 "real", [](Complex arg) { return std::real(arg); }));
33}
34
36 return MathFunction(
38 "imag", [](Complex arg) { return std::imag(arg); }));
39}
40
42 return MathFunction(
44 "arg", [](Complex arg) { return std::arg(arg); }));
45}
46
48 return MathFunction(
50 "conj", [](Complex arg) { return std::conj(arg); }));
51}
52
53} // namespace func_sketch::math
Definition of AcceptableTypes struct.
Class of mathematical functions.
Definitions of common types.
std::complex< Real > Complex
Type of complex numbers in this project.
Declaration of functions for complex numbers.
MathFunction arg_function()
Create arg function.
Definition complex.cpp:41
MathFunction imag_function()
Create imag function.
Definition complex.cpp:35
MathFunction real_function()
Create real function.
Definition complex.cpp:29
MathFunction conj_function()
Create conj function.
Definition complex.cpp:47
Definition of GeneralMathFunction class.
auto make_general_math_function(std::string name, FunctionType &&function)
Make a general mathematical function.
Definition of MathFunction class.
Traits struct to handle acceptable number types.