Summary
This issue tracks the addition of the Utils module from CTModels.jl to CTBase.jl.
Rationale
The Utils module contains general-purpose utility functions (interpolation, matrix operations, function transformations) that are not specific to optimal control problems. These utilities are better placed in CTBase.jl as they can be reused across the entire control-toolbox ecosystem.
Scope
Files to add:
src/Utils/Utils.jl (main module)
src/Utils/function_utils.jl (private utilities)
src/Utils/macros.jl (private utilities)
src/Utils/interpolation.jl (public utilities)
src/Utils/matrix_utils.jl (public utilities)
Tests to add:
test/suite/utils/test_function_utils.jl
test/suite/utils/test_interpolation.jl
test/suite/utils/test_macros.jl
test/suite/utils/test_matrix_utils.jl
Public API
The following functions will be added and accessible via CTBase.function_name():
ctinterpolate: Linear interpolation for data
ctinterpolate_constant: Piecewise-constant interpolation for data
matrix2vec: Convert matrices to vectors
Implementation Plan
- Create branch for the addition
- Add Utils module to CTBase.jl
- Add tests to CTBase.jl
- Update documentation
- Ensure compatibility with CTBase dependencies
Dependencies
DocStringExtensions (already in CTBase)
- No additional dependencies required
Related Issues
Summary
This issue tracks the addition of the
Utilsmodule from CTModels.jl to CTBase.jl.Rationale
The
Utilsmodule contains general-purpose utility functions (interpolation, matrix operations, function transformations) that are not specific to optimal control problems. These utilities are better placed in CTBase.jl as they can be reused across the entire control-toolbox ecosystem.Scope
Files to add:
src/Utils/Utils.jl(main module)src/Utils/function_utils.jl(private utilities)src/Utils/macros.jl(private utilities)src/Utils/interpolation.jl(public utilities)src/Utils/matrix_utils.jl(public utilities)Tests to add:
test/suite/utils/test_function_utils.jltest/suite/utils/test_interpolation.jltest/suite/utils/test_macros.jltest/suite/utils/test_matrix_utils.jlPublic API
The following functions will be added and accessible via
CTBase.function_name():ctinterpolate: Linear interpolation for datactinterpolate_constant: Piecewise-constant interpolation for datamatrix2vec: Convert matrices to vectorsImplementation Plan
Dependencies
DocStringExtensions(already in CTBase)Related Issues