Repository navigation
[SimpleSVM] Implement Pimpl idiom and remove direct libSVM dependencies - #7892
Conversation
WalkthroughThe changes refactor the Changes
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (8)
src/openms/include/OpenMS/ML/SVM/SimpleSVM.h (1)
78-81: Preventing copying is a good move
Deleting the copy constructor and assignment operator aligns with the Pimpl idiom. If move semantics are needed later, consider adding a move constructor and move assignment operator.src/openms/source/ML/SVM/SimpleSVM.cpp (7)
27-83: Implementation class effectively encapsulates internal details
Grouping the necessary data structures and parameters intoImplhelps keepSimpleSVM's public interface lean. Consider adding brief doc comments for each member to ensure clarity.
106-131: Handles feature scaling well
Predictors are scaled to [0,1], and uninformative predictors are cleared. This approach is valid, but consider explicitly removing these predictors from the map to avoid potential confusion later.
133-162: Converts predictors to LIBSVM format
This logic is sound. If the commented-out condition at lines 149–151 is no longer needed, consider removing it to keep the codebase clean.
164-249: Potential method complexity
The nested loops and tie-breaking logic are correct but somewhat complex. Consider extracting the tie-breaking steps into a helper method or adding more inline comments for clarity.🧰 Tools
🪛 GitHub Check: CodeFactor
[notice] 164-249: src/openms/source/ML/SVM/SimpleSVM.cpp#L164-L249
Complex Method🪛 Cppcheck (2.10-2)
[error] 243-243: Out of bounds access in expression 'best_indexes[tiebreaker.rbegin()->second]' because 'best_indexes' is empty and 'tiebreaker.rbegin()->second' may be non-zero.
(containerOutOfBounds)
[error] 243-243: Out of bounds access in expression 'tiebreaker.rbegin()' because 'tiebreaker' is empty.
(containerOutOfBounds)
250-359: Efficient parameter optimization
The implementation thoroughly covers cross-validation. Although it is somewhat lengthy, it is logically structured. If reusability is desired, extracting smaller helper functions could improve readability.
541-563: Scaling logic for new data
This function reuses training ranges to scale new predictor data. Consider adding a sanity check to handle values that fall outside the original min-max range, to prevent undesired negative or >1 scaled values.
566-611: Predict method for novel data
Allocating a temporary arrayxworks with LIBSVM. Using a smart pointer or std::vector could simplify memory management but is optional.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/openms/include/OpenMS/ML/SVM/SimpleSVM.h(3 hunks)src/openms/source/ML/SVM/SimpleSVM.cpp(5 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeFactor
src/openms/source/ML/SVM/SimpleSVM.cpp
[notice] 164-249: src/openms/source/ML/SVM/SimpleSVM.cpp#L164-L249
Complex Method
🔇 Additional comments (12)
src/openms/include/OpenMS/ML/SVM/SimpleSVM.h (3)
13-14: Good removal of direct libSVM dependency
Removing the libSVM header from the public interface reduces compile-time dependencies and fosters better encapsulation.
20-20: Necessary include for std::unique_ptr
Importing<memory>is essential for usingstd::unique_ptrin this header.
135-139: Solid Pimpl usage
Forward declaringImpland storing it as astd::unique_ptreffectively hides implementation details.src/openms/source/ML/SVM/SimpleSVM.cpp (9)
18-21: Implementation-only inclusion
Shifting#include "svm.h"from the header to the source file adheres to the Pimpl principle by limiting exposure of third-party details.
85-95: Clean constructor and destructor
Usingclear_()in the destructor ensures resources are properly freed. This approach is consistent with RAII principles.
97-104: Properly frees allocated resources
clear_()ensures the SVM model memory and allocated arrays are freed to prevent memory leaks.
361-395: Comprehensive constructor initialization
Initializingpimpl_early and carefully setting default parameters is a good practice, ensuring consistent usage ofDefaultParamHandler.
397-498: Robust SVM setup
Properly differentiates classification vs. regression, validates input shapes, and ensures cross-validation feasibility. The error messages are descriptive and helpful.
499-539: Predict method for trained data
The boundary checks and probability-based predictions are prudent. The straightforward approach to populate 'predictions' is clear.
613-644: Feature weights for 2-class classification
Correctly accumulates coefficients for a 2-class SVM. For multi-class scenarios, this function raises an exception, which is an appropriate safeguard.
646-649: Provides direct access to scaling
Returning theScaleMapreference is straightforward.
652-668: Exports cross-validation results
Writing results to CSV with column headers is helpful for analysis.
d12741e to
4f5d524
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
src/openms/source/ML/SVM/SimpleSVM.cpp (1)
243-243: 🛠️ Refactor suggestionInvestigate the TODO about using begin vs rbegin
The current code uses
rbegin()with a commented TODO suggesting usingbegin()ifhigher_betteris false. This conditional logic should be implemented rather than left as a TODO.- const auto& indexes = best_indexes[tiebreaker.rbegin()->second]; // TODO: use begin if higher_better == false + // Use rbegin() for higher values (when higher_better is true) and begin() for lower values + const auto& indexes = best_indexes[higher_better ? tiebreaker.rbegin()->second : tiebreaker.begin()->second];🧰 Tools
🪛 Cppcheck (2.10-2)
[error] 243-243: Out of bounds access in expression 'best_indexes[tiebreaker.rbegin()->second]' because 'best_indexes' is empty and 'tiebreaker.rbegin()->second' may be non-zero.
(containerOutOfBounds)
[error] 243-243: Out of bounds access in expression 'tiebreaker.rbegin()' because 'tiebreaker' is empty.
(containerOutOfBounds)
🧹 Nitpick comments (2)
src/openms/source/ML/SVM/SimpleSVM.cpp (2)
164-248: Consider simplifying the chooseBestParameters_ methodThis method has been flagged by static analysis as complex. While it accurately handles parameter selection, it could benefit from being broken down into smaller, more focused functions.
Consider decomposing this method into separate functions:
- One for finding the best value
- One for resolving ties
- tuple<double, double, double> SimpleSVM::Impl::chooseBestParameters_(bool higher_better) const + // Find the best parameter set based on performance + vector<tuple<Size, Size, Size>> SimpleSVM::Impl::findBestParameterIndexes_(bool higher_better, double& best_value) const { auto is_better = [&higher_better](double l, double r)->bool { return higher_better ? (l > r) : (l < r); }; // which parameter set(s) achieved best cross-validation performance? double best_value_local = higher_better ? std::numeric_limits<double>::lowest() : std::numeric_limits<double>::max(); vector<tuple<Size, Size, Size>> best_indexes; for (Size g_index = 0; g_index < log2_gamma_.size(); ++g_index) { for (Size c_index = 0; c_index < log2_C_.size(); ++c_index) { for (Size p_index = 0; p_index < log2_p_.size(); ++p_index) { double value = performance_[g_index][c_index][p_index]; if (value == best_value_local) { best_indexes.emplace_back(g_index, c_index, p_index); // tie } else if (is_better(value, best_value_local)) { best_value_local = value; best_indexes.clear(); best_indexes.emplace_back(g_index, c_index, p_index); } } } } OPENMS_LOG_INFO << "Best cross-validation performance: " << best_value_local << " (ties: " << best_indexes.size() << ")" << endl; + best_value = best_value_local; + return best_indexes; } + // Resolve ties by looking at neighboring parameter performance + tuple<Size, Size, Size> SimpleSVM::Impl::resolveTiesByNeighbors_(const vector<tuple<Size, Size, Size>>& best_indexes) const + { if (best_indexes.size() == 1) { return best_indexes[0]; } // break ties between parameter sets - look at "neighboring" parameters: multimap<pair<double, Size>, Size> tiebreaker; for (Size i = 0; i < best_indexes.size(); ++i) { const auto& indexes = best_indexes[i]; Size n_neighbors = 0; double neighbor_value = 0.0; if (std::get<0>(indexes) > 0) { neighbor_value += performance_[std::get<0>(indexes) - 1][std::get<1>(indexes)][std::get<2>(indexes)]; ++n_neighbors; } if (std::get<0>(indexes) + 1 < log2_gamma_.size()) { neighbor_value += performance_[std::get<0>(indexes) + 1][std::get<1>(indexes)][std::get<2>(indexes)]; ++n_neighbors; } if (std::get<1>(indexes) > 0) { neighbor_value += performance_[std::get<0>(indexes)][std::get<1>(indexes) - 1][std::get<2>(indexes)]; ++n_neighbors; } if (std::get<1>(indexes) + 1 < log2_C_.size()) { neighbor_value += performance_[std::get<0>(indexes)][std::get<1>(indexes) + 1][std::get<2>(indexes)]; ++n_neighbors; } if (std::get<2>(indexes) > 0) { neighbor_value += performance_[std::get<0>(indexes)][std::get<1>(indexes)][std::get<2>(indexes) - 1]; ++n_neighbors; } if (std::get<2>(indexes) + 1 < log2_p_.size()) { neighbor_value += performance_[std::get<0>(indexes)][std::get<1>(indexes)][std::get<2>(indexes) + 1]; ++n_neighbors; } neighbor_value /= n_neighbors; // avg. performance of neighbors tiebreaker.insert(make_pair(make_pair(neighbor_value, n_neighbors), i)); } return best_indexes[tiebreaker.rbegin()->second]; // use begin if higher_better == false + } + tuple<double, double, double> SimpleSVM::Impl::chooseBestParameters_(bool higher_better) const + { + double best_value; + auto best_indexes = findBestParameterIndexes_(higher_better, best_value); + auto best_index = resolveTiesByNeighbors_(best_indexes); + + return make_tuple(log2_C_[std::get<1>(best_index)], + log2_gamma_[std::get<0>(best_index)], + log2_p_[std::get<2>(best_index)]); }🧰 Tools
🪛 GitHub Check: CodeFactor
[notice] 164-249: src/openms/source/ML/SVM/SimpleSVM.cpp#L164-L249
Complex Method🪛 Cppcheck (2.10-2)
[error] 243-243: Out of bounds access in expression 'best_indexes[tiebreaker.rbegin()->second]' because 'best_indexes' is empty and 'tiebreaker.rbegin()->second' may be non-zero.
(containerOutOfBounds)
[error] 243-243: Out of bounds access in expression 'tiebreaker.rbegin()' because 'tiebreaker' is empty.
(containerOutOfBounds)
544-566: Consider moving the utility function into the Impl classThe free function
scaleDataUsingTrainingRangesseems like it should be a method of theImplclass since it's closely related to the implementation details.- void scaleDataUsingTrainingRanges(SimpleSVM::PredictorMap& predictors, const map<String, pair<double, double>>& scaling) + void SimpleSVM::Impl::scaleDataUsingTrainingRanges(SimpleSVM::PredictorMap& predictors) const { // scale each feature dimension to the min-max-range for (auto pred_it = predictors.begin(); pred_it != predictors.end(); ++pred_it) { if (pred_it->second.empty()) continue; // uninformative predictor auto val_begin = pred_it->second.begin(); auto val_end = pred_it->second.end(); for (; val_begin != val_end; ++val_begin) { if (scaling.count(pred_it->first) == 0) - if (scaling_.count(pred_it->first) == 0) { //std::cout << "Predictor: '" << pred_it->first << "' not found in scale map because it was uninformative during training." << std::endl; continue; } - auto [min, max] = scaling.at(pred_it->first); + auto [min, max] = scaling_.at(pred_it->first); double range = max - min; *val_begin = (*val_begin - min) / range; } } }Then update the predict method to use this method:
- scaleDataUsingTrainingRanges(predictors, pimpl_->scaling_); + pimpl_->scaleDataUsingTrainingRanges(predictors);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/openms/include/OpenMS/ML/SVM/SimpleSVM.h(3 hunks)src/openms/source/ML/SVM/SimpleSVM.cpp(5 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeFactor
src/openms/source/ML/SVM/SimpleSVM.cpp
[notice] 164-249: src/openms/source/ML/SVM/SimpleSVM.cpp#L164-L249
Complex Method
🔇 Additional comments (15)
src/openms/include/OpenMS/ML/SVM/SimpleSVM.h (4)
13-14: Good removal of direct libSVM dependency from the headerThis change reduces coupling and compilation dependencies by removing the direct inclusion of the libSVM header from the public interface. This aligns with the PR's objective of implementing the Pimpl idiom.
20-20: Good addition of memory header for std::unique_ptrAdding the memory header is necessary to support the std::unique_ptr which is a key component of the Pimpl idiom implementation.
78-80: Good prevention of copyingCorrectly deleting the copy constructor and copy assignment operator prevents shallow copying of the unique_ptr which would lead to double deletion. This is a necessary part of implementing the Pimpl idiom with a unique_ptr.
135-139: Good Pimpl idiom implementationThe forward declaration of the Impl class and the use of std::unique_ptr as a member variable correctly implements the Pimpl idiom. This effectively hides the implementation details from clients of this header.
src/openms/source/ML/SVM/SimpleSVM.cpp (11)
18-20: Good isolation of libSVM dependency to implementation fileMoving the libSVM include to the implementation file is a key part of the Pimpl idiom implementation, ensuring that clients of the SimpleSVM class don't need to have libSVM headers available.
27-83: Good implementation of the private implementation classThe Impl class correctly encapsulates all the libSVM-specific data structures and functionality that was previously directly in the SimpleSVM class. The class definition is well-structured with clear member variables and methods.
361-395: Good implementation of the SimpleSVM constructorThe constructor correctly initializes the implementation object and sets up all the parameters with appropriate documentation and validation.
396-400: Good implementation of the SimpleSVM destructorThe destructor explicitly resets the unique_ptr to the implementation object, which ensures proper cleanup.
402-500: Good delegation of setup method to implementationThe setup method properly delegates to the Impl object's methods while maintaining the original error checking and validation logic.
503-542: Good delegation of prediction on training dataThe predict method correctly delegates to the implementation while maintaining the same interface and error checking.
569-614: Good implementation of prediction on new dataThe prediction method for new data correctly handles scaling and prediction while maintaining the same interface.
617-647: Good delegation of feature weight retrievalThe getFeatureWeights method correctly delegates to the implementation while maintaining the same interface and error checking.
649-652: Good delegation of scaling retrievalThe getScaling method properly delegates to the implementation's scaling data.
655-671: Good delegation of cross-validation resultsThe writeXvalResults method correctly delegates to the implementation while maintaining the same interface.
199-200:Details
✅ Verification successful
Investigate the commented TODO about parameter order
There's a TODO comment questioning why the order of parameters was changed. This should be investigated and either fixed or the comment should be removed if the current order is correct.
🏁 Script executed:
#!/bin/bash # Check if there's any specific reason for the parameter order documented elsewhere rg -A 2 "parameter.*order" --no-ignore-vcsLength of output: 24991
Parameter Order in SimpleSVM Is Confirmed as Intended – Remove the Superfluous TODO Comment
After exploring the repository for additional documentation on parameter order (including related patterns elsewhere), there isn’t any evidence that the current order in SimpleSVM.cpp deviates from the intended design. Similar modules that enforce a specific ordering explain their choices (or note historical accidents), but nothing indicates a required change for the SVM parameters in this case.
- The investigation did not uncover supporting documentation or usage examples that justify altering the current order.
- In light of this, the TODO comment questioning the parameter order appears outdated and can be removed.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
src/openms/source/ML/SVM/SimpleSVM.cpp (3)
149-153: Remove or clarify commented codeThere's commented code that suggests filtering values > 0.0 was previously implemented. Since this is now commented out, either remove it completely or add a clear comment explaining why it was removed but kept as a comment.
-// if (value > 0.0) // TODO: why > 0.0? -// { svm_node node = {pred_index, value}; nodes_[obs_index].push_back(node); -// }
545-567: Consider moving helper function into the Impl classThe
scaleDataUsingTrainingRangesfunction appears to be a helper function for theSimpleSVMclass, but it's defined at global scope. For better encapsulation, consider moving this function inside theSimpleSVM::Implclass, which will make the relationship clearer and prevent potential name conflicts.-void scaleDataUsingTrainingRanges(SimpleSVM::PredictorMap& predictors, const map<String, pair<double, double>>& scaling) +void SimpleSVM::Impl::scaleDataUsingTrainingRanges(SimpleSVM::PredictorMap& predictors, const map<String, pair<double, double>>& scaling)Then update the call in the
predictmethod:- scaleDataUsingTrainingRanges(predictors, pimpl_->scaling_); + pimpl_->scaleDataUsingTrainingRanges(predictors, pimpl_->scaling_);
197-200: Clarify the order of parameters in returned tupleThere's a TODO comment questioning why the order of parameters changed. Please address this comment by either correcting the order if it's inconsistent or clarifying why it's intentionally different.
- return make_tuple( - log2_C_[std::get<1>(best_indexes[0])], // TODO: check why order changed - log2_gamma_[std::get<0>(best_indexes[0])], - log2_p_[std::get<2>(best_indexes[0])]); + // Order is C, gamma, p to match the function's return signature + return make_tuple( + log2_C_[std::get<1>(best_indexes[0])], + log2_gamma_[std::get<0>(best_indexes[0])], + log2_p_[std::get<2>(best_indexes[0])]);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/openms/source/ML/SVM/SimpleSVM.cpp(5 hunks)
🧰 Additional context used
🪛 Cppcheck (2.10-2)
src/openms/source/ML/SVM/SimpleSVM.cpp
[error] 244-244: Out of bounds access in expression 'best_indexes[higher_better?tiebreaker.rbegin()->second
(containerOutOfBounds)
🔇 Additional comments (3)
src/openms/source/ML/SVM/SimpleSVM.cpp (3)
18-20: Good implementation of the Pimpl patternThe code now properly includes the libSVM header only in the implementation file, which successfully removes the direct dependency from the header file. This is exactly what the Pimpl idiom is designed for - hiding implementation details and reducing dependencies.
27-83: Well-structured implementation classThe
SimpleSVM::Implclass encapsulates all the libSVM-related implementation details effectively. The class is organized with clear member variables and methods to handle SVM operations while keeping the public API clean. Particularly good use of private utilities likeprintNull_,scaleData_, and other helper methods to modularize the implementation.
362-401: Good implementation of Pimpl constructor/destructorThe constructor correctly initializes the
Implobject with astd::unique_ptr, and the destructor explicitly resets the pointer, which follows best practices for the Pimpl idiom. The initialization of defaults is well-structured and clear.
| Size n_obs = predictors.begin()->second.size(); | ||
| pimpl_->n_parts_ = param_.getValue("xval"); | ||
|
|
||
| // clear old models |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Address potential out-of-bounds access
The static analyzer flagged a potential out-of-bounds access here. While this is likely a false positive because tiebreaker should never be empty when this code is reached (as you return early at line 195 if best_indexes.size() == 1), it's better to add a safeguard to prevent any possibility of undefined behavior.
- const auto& indexes = best_indexes[higher_better ? tiebreaker.rbegin()->second : tiebreaker.begin()->second];
+ // Ensure tiebreaker is not empty before accessing its elements
+ if (tiebreaker.empty()) {
+ // This should never happen based on code logic, but handle it anyway
+ return make_tuple(log2_C_[std::get<1>(best_indexes[0])],
+ log2_gamma_[std::get<0>(best_indexes[0])],
+ log2_p_[std::get<2>(best_indexes[0])]);
+ }
+ const auto& indexes = best_indexes[higher_better ? tiebreaker.rbegin()->second : tiebreaker.begin()->second];Let's verify that our understanding of the code flow is correct:
🏁 Script executed:
#!/bin/bash
# Verify that tiebreaker is always populated when we reach line 244
# and that we never reach line 244 with an empty tiebreaker
# Check if the function ever returns early without populating tiebreaker
echo "Checking control flow in chooseBestParameters_:"
rg -A 10 -B 5 "chooseBestParameters_" src/openms/source/ML/SVM/SimpleSVM.cppLength of output: 2059
Fix potential out-of-bounds access in SimpleSVM::chooseBestParameters_
While the control flow (with an early return when only one candidate is present) should normally ensure that the tiebreaker container is populated, the static analyzer correctly flags a potential risk if, against expectations, tiebreaker were empty. To guard against any unexpected behavior, please add an explicit check before accessing its elements. This change will protect against undefined behavior even in scenarios not originally anticipated by the design.
Please update the code in src/openms/source/ML/SVM/SimpleSVM.cpp (around line 244) as follows:
- const auto& indexes = best_indexes[higher_better ? tiebreaker.rbegin()->second : tiebreaker.begin()->second];
+ // Ensure tiebreaker is not empty before accessing its elements
+ if (tiebreaker.empty()) {
+ // This should never happen based on code logic, but handle it safely
+ return make_tuple(log2_C_[std::get<1>(best_indexes[0])],
+ log2_gamma_[std::get<0>(best_indexes[0])],
+ log2_p_[std::get<2>(best_indexes[0])]);
+ }
+ const auto& indexes = best_indexes[higher_better ? tiebreaker.rbegin()->second : tiebreaker.begin()->second];This safeguard addresses potential false positives and ensures robustness against any unforeseen control flow issues.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const auto& indexes = best_indexes[higher_better ? tiebreaker.rbegin()->second : tiebreaker.begin()->second]; | |
| // Ensure tiebreaker is not empty before accessing its elements | |
| if (tiebreaker.empty()) { | |
| // This should never happen based on code logic, but handle it safely | |
| return make_tuple(log2_C_[std::get<1>(best_indexes[0])], | |
| log2_gamma_[std::get<0>(best_indexes[0])], | |
| log2_p_[std::get<2>(best_indexes[0])]); | |
| } | |
| const auto& indexes = best_indexes[higher_better ? tiebreaker.rbegin()->second : tiebreaker.begin()->second]; |
🧰 Tools
🪛 Cppcheck (2.10-2)
[error] 244-244: Out of bounds access in expression 'best_indexes[higher_better?tiebreaker.rbegin()->second
(containerOutOfBounds)
|
thanks! looks good to me :) |
Implement Pimpl idiom and remove direct libSVM dependencies
Fixes #6378
Description
Removed the direct inclusion of <svm.h> header
Added header for std::unique_ptr
Added deleted copy constructor and assignment operator
Removed all implementation details (member variables and private methods) from the header file
Added a forward declaration for an Impl class
Added a std::unique_ptr member called pimpl_ to manage the implementation
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI buildsPR Type
Enhancement
Description
Refactored
SimpleSVMclass to use the PIMPL idiom for encapsulation.Removed direct dependencies on
libSVMfrom the header file.Introduced a new implementation class
SimpleSVM::Implto handle internal logic.Improved modularity and maintainability by delegating functionality to the implementation class.
Changes walkthrough 📝
SimpleSVM.cpp
Refactor `SimpleSVM` implementation using PIMPL idiomsrc/openms/source/ML/SVM/SimpleSVM.cpp
SimpleSVM::Implclass to encapsulate internal logic.libSVM-specific code and data structures to the implementationfile.
Implfor scaling, data conversion, and parameteroptimization.
SimpleSVMmethods to delegate functionality to theImplclass.SimpleSVM.h
Update `SimpleSVM` header for PIMPL patternsrc/openms/include/OpenMS/ML/SVM/SimpleSVM.h
libSVMheader.SimpleSVM::Implclass.std::unique_ptrtoImplfor encapsulation.Impl.Summary by CodeRabbit
Summary by CodeRabbit
New Features
Refactor