diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/linear_regression/unimodal.cpp | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/linear_regression/unimodal.cpp')
-rw-r--r-- | library/cpp/linear_regression/unimodal.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/library/cpp/linear_regression/unimodal.cpp b/library/cpp/linear_regression/unimodal.cpp index 729011012a..bbca9e9463 100644 --- a/library/cpp/linear_regression/unimodal.cpp +++ b/library/cpp/linear_regression/unimodal.cpp @@ -22,7 +22,7 @@ namespace { double SSE = 0.; - TOptimizationState(const TVector<double>& values) { + TOptimizationState(const TVector<double>& values) { SSE = InnerProduct(values, values); } @@ -44,7 +44,7 @@ double TGreedyParams::Point(const size_t step) const { return LowerBound * (1 - alpha) + UpperBound * alpha; } -double MakeUnimodal(TVector<double>& values, const TOptimizationParams& optimizationParams) { +double MakeUnimodal(TVector<double>& values, const TOptimizationParams& optimizationParams) { TOptimizationState state(values); TOptimizationState bestState = state; @@ -80,19 +80,19 @@ double MakeUnimodal(TVector<double>& values, const TOptimizationParams& optimiza return determination; } -double MakeUnimodal(TVector<double>& values) { +double MakeUnimodal(TVector<double>& values) { return MakeUnimodal(values, TOptimizationParams::Default(values)); } -double MakeUnimodal(TVector<double>& values, const TVector<double>& arguments, const TOptimizationParams& optimizationParams) { +double MakeUnimodal(TVector<double>& values, const TVector<double>& arguments, const TOptimizationParams& optimizationParams) { Y_ASSERT(values.size() == arguments.size()); - TMap<double, double> mapping; + TMap<double, double> mapping; for (size_t i = 0; i < values.size(); ++i) { mapping[arguments[i]] = values[i]; } - TVector<double> preparedValues; + TVector<double> preparedValues; preparedValues.reserve(mapping.size()); for (auto&& argWithValue : mapping) { @@ -113,6 +113,6 @@ double MakeUnimodal(TVector<double>& values, const TVector<double>& arguments, c return result; } -double MakeUnimodal(TVector<double>& values, const TVector<double>& arguments) { +double MakeUnimodal(TVector<double>& values, const TVector<double>& arguments) { return MakeUnimodal(values, arguments, TOptimizationParams::Default(values, arguments)); } |