File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,10 @@ include("coupled_differential_systems.jl")
1313include (" algebraic_functions.jl" )
1414include (" frontend.jl" )
1515
16+ # Add method dispatch system
17+ include (" methods.jl" )
18+
19+ # Export method interface
20+ export AbstractIntegrationMethod, RischMethod
21+
1622end # module
Original file line number Diff line number Diff line change 1+ # Method dispatch system for SymbolicIntegration.jl
2+
3+ """
4+ AbstractIntegrationMethod
5+
6+ Abstract supertype for all symbolic integration methods.
7+ """
8+ abstract type AbstractIntegrationMethod end
9+
10+ """
11+ RischMethod <: AbstractIntegrationMethod
12+
13+ Risch algorithm for symbolic integration of elementary functions.
14+
15+ # Fields
16+ - `use_algebraic_closure::Bool`: Whether to use algebraic closure for complex roots (default: true)
17+ - `catch_errors::Bool`: Whether to catch and handle algorithm errors gracefully (default: true)
18+ """
19+ struct RischMethod <: AbstractIntegrationMethod
20+ use_algebraic_closure:: Bool
21+ catch_errors:: Bool
22+
23+ function RischMethod (; use_algebraic_closure:: Bool = true , catch_errors:: Bool = true )
24+ new (use_algebraic_closure, catch_errors)
25+ end
26+ end
27+
28+ # Method dispatch integration
29+ function integrate (f:: Symbolics.Num , x:: Symbolics.Num , method:: RischMethod ; kwargs... )
30+ # Call existing integrate function with method options
31+ return integrate (f, x;
32+ useQQBar= method. use_algebraic_closure,
33+ catchNotImplementedError= method. catch_errors,
34+ catchAlgorithmFailedError= method. catch_errors,
35+ kwargs... )
36+ end
37+
38+ # Method traits
39+ method_supports_rational (method:: RischMethod ) = true
40+ method_supports_transcendental (method:: RischMethod ) = true
You can’t perform that action at this time.
0 commit comments