// Copyright (C) 2026 Kiyotsugu Arai // SPDX-License-Identifier: LGPL-3.0-or-later // optimization_1d.hpp #ifndef SANGI_OPTIMIZATION_1D_HPP #define SANGI_OPTIMIZATION_1D_HPP #include "optimization_base.hpp" namespace sangi { /** * @brief One-dimensional minimization by the golden-section search * @tparam T A field type with an order structure (real numbers, etc.) * @param f The function to minimize * @param a Lower bound of the interval * @param b Upper bound of the interval * @param options Optimization options * @return A tuple of the minimizing point, the minimum value, and the optimization status */ template OptimizationResult1D golden_section_search( const std::function& f, T a, T b, const OptimizationOptions& options = OptimizationOptions()); /** * @brief One-dimensional minimization by Brent's method * @tparam T A field type with an order structure (real numbers, etc.) * @param f The function to minimize * @param a Lower bound of the interval * @param b Upper bound of the interval * @param options Optimization options * @return A tuple of the minimizing point, the minimum value, and the optimization status */ template OptimizationResult1D brent_minimize( const std::function& f, T a, T b, const OptimizationOptions& options = OptimizationOptions()); // Add other one-dimensional optimization algorithms here // Implementation is separated into optimization_1d_impl.hpp. } // namespace sangi #endif // SANGI_OPTIMIZATION_1D_HPP