22 #ifndef __SVD_TYPES_H__
23 #define __SVD_TYPES_H__
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "data_management/data/homogen_numeric_table.h"
28 #include "services/daal_defines.h"
81 lastResultId = rightSingularMatrix
91 outputOfStep1ForStep3,
93 outputOfStep1ForStep2,
95 lastPartialResultId = outputOfStep1ForStep2
103 enum DistributedPartialResultCollectionId
105 outputOfStep2ForStep3,
106 lastDistributedPartialResultCollectionId = outputOfStep2ForStep3
114 enum DistributedPartialResultId
116 finalResultFromStep2Master = lastDistributedPartialResultCollectionId + 1,
117 lastDistributedPartialResultId = finalResultFromStep2Master
125 enum DistributedPartialResultStep3Id
127 finalResultFromStep3,
128 lastDistributedPartialResultStep3Id = finalResultFromStep3
137 inputOfStep2FromStep1,
138 lastMasterInputId = inputOfStep2FromStep1
145 enum FinalizeOnLocalInputId
147 inputOfStep3FromStep1,
148 inputOfStep3FromStep2,
149 lastFinalizeOnLocalInputId = inputOfStep3FromStep2
161 struct DAAL_EXPORT Parameter :
public daal::algorithms::Parameter
168 Parameter(SVDResultFormat _leftSingularMatrix = requiredInPackedForm,
169 SVDResultFormat _rightSingularMatrix = requiredInPackedForm) :
170 leftSingularMatrix(_leftSingularMatrix), rightSingularMatrix(_rightSingularMatrix) {}
172 SVDResultFormat leftSingularMatrix;
173 SVDResultFormat rightSingularMatrix;
181 class DAAL_EXPORT Input :
public daal::algorithms::Input
187 Input(
const Input& other);
196 data_management::NumericTablePtr
get(InputId id)
const;
203 void set(InputId
id,
const data_management::NumericTablePtr &value);
205 services::Status getNumberOfColumns(
size_t *nFeatures)
const;
207 services::Status getNumberOfRows(
size_t *nRows)
const;
215 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
223 class DAAL_EXPORT DistributedStep2Input :
public daal::algorithms::Input
227 DistributedStep2Input();
230 DistributedStep2Input(
const DistributedStep2Input& other);
237 void set(MasterInputId
id,
const data_management::KeyValueDataCollectionPtr &ptr);
244 data_management::KeyValueDataCollectionPtr
get(MasterInputId id)
const;
252 void add(MasterInputId
id,
size_t key,
const data_management::DataCollectionPtr &value);
262 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
269 services::Status getNumberOfColumns(
size_t& nCols)
const;
276 class DAAL_EXPORT DistributedStep3Input :
public daal::algorithms::Input
280 DistributedStep3Input();
283 DistributedStep3Input(
const DistributedStep3Input& other);
290 data_management::DataCollectionPtr
get(FinalizeOnLocalInputId id)
const;
297 void set(FinalizeOnLocalInputId
id,
const data_management::DataCollectionPtr &value);
299 services::Status getSizes(
size_t &nFeatures,
size_t &nVectors)
const;
307 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
316 class DAAL_EXPORT OnlinePartialResult :
public daal::algorithms::PartialResult
319 DECLARE_SERIALIZABLE_CAST(OnlinePartialResult);
321 OnlinePartialResult();
323 virtual ~OnlinePartialResult() {}
332 template <
typename algorithmFPType>
333 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
342 template <
typename algorithmFPType>
343 DAAL_EXPORT services::Status initialize(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
352 template <
typename algorithmFPType>
353 DAAL_EXPORT services::Status addPartialResultStorage(
size_t m,
size_t n, Parameter &par);
360 data_management::DataCollectionPtr
get(PartialResultId id)
const;
367 void set(PartialResultId
id,
const data_management::DataCollectionPtr &value);
375 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
377 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
379 size_t getNumberOfColumns()
const;
381 size_t getNumberOfRows()
const;
385 template<
typename Archive,
bool onDeserialize>
386 services::Status serialImpl(Archive *arch)
388 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
390 services::Status checkImpl(
const daal::algorithms::Parameter *parameter,
int method,
size_t nFeatures,
size_t nVectors)
const;
392 typedef services::SharedPtr<OnlinePartialResult> OnlinePartialResultPtr;
399 class DAAL_EXPORT Result :
public daal::algorithms::Result
402 DECLARE_SERIALIZABLE_CAST(Result);
413 data_management::NumericTablePtr
get(ResultId id)
const;
422 template <
typename algorithmFPType>
423 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
432 template <
typename algorithmFPType>
433 DAAL_EXPORT services::Status allocate(
const daal::algorithms::PartialResult *partialResult, daal::algorithms::Parameter *parameter,
const int method);
440 void set(ResultId
id,
const data_management::NumericTablePtr &value);
449 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
457 services::Status check(
const daal::algorithms::PartialResult *pres,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
466 template <
typename algorithmFPType>
467 DAAL_EXPORT services::Status allocateImpl(
size_t m,
size_t n);
471 template<
typename Archive,
bool onDeserialize>
472 services::Status serialImpl(Archive *arch)
474 return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
477 typedef services::SharedPtr<Result> ResultPtr;
484 class DAAL_EXPORT DistributedPartialResult :
public daal::algorithms::PartialResult
487 DECLARE_SERIALIZABLE_CAST(DistributedPartialResult);
489 DistributedPartialResult();
491 virtual ~DistributedPartialResult() {}
497 template <
typename algorithmFPType>
498 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
510 template <
typename algorithmFPType>
511 DAAL_EXPORT services::Status setPartialResultStorage(data_management::KeyValueDataCollection *inCollection,
size_t &nBlocks);
520 data_management::KeyValueDataCollectionPtr
get(DistributedPartialResultCollectionId id)
const;
528 data_management::DataCollectionPtr
get(DistributedPartialResultCollectionId id,
size_t idx)
const;
535 ResultPtr
get(DistributedPartialResultId id)
const;
542 void set(DistributedPartialResultCollectionId
id,
const data_management::KeyValueDataCollectionPtr &value);
549 void set(DistributedPartialResultId
id,
const ResultPtr &value);
557 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
566 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
570 template<
typename Archive,
bool onDeserialize>
571 services::Status serialImpl(Archive *arch)
573 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
576 typedef services::SharedPtr<DistributedPartialResult> DistributedPartialResultPtr;
583 class DAAL_EXPORT DistributedPartialResultStep3 :
public daal::algorithms::PartialResult
586 DECLARE_SERIALIZABLE_CAST(DistributedPartialResultStep3);
588 DistributedPartialResultStep3();
590 virtual ~DistributedPartialResultStep3() {}
599 template <
typename algorithmFPType>
600 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
607 template <
typename algorithmFPType>
608 DAAL_EXPORT services::Status setPartialResultStorage(data_management::DataCollection *qCollection);
615 ResultPtr
get(DistributedPartialResultStep3Id id)
const;
622 void set(DistributedPartialResultStep3Id
id,
const ResultPtr &value);
631 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
640 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
644 template<
typename Archive,
bool onDeserialize>
645 services::Status serialImpl(Archive *arch)
647 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
650 typedef services::SharedPtr<DistributedPartialResultStep3> DistributedPartialResultStep3Ptr;
653 using interface1::Parameter;
654 using interface1::Input;
655 using interface1::DistributedStep2Input;
656 using interface1::DistributedStep3Input;
657 using interface1::OnlinePartialResult;
658 using interface1::OnlinePartialResultPtr;
659 using interface1::Result;
660 using interface1::ResultPtr;
661 using interface1::DistributedPartialResult;
662 using interface1::DistributedPartialResultPtr;
663 using interface1::DistributedPartialResultStep3;
664 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:114
daal::algorithms::svd::leftSingularMatrix
Definition: svd_types.h:79
daal::algorithms::svd::interface1::Parameter
Parameters for the computation method of the SVD algorithm.
Definition: svd_types.h:161
daal
Definition: algorithm_base_common.h:31
daal::algorithms::svd::interface1::OnlinePartialResult::~OnlinePartialResult
virtual ~OnlinePartialResult()
Definition: svd_types.h:323
daal::algorithms::svd::SVDResultFormat
SVDResultFormat
Definition: svd_types.h:56
daal::algorithms::svd::inputOfStep3FromStep2
Definition: svd_types.h:148
daal::algorithms::svd::Method
Method
Definition: svd_types.h:47
daal::algorithms::svd::singularValues
Definition: svd_types.h:78
daal::algorithms::svd::inputOfStep2FromStep1
Definition: svd_types.h:137
daal::algorithms::svd::inputOfStep3FromStep1
Definition: svd_types.h:147
daal::algorithms::svd::interface1::Parameter::rightSingularMatrix
SVDResultFormat rightSingularMatrix
Definition: svd_types.h:173
daal::algorithms::svd::data
Definition: svd_types.h:68
daal::algorithms::svd::InputId
InputId
Available types of input objects for the SVD algorithm.
Definition: svd_types.h:66
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:399
daal::algorithms::svd::FinalizeOnLocalInputId
FinalizeOnLocalInputId
Partial results from previous steps in the distributed processing mode, required by the third step...
Definition: svd_types.h:145
daal::algorithms::svd::interface1::Parameter::leftSingularMatrix
SVDResultFormat leftSingularMatrix
Definition: svd_types.h:172
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:583
daal::algorithms::svd::ResultId
ResultId
Available types of results of the SVD algorithm.
Definition: svd_types.h:76
daal::algorithms::svd::interface1::DistributedPartialResult::~DistributedPartialResult
virtual ~DistributedPartialResult()
Definition: svd_types.h:491
daal::algorithms::svd::interface1::Parameter::Parameter
Parameter(SVDResultFormat _leftSingularMatrix=requiredInPackedForm, SVDResultFormat _rightSingularMatrix=requiredInPackedForm)
Definition: svd_types.h:168
daal::algorithms::svd::requiredInPackedForm
Definition: svd_types.h:59
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:103
daal::algorithms::svd::outputOfStep2ForStep3
Definition: svd_types.h:105
daal::algorithms::svd::finalResultFromStep2Master
Definition: svd_types.h:116
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:89
daal::algorithms::svd::interface1::Result::~Result
virtual ~Result()
Definition: svd_types.h:406
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:125
daal::algorithms::svd::rightSingularMatrix
Definition: svd_types.h:80
daal::algorithms::math::abs::value
Definition: abs_types.h:86
daal::algorithms::svd::finalResultFromStep3
Definition: svd_types.h:127
daal::algorithms::svd::interface1::DistributedPartialResultStep3::~DistributedPartialResultStep3
virtual ~DistributedPartialResultStep3()
Definition: svd_types.h:590
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:316
daal::algorithms::svd::MasterInputId
MasterInputId
Partial results from previous steps in the distributed processing mode, required by the second step...
Definition: svd_types.h:135
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:484
daal::algorithms::svd::outputOfStep1ForStep2
Definition: svd_types.h:93
daal::algorithms::svd::outputOfStep1ForStep3
Definition: svd_types.h:91
daal::algorithms::svd::defaultDense
Definition: svd_types.h:49
daal::algorithms::svd::notRequired
Definition: svd_types.h:58