48 #ifndef __SVD_TYPES_H__
49 #define __SVD_TYPES_H__
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/numeric_table.h"
53 #include "data_management/data/homogen_numeric_table.h"
54 #include "services/daal_defines.h"
107 lastResultId = rightSingularMatrix
117 outputOfStep1ForStep3,
119 outputOfStep1ForStep2,
121 lastPartialResultId = outputOfStep1ForStep2
129 enum DistributedPartialResultCollectionId
131 outputOfStep2ForStep3,
132 lastDistributedPartialResultCollectionId = outputOfStep2ForStep3
140 enum DistributedPartialResultId
142 finalResultFromStep2Master = lastDistributedPartialResultCollectionId + 1,
143 lastDistributedPartialResultId = finalResultFromStep2Master
151 enum DistributedPartialResultStep3Id
153 finalResultFromStep3,
154 lastDistributedPartialResultStep3Id = finalResultFromStep3
163 inputOfStep2FromStep1,
164 lastMasterInputId = inputOfStep2FromStep1
171 enum FinalizeOnLocalInputId
173 inputOfStep3FromStep1,
174 inputOfStep3FromStep2,
175 lastFinalizeOnLocalInputId = inputOfStep3FromStep2
187 struct DAAL_EXPORT Parameter :
public daal::algorithms::Parameter
194 Parameter(SVDResultFormat _leftSingularMatrix = requiredInPackedForm,
195 SVDResultFormat _rightSingularMatrix = requiredInPackedForm) :
196 leftSingularMatrix(_leftSingularMatrix), rightSingularMatrix(_rightSingularMatrix) {}
198 SVDResultFormat leftSingularMatrix;
199 SVDResultFormat rightSingularMatrix;
207 class DAAL_EXPORT Input :
public daal::algorithms::Input
213 Input(
const Input& other);
222 data_management::NumericTablePtr
get(InputId id)
const;
229 void set(InputId
id,
const data_management::NumericTablePtr &value);
231 services::Status getNumberOfColumns(
size_t *nFeatures)
const;
233 services::Status getNumberOfRows(
size_t *nRows)
const;
241 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
249 class DAAL_EXPORT DistributedStep2Input :
public daal::algorithms::Input
253 DistributedStep2Input();
256 DistributedStep2Input(
const DistributedStep2Input& other);
263 void set(MasterInputId
id,
const data_management::KeyValueDataCollectionPtr &ptr);
270 data_management::KeyValueDataCollectionPtr
get(MasterInputId id)
const;
278 void add(MasterInputId
id,
size_t key,
const data_management::DataCollectionPtr &value);
288 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
295 services::Status getNumberOfColumns(
size_t& nCols)
const;
302 class DAAL_EXPORT DistributedStep3Input :
public daal::algorithms::Input
306 DistributedStep3Input();
309 DistributedStep3Input(
const DistributedStep3Input& other);
316 data_management::DataCollectionPtr
get(FinalizeOnLocalInputId id)
const;
323 void set(FinalizeOnLocalInputId
id,
const data_management::DataCollectionPtr &value);
325 services::Status getSizes(
size_t &nFeatures,
size_t &nVectors)
const;
333 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
342 class DAAL_EXPORT OnlinePartialResult :
public daal::algorithms::PartialResult
345 DECLARE_SERIALIZABLE_CAST(OnlinePartialResult);
347 OnlinePartialResult();
349 virtual ~OnlinePartialResult() {}
358 template <
typename algorithmFPType>
359 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
368 template <
typename algorithmFPType>
369 DAAL_EXPORT services::Status initialize(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
378 template <
typename algorithmFPType>
379 DAAL_EXPORT services::Status addPartialResultStorage(
size_t m,
size_t n, Parameter &par);
386 data_management::DataCollectionPtr
get(PartialResultId id)
const;
393 void set(PartialResultId
id,
const data_management::DataCollectionPtr &value);
401 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
403 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
405 size_t getNumberOfColumns()
const;
407 size_t getNumberOfRows()
const;
411 template<
typename Archive,
bool onDeserialize>
412 services::Status serialImpl(Archive *arch)
414 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
416 services::Status checkImpl(
const daal::algorithms::Parameter *parameter,
int method,
size_t nFeatures,
size_t nVectors)
const;
418 typedef services::SharedPtr<OnlinePartialResult> OnlinePartialResultPtr;
425 class DAAL_EXPORT Result :
public daal::algorithms::Result
428 DECLARE_SERIALIZABLE_CAST(Result);
439 data_management::NumericTablePtr
get(ResultId id)
const;
448 template <
typename algorithmFPType>
449 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
458 template <
typename algorithmFPType>
459 DAAL_EXPORT services::Status allocate(
const daal::algorithms::PartialResult *partialResult, daal::algorithms::Parameter *parameter,
const int method);
466 void set(ResultId
id,
const data_management::NumericTablePtr &value);
475 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
483 services::Status check(
const daal::algorithms::PartialResult *pres,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
492 template <
typename algorithmFPType>
493 DAAL_EXPORT services::Status allocateImpl(
size_t m,
size_t n);
497 template<
typename Archive,
bool onDeserialize>
498 services::Status serialImpl(Archive *arch)
500 return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
503 typedef services::SharedPtr<Result> ResultPtr;
510 class DAAL_EXPORT DistributedPartialResult :
public daal::algorithms::PartialResult
513 DECLARE_SERIALIZABLE_CAST(DistributedPartialResult);
515 DistributedPartialResult();
517 virtual ~DistributedPartialResult() {}
523 template <
typename algorithmFPType>
524 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
536 template <
typename algorithmFPType>
537 DAAL_EXPORT services::Status setPartialResultStorage(data_management::KeyValueDataCollection *inCollection,
size_t &nBlocks);
546 data_management::KeyValueDataCollectionPtr
get(DistributedPartialResultCollectionId id)
const;
554 data_management::DataCollectionPtr
get(DistributedPartialResultCollectionId id,
size_t idx)
const;
561 ResultPtr
get(DistributedPartialResultId id)
const;
568 void set(DistributedPartialResultCollectionId
id,
const data_management::KeyValueDataCollectionPtr &value);
575 void set(DistributedPartialResultId
id,
const ResultPtr &value);
583 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
592 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
596 template<
typename Archive,
bool onDeserialize>
597 services::Status serialImpl(Archive *arch)
599 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
602 typedef services::SharedPtr<DistributedPartialResult> DistributedPartialResultPtr;
609 class DAAL_EXPORT DistributedPartialResultStep3 :
public daal::algorithms::PartialResult
612 DECLARE_SERIALIZABLE_CAST(DistributedPartialResultStep3);
614 DistributedPartialResultStep3();
616 virtual ~DistributedPartialResultStep3() {}
625 template <
typename algorithmFPType>
626 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
633 template <
typename algorithmFPType>
634 DAAL_EXPORT services::Status setPartialResultStorage(data_management::DataCollection *qCollection);
641 ResultPtr
get(DistributedPartialResultStep3Id id)
const;
648 void set(DistributedPartialResultStep3Id
id,
const ResultPtr &value);
657 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
666 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
670 template<
typename Archive,
bool onDeserialize>
671 services::Status serialImpl(Archive *arch)
673 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
676 typedef services::SharedPtr<DistributedPartialResultStep3> DistributedPartialResultStep3Ptr;
679 using interface1::Parameter;
680 using interface1::Input;
681 using interface1::DistributedStep2Input;
682 using interface1::DistributedStep3Input;
683 using interface1::OnlinePartialResult;
684 using interface1::OnlinePartialResultPtr;
685 using interface1::Result;
686 using interface1::ResultPtr;
687 using interface1::DistributedPartialResult;
688 using interface1::DistributedPartialResultPtr;
689 using interface1::DistributedPartialResultStep3;
690 using interface1::DistributedPartialResultStep3Ptr;
daal::algorithms::svd::DistributedPartialResultId
DistributedPartialResultId
Available types of partial results obtained in the second step of the SVD algorithm in the distribute...
Definition: svd_types.h:140
daal::algorithms::svd::leftSingularMatrix
Definition: svd_types.h:105
daal::algorithms::svd::interface1::Parameter
Parameters for the computation method of the SVD algorithm.
Definition: svd_types.h:187
daal
Definition: algorithm_base_common.h:57
daal::algorithms::svd::interface1::OnlinePartialResult::~OnlinePartialResult
virtual ~OnlinePartialResult()
Definition: svd_types.h:349
daal::algorithms::svd::SVDResultFormat
SVDResultFormat
Definition: svd_types.h:82
daal::algorithms::svd::inputOfStep3FromStep2
Definition: svd_types.h:174
daal::algorithms::svd::Method
Method
Definition: svd_types.h:73
daal::algorithms::svd::singularValues
Definition: svd_types.h:104
daal::algorithms::svd::inputOfStep2FromStep1
Definition: svd_types.h:163
daal::algorithms::svd::inputOfStep3FromStep1
Definition: svd_types.h:173
daal::algorithms::svd::interface1::Parameter::rightSingularMatrix
SVDResultFormat rightSingularMatrix
Definition: svd_types.h:199
daal::algorithms::svd::data
Definition: svd_types.h:94
daal::algorithms::svd::InputId
InputId
Available types of input objects for the SVD algorithm.
Definition: svd_types.h:92
daal::algorithms::svd::interface1::Result
Provides methods to access final results obtained with the compute() method of the SVD algorithm in t...
Definition: svd_types.h:425
daal::algorithms::svd::FinalizeOnLocalInputId
FinalizeOnLocalInputId
Partial results from previous steps in the distributed processing mode, required by the third step...
Definition: svd_types.h:171
daal::algorithms::svd::interface1::Parameter::leftSingularMatrix
SVDResultFormat leftSingularMatrix
Definition: svd_types.h:198
daal::algorithms::svd::interface1::DistributedPartialResultStep3
Provides methods to access partial results obtained with the compute() method of the SVD algorithm in...
Definition: svd_types.h:609
daal::algorithms::svd::ResultId
ResultId
Available types of results of the SVD algorithm.
Definition: svd_types.h:102
daal::algorithms::svd::interface1::DistributedPartialResult::~DistributedPartialResult
virtual ~DistributedPartialResult()
Definition: svd_types.h:517
daal::algorithms::svd::interface1::Parameter::Parameter
Parameter(SVDResultFormat _leftSingularMatrix=requiredInPackedForm, SVDResultFormat _rightSingularMatrix=requiredInPackedForm)
Definition: svd_types.h:194
daal::algorithms::svd::requiredInPackedForm
Definition: svd_types.h:85
daal::algorithms::svd::DistributedPartialResultCollectionId
DistributedPartialResultCollectionId
Available types of partial results obtained in the second step of the SVD algorithm in the distribute...
Definition: svd_types.h:129
daal::algorithms::svd::outputOfStep2ForStep3
Definition: svd_types.h:131
daal::algorithms::svd::finalResultFromStep2Master
Definition: svd_types.h:142
daal::algorithms::svd::PartialResultId
PartialResultId
Available types of partial results of the SVD algorithm obtained in the online processing mode and in...
Definition: svd_types.h:115
daal::algorithms::svd::interface1::Result::~Result
virtual ~Result()
Definition: svd_types.h:432
daal::algorithms::svd::DistributedPartialResultStep3Id
DistributedPartialResultStep3Id
Available types of partial results obtained in the third step of the SVD algorithm in the distributed...
Definition: svd_types.h:151
daal::algorithms::svd::rightSingularMatrix
Definition: svd_types.h:106
daal::algorithms::math::abs::value
Definition: abs_types.h:112
daal::algorithms::svd::finalResultFromStep3
Definition: svd_types.h:153
daal::algorithms::svd::interface1::DistributedPartialResultStep3::~DistributedPartialResultStep3
virtual ~DistributedPartialResultStep3()
Definition: svd_types.h:616
daal::algorithms::svd::interface1::OnlinePartialResult
Provides methods to access partial results obtained with the compute() method of the SVD algorithm in...
Definition: svd_types.h:342
daal::algorithms::svd::MasterInputId
MasterInputId
Partial results from previous steps in the distributed processing mode, required by the second step...
Definition: svd_types.h:161
daal::algorithms::svd::interface1::DistributedPartialResult
Provides methods to access partial results obtained with the compute() method of the SVD algorithm in...
Definition: svd_types.h:510
daal::algorithms::svd::outputOfStep1ForStep2
Definition: svd_types.h:119
daal::algorithms::svd::outputOfStep1ForStep3
Definition: svd_types.h:117
daal::algorithms::svd::defaultDense
Definition: svd_types.h:75
daal::algorithms::svd::notRequired
Definition: svd_types.h:84