Skip to content

Commit

Permalink
Fix GCC build errors in PCA example
Browse files Browse the repository at this point in the history
  • Loading branch information
Vika-F committed Jan 8, 2025
1 parent ad57656 commit c16bffa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cpp/daal/include/algorithms/algorithm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,17 @@ class DAAL_EXPORT Argument

protected:
/**
* Copy constructor
* \param[in] other Instance of the same class to copy
*/
* Copy constructor
* \param[in] other Instance of the same class to copy
*/
Argument(const Argument & other);

/**
* Copy assignment operator
* \param[in] other Instance of the same class to copy
*/
Argument & operator=(const Argument & other);

/**
* Retrieves specified element
* \param[in] index Index of the element
Expand Down Expand Up @@ -326,6 +332,8 @@ class Input : public Argument
* \param[in] other Instance of the same class to copy
*/
Input(const Input & other) : Argument(other) {}

Input & operator=(const Input & other) = default;
};

/**
Expand Down
14 changes: 14 additions & 0 deletions cpp/daal/include/data_management/data/data_dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,25 @@ class NumericTableFeature : public SerializationIface
categoryNumber = 0;
}

/**
* Copy constructor for a data feature
*/
NumericTableFeature(const NumericTableFeature & f)
{
indexType = f.indexType;
pmmlType = f.pmmlType;
featureType = f.featureType;
typeSize = f.typeSize;
categoryNumber = f.categoryNumber;
}

/**
* Copy operator for a data feature
*/
NumericTableFeature & operator=(const NumericTableFeature & f)
{
if (this == &f) return *this;

indexType = f.indexType;
pmmlType = f.pmmlType;
featureType = f.featureType;
Expand Down
7 changes: 7 additions & 0 deletions cpp/daal/src/algorithms/algorithm_base_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ algorithms::Argument::Argument(const algorithms::Argument & other)
: _storage(new internal::ArgumentStorage(*(internal::ArgumentStorage *)other._storage.get())), idx(0)
{}

algorithms::Argument & algorithms::Argument::operator=(const algorithms::Argument & other) {
if (this == &other) return *this;
_storage = data_management::DataCollectionPtr(new internal::ArgumentStorage(*(internal::ArgumentStorage *)other._storage.get()));
idx = 0;
return *this;
}

const data_management::SerializationIfacePtr & algorithms::Argument::get(size_t index) const
{
return (*_storage)[index];
Expand Down

0 comments on commit c16bffa

Please sign in to comment.