Skip to content

Commit

Permalink
Fix Coverity hits for PCA (uxlfoundation#3025)
Browse files Browse the repository at this point in the history
* Delete copy assignment operators.

* Delete copy assignment operators.

* Added user defined destructor.

* Delete copy assignment operator.

* Fixed the assignment operator.

* Fixed formatting.

* Removed comment.

* Canged the Input copy assignment to be deafult.

* Changed the assignment operator to default.

* explicitly set assignment operator to default.
  • Loading branch information
KateBlueSky authored Jan 8, 2025
1 parent 37eb64f commit ad57656
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class Batch : public daal::algorithms::quality_metric::Batch
input.set(eigenvalues, other.input.get(eigenvalues));
}

~Batch() = default;

/**
* Returns the method of the algorithm
* \return Method of the algorithm
Expand Down
2 changes: 2 additions & 0 deletions cpp/daal/include/algorithms/pca/pca_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class DAAL_EXPORT Input : public InputIface
public:
Input();
Input(const Input & other);
Input & operator=(const Input & other);

virtual ~Input() {};

Expand Down Expand Up @@ -556,6 +557,7 @@ class DistributedInput<correlationDense> : public InputIface
public:
DAAL_EXPORT DistributedInput();
DAAL_EXPORT DistributedInput(const DistributedInput & other);
DAAL_EXPORT DistributedInput operator=(const DistributedInput & other);

/**
* Sets input objects for the PCA on the second step in the distributed processing mode
Expand Down
2 changes: 1 addition & 1 deletion cpp/daal/src/algorithms/pca/pca_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ InputIface::InputIface(const InputIface & other) : daal::algorithms::Input(other

Input::Input() : InputIface(lastInputDatasetId + 1) {};
Input::Input(const Input & other) : InputIface(other) {}

Input & Input::operator=(const Input & other) = default;
/**
* Returns the input object of the PCA algorithm
* \param[in] id Identifier of the input object
Expand Down
1 change: 1 addition & 0 deletions cpp/daal/src/algorithms/pca/pca_result_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ResultImpl : public data_management::DataCollection
bool isWhitening;
ResultImpl(const size_t n) : DataCollection(n), isWhitening(false) {}
ResultImpl(const ResultImpl & o) : DataCollection(o), isWhitening(o.isWhitening) {}
ResultImpl & operator=(const ResultImpl & o) = default;
virtual ~ResultImpl() {};

/**
Expand Down

0 comments on commit ad57656

Please sign in to comment.