Skip to content

Commit

Permalink
Merge pull request #14 from vnuczek/cross-validation
Browse files Browse the repository at this point in the history
Poprawki w działaniu z shared ptr oraz uzupełnienie gitignore
  • Loading branch information
ksiminski authored Sep 12, 2024
2 parents f0b59c7 + d9cae14 commit 3faf777
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ source/results/
/results/exp-005
/doxygen/html
/.vs
/.vscode
# Temporary VS file
*.pdb
8 changes: 5 additions & 3 deletions source/readers/cross_validation_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
#include "cross_validation_model.h"

ksi::cross_validation_model::cross_validation_model(ksi::reader& source_reader)
: pReader(source_reader.clone()) {}
{
pReader = std::shared_ptr<ksi::reader>(source_reader.clone());
}

ksi::cross_validation_model::cross_validation_model(const cross_validation_model& other)
: pReader(other.pReader)
{
pReader = std::shared_ptr<ksi::reader>(other.pReader->clone());
std::lock_guard<std::mutex> lock(other.datasets_mutex);
datasets = other.datasets;
}
Expand All @@ -23,7 +25,7 @@ ksi::cross_validation_model& ksi::cross_validation_model::operator=(const cross_
{
if (this != &other)
{
pReader = other.pReader;
pReader = std::shared_ptr<ksi::reader>(other.pReader->clone());
std::lock_guard<std::mutex> lock(other.datasets_mutex);
datasets = other.datasets;
}
Expand Down

0 comments on commit 3faf777

Please sign in to comment.