24 #ifndef __SVD_TYPES_H__
25 #define __SVD_TYPES_H__
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/numeric_table.h"
29 #include "data_management/data/homogen_numeric_table.h"
30 #include "services/daal_defines.h"
83 lastResultId = rightSingularMatrix
93 outputOfStep1ForStep3,
95 outputOfStep1ForStep2,
97 lastPartialResultId = outputOfStep1ForStep2
105 enum DistributedPartialResultCollectionId
107 outputOfStep2ForStep3,
108 lastDistributedPartialResultCollectionId = outputOfStep2ForStep3
116 enum DistributedPartialResultId
118 finalResultFromStep2Master = lastDistributedPartialResultCollectionId + 1,
119 lastDistributedPartialResultId = finalResultFromStep2Master
127 enum DistributedPartialResultStep3Id
129 finalResultFromStep3,
130 lastDistributedPartialResultStep3Id = finalResultFromStep3
139 inputOfStep2FromStep1,
140 lastMasterInputId = inputOfStep2FromStep1
147 enum FinalizeOnLocalInputId
149 inputOfStep3FromStep1,
150 inputOfStep3FromStep2,
151 lastFinalizeOnLocalInputId = inputOfStep3FromStep2
163 struct DAAL_EXPORT Parameter :
public daal::algorithms::Parameter
170 Parameter(SVDResultFormat _leftSingularMatrix = requiredInPackedForm,
171 SVDResultFormat _rightSingularMatrix = requiredInPackedForm) :
172 leftSingularMatrix(_leftSingularMatrix), rightSingularMatrix(_rightSingularMatrix) {}
174 SVDResultFormat leftSingularMatrix;
175 SVDResultFormat rightSingularMatrix;
183 class DAAL_EXPORT Input :
public daal::algorithms::Input
189 Input(
const Input& other);
198 data_management::NumericTablePtr
get(InputId id)
const;
205 void set(InputId
id,
const data_management::NumericTablePtr &value);
207 services::Status getNumberOfColumns(
size_t *nFeatures)
const;
209 services::Status getNumberOfRows(
size_t *nRows)
const;
217 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
225 class DAAL_EXPORT DistributedStep2Input :
public daal::algorithms::Input
229 DistributedStep2Input();
232 DistributedStep2Input(
const DistributedStep2Input& other);
239 void set(MasterInputId
id,
const data_management::KeyValueDataCollectionPtr &ptr);
246 data_management::KeyValueDataCollectionPtr
get(MasterInputId id)
const;
254 void add(MasterInputId
id,
size_t key,
const data_management::DataCollectionPtr &value);
268 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
275 services::Status getNumberOfColumns(
size_t& nCols)
const;
282 class DAAL_EXPORT DistributedStep3Input :
public daal::algorithms::Input
286 DistributedStep3Input();
289 DistributedStep3Input(
const DistributedStep3Input& other);
296 data_management::DataCollectionPtr
get(FinalizeOnLocalInputId id)
const;
303 void set(FinalizeOnLocalInputId
id,
const data_management::DataCollectionPtr &value);
305 services::Status getSizes(
size_t &nFeatures,
size_t &nVectors)
const;
313 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
322 class DAAL_EXPORT OnlinePartialResult :
public daal::algorithms::PartialResult
325 DECLARE_SERIALIZABLE_CAST(OnlinePartialResult);
327 OnlinePartialResult();
329 virtual ~OnlinePartialResult() {}
338 template <
typename algorithmFPType>
339 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
348 template <
typename algorithmFPType>
349 DAAL_EXPORT services::Status initialize(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
358 template <
typename algorithmFPType>
359 DAAL_EXPORT services::Status addPartialResultStorage(
size_t m,
size_t n, Parameter &par);
366 data_management::DataCollectionPtr
get(PartialResultId id)
const;
373 void set(PartialResultId
id,
const data_management::DataCollectionPtr &value);
381 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
383 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
385 size_t getNumberOfColumns()
const;
387 size_t getNumberOfRows()
const;
391 template<
typename Archive,
bool onDeserialize>
392 services::Status serialImpl(Archive *arch)
394 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
396 services::Status checkImpl(
const daal::algorithms::Parameter *parameter,
int method,
size_t nFeatures,
size_t nVectors)
const;
398 typedef services::SharedPtr<OnlinePartialResult> OnlinePartialResultPtr;
405 class DAAL_EXPORT Result :
public daal::algorithms::Result
408 DECLARE_SERIALIZABLE_CAST(Result);
419 data_management::NumericTablePtr
get(ResultId id)
const;
428 template <
typename algorithmFPType>
429 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
438 template <
typename algorithmFPType>
439 DAAL_EXPORT services::Status allocate(
const daal::algorithms::PartialResult *partialResult, daal::algorithms::Parameter *parameter,
const int method);
446 void set(ResultId
id,
const data_management::NumericTablePtr &value);
455 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
463 services::Status check(
const daal::algorithms::PartialResult *pres,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
472 template <
typename algorithmFPType>
473 DAAL_EXPORT services::Status allocateImpl(
size_t m,
size_t n);
477 template<
typename Archive,
bool onDeserialize>
478 services::Status serialImpl(Archive *arch)
480 return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
483 typedef services::SharedPtr<Result> ResultPtr;
490 class DAAL_EXPORT DistributedPartialResult :
public daal::algorithms::PartialResult
493 DECLARE_SERIALIZABLE_CAST(DistributedPartialResult);
495 DistributedPartialResult();
497 virtual ~DistributedPartialResult() {}
503 template <
typename algorithmFPType>
504 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
516 template <
typename algorithmFPType>
517 DAAL_EXPORT services::Status setPartialResultStorage(data_management::KeyValueDataCollection *inCollection,
size_t &nBlocks);
526 data_management::KeyValueDataCollectionPtr
get(DistributedPartialResultCollectionId id)
const;
534 data_management::DataCollectionPtr
get(DistributedPartialResultCollectionId id,
size_t idx)
const;
541 ResultPtr
get(DistributedPartialResultId id)
const;
548 void set(DistributedPartialResultCollectionId
id,
const data_management::KeyValueDataCollectionPtr &value);
555 void set(DistributedPartialResultId
id,
const ResultPtr &value);
563 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
572 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
576 template<
typename Archive,
bool onDeserialize>
577 services::Status serialImpl(Archive *arch)
579 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
582 typedef services::SharedPtr<DistributedPartialResult> DistributedPartialResultPtr;
589 class DAAL_EXPORT DistributedPartialResultStep3 :
public daal::algorithms::PartialResult
592 DECLARE_SERIALIZABLE_CAST(DistributedPartialResultStep3);
594 DistributedPartialResultStep3();
596 virtual ~DistributedPartialResultStep3() {}
605 template <
typename algorithmFPType>
606 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
613 template <
typename algorithmFPType>
614 DAAL_EXPORT services::Status setPartialResultStorage(data_management::DataCollection *qCollection);
621 ResultPtr
get(DistributedPartialResultStep3Id id)
const;
628 void set(DistributedPartialResultStep3Id
id,
const ResultPtr &value);
637 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
646 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
650 template<
typename Archive,
bool onDeserialize>
651 services::Status serialImpl(Archive *arch)
653 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
656 typedef services::SharedPtr<DistributedPartialResultStep3> DistributedPartialResultStep3Ptr;
659 using interface1::Parameter;
660 using interface1::Input;
661 using interface1::DistributedStep2Input;
662 using interface1::DistributedStep3Input;
663 using interface1::OnlinePartialResult;
664 using interface1::OnlinePartialResultPtr;
665 using interface1::Result;
666 using interface1::ResultPtr;
667 using interface1::DistributedPartialResult;
668 using interface1::DistributedPartialResultPtr;
669 using interface1::DistributedPartialResultStep3;
670 using interface1::DistributedPartialResultStep3Ptr;
daal::algorithms::svd::interface1::DistributedPartialResult::~DistributedPartialResult
virtual ~DistributedPartialResult()
Definition: svd_types.h:497
daal::algorithms::svd::defaultDense
Definition: svd_types.h:51
daal::algorithms::svd::outputOfStep2ForStep3
Definition: svd_types.h:107
daal::algorithms::svd::rightSingularMatrix
Definition: svd_types.h:82
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:405
daal::algorithms::svd::notRequired
Definition: svd_types.h:60
daal::algorithms::svd::inputOfStep3FromStep1
Definition: svd_types.h:149
daal::algorithms::svd::Method
Method
Definition: svd_types.h:49
daal::algorithms::svd::finalResultFromStep3
Definition: svd_types.h:129
daal::algorithms::svd::interface1::Parameter::leftSingularMatrix
SVDResultFormat leftSingularMatrix
Definition: svd_types.h:174
daal::algorithms::svd::interface1::OnlinePartialResult::~OnlinePartialResult
virtual ~OnlinePartialResult()
Definition: svd_types.h:329
daal::algorithms::svd::outputOfStep1ForStep3
Definition: svd_types.h:93
daal::algorithms::svd::finalResultFromStep2Master
Definition: svd_types.h:118
daal::algorithms::svd::outputOfStep1ForStep2
Definition: svd_types.h:95
daal::algorithms::svd::requiredInPackedForm
Definition: svd_types.h:61
daal::algorithms::svd::inputOfStep2FromStep1
Definition: svd_types.h:139
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:127
daal::algorithms::svd::interface1::Input
Input objects for the SVD algorithm in the batch processing and online processing modes...
Definition: svd_types.h:183
daal::algorithms::svd::MasterInputId
MasterInputId
Partial results from previous steps in the distributed processing mode, required by the second step...
Definition: svd_types.h:137
daal::algorithms::svd::interface1::Parameter
Parameters for the computation method of the SVD algorithm.
Definition: svd_types.h:163
daal::algorithms::svd::interface1::Parameter::rightSingularMatrix
SVDResultFormat rightSingularMatrix
Definition: svd_types.h:175
daal::algorithms::svd::interface1::Input::~Input
virtual ~Input()
Definition: svd_types.h:191
daal::algorithms::svd::FinalizeOnLocalInputId
FinalizeOnLocalInputId
Partial results from previous steps in the distributed processing mode, required by the third step...
Definition: svd_types.h:147
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:490
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:91
daal::algorithms::svd::interface1::Parameter::Parameter
Parameter(SVDResultFormat _leftSingularMatrix=requiredInPackedForm, SVDResultFormat _rightSingularMatrix=requiredInPackedForm)
Definition: svd_types.h:170
daal::algorithms::svd::interface1::Result::~Result
virtual ~Result()
Definition: svd_types.h:412
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:116
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:105
daal::algorithms::svd::leftSingularMatrix
Definition: svd_types.h:81
daal::algorithms::svd::interface1::DistributedPartialResultStep3::~DistributedPartialResultStep3
virtual ~DistributedPartialResultStep3()
Definition: svd_types.h:596
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:322
daal::algorithms::svd::ResultId
ResultId
Available types of results of the SVD algorithm.
Definition: svd_types.h:78
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:589
daal::algorithms::svd::inputOfStep3FromStep2
Definition: svd_types.h:150
daal::algorithms::svd::SVDResultFormat
SVDResultFormat
Definition: svd_types.h:58
daal::algorithms::svd::data
Definition: svd_types.h:70
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::svd::InputId
InputId
Available types of input objects for the SVD algorithm.
Definition: svd_types.h:68
daal::algorithms::svd::interface1::DistributedStep2Input
Input objects for the second step of the SVD algorithm in the distributed processing mode ...
Definition: svd_types.h:225
daal::algorithms::svd::singularValues
Definition: svd_types.h:80
daal::algorithms::svd::interface1::DistributedStep3Input
Input objects for the third step of the SVD algorithm in the distributed processing mode ...
Definition: svd_types.h:282