23 #ifndef __QR_TYPES_H__
24 #define __QR_TYPES_H__
26 #include "algorithms/algorithm.h"
27 #include "data_management/data/numeric_table.h"
28 #include "data_management/data/homogen_numeric_table.h"
29 #include "services/daal_defines.h"
77 lastResultId = matrixR
87 outputOfStep1ForStep3,
89 outputOfStep1ForStep2,
91 lastPartialResultId = outputOfStep1ForStep2
99 enum DistributedPartialResultCollectionId
101 outputOfStep2ForStep3,
103 lastDistributedPartialResultCollectionId = outputOfStep2ForStep3
110 enum DistributedPartialResultId
112 finalResultFromStep2Master = lastDistributedPartialResultCollectionId + 1,
113 lastDistributedPartialResultId = finalResultFromStep2Master
120 enum DistributedPartialResultStep3Id
122 finalResultFromStep3,
123 lastDistributedPartialResultStep3Id = finalResultFromStep3
132 inputOfStep2FromStep1,
134 lastMasterInputId = inputOfStep2FromStep1
141 enum FinalizeOnLocalInputId
143 inputOfStep3FromStep1,
145 inputOfStep3FromStep2,
147 lastFinalizeOnLocalInputId = inputOfStep3FromStep2
160 class DAAL_EXPORT Input :
public daal::algorithms::Input
167 Input(
const Input& other);
177 data_management::NumericTablePtr
get(InputId id)
const;
184 void set(InputId
id,
const data_management::NumericTablePtr &value);
186 services::Status getNumberOfColumns(
size_t *nFeatures)
const;
188 services::Status getNumberOfRows(
size_t *nRows)
const;
195 virtual services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
202 class DAAL_EXPORT DistributedStep2Input :
public daal::algorithms::Input
206 DistributedStep2Input();
209 DistributedStep2Input(
const DistributedStep2Input& other);
215 services::Status getNumberOfColumns(
size_t *nFeatures)
const;
222 void set(MasterInputId
id,
const data_management::KeyValueDataCollectionPtr &ptr);
229 data_management::KeyValueDataCollectionPtr
get(MasterInputId id)
const;
237 void add(MasterInputId
id,
size_t key,
const data_management::DataCollectionPtr &value);
250 virtual services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
257 class DAAL_EXPORT DistributedStep3Input :
public daal::algorithms::Input
261 DistributedStep3Input();
264 DistributedStep3Input(
const DistributedStep3Input& other);
271 data_management::DataCollectionPtr
get(FinalizeOnLocalInputId id)
const;
278 void set(FinalizeOnLocalInputId
id,
const data_management::DataCollectionPtr &value);
280 services::Status getSizes(
size_t &nFeatures,
size_t &nVectors)
const;
287 virtual services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
295 class DAAL_EXPORT OnlinePartialResult :
public daal::algorithms::PartialResult
298 DECLARE_SERIALIZABLE_CAST(OnlinePartialResult);
300 OnlinePartialResult();
302 virtual ~OnlinePartialResult() {}
310 template <
typename algorithmFPType>
311 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
320 template <
typename algorithmFPType>
321 DAAL_EXPORT services::Status initialize(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
329 template <
typename algorithmFPType>
330 DAAL_EXPORT services::Status addPartialResultStorage(
size_t m,
size_t n);
337 data_management::DataCollectionPtr
get(PartialResultId id)
const;
344 void set(PartialResultId
id,
const data_management::DataCollectionPtr &value);
352 virtual services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
359 virtual services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
366 size_t getNumberOfColumns()
const;
372 size_t getNumberOfRows()
const;
376 template<
typename Archive,
bool onDeserialize>
377 services::Status serialImpl(Archive *arch)
379 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
382 services::Status checkImpl(
const daal::algorithms::Parameter *parameter,
int method,
size_t nFeatures,
size_t nVectors)
const;
384 typedef services::SharedPtr<OnlinePartialResult> OnlinePartialResultPtr;
392 class DAAL_EXPORT Result :
public daal::algorithms::Result
395 DECLARE_SERIALIZABLE_CAST(Result);
406 data_management::NumericTablePtr
get(ResultId id)
const;
414 template <
typename algorithmFPType>
415 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
423 template <
typename algorithmFPType>
424 DAAL_EXPORT services::Status allocate(
const daal::algorithms::PartialResult *partialResult, daal::algorithms::Parameter *parameter,
const int method);
431 void set(ResultId
id,
const data_management::NumericTablePtr &value);
439 virtual services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
447 virtual services::Status check(
const daal::algorithms::PartialResult *pres,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
455 template <
typename algorithmFPType>
456 DAAL_EXPORT services::Status allocateImpl(
size_t m,
size_t n);
460 template<
typename Archive,
bool onDeserialize>
461 services::Status serialImpl(Archive *arch)
463 return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
466 typedef services::SharedPtr<Result> ResultPtr;
473 class DAAL_EXPORT DistributedPartialResult :
public daal::algorithms::PartialResult
476 DECLARE_SERIALIZABLE_CAST(DistributedPartialResult);
478 DistributedPartialResult();
480 virtual ~DistributedPartialResult() {}
488 template <
typename algorithmFPType>
489 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
501 template <
typename algorithmFPType>
502 DAAL_EXPORT services::Status setPartialResultStorage(data_management::KeyValueDataCollection *inCollection,
size_t &nBlocks);
511 data_management::KeyValueDataCollectionPtr
get(DistributedPartialResultCollectionId id)
const;
518 ResultPtr
get(DistributedPartialResultId id)
const;
525 void set(DistributedPartialResultCollectionId
id,
const data_management::KeyValueDataCollectionPtr &value);
532 void set(DistributedPartialResultId
id,
const ResultPtr &value);
540 virtual services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
548 virtual services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
552 template<
typename Archive,
bool onDeserialize>
553 services::Status serialImpl(Archive *arch)
555 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
558 typedef services::SharedPtr<DistributedPartialResult>DistributedPartialResultPtr;
565 class DAAL_EXPORT DistributedPartialResultStep3 :
public daal::algorithms::PartialResult
568 DECLARE_SERIALIZABLE_CAST(DistributedPartialResultStep3);
570 DistributedPartialResultStep3();
572 virtual ~DistributedPartialResultStep3() {}
580 template <
typename algorithmFPType>
581 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
589 template <
typename algorithmFPType>
590 DAAL_EXPORT services::Status setPartialResultStorage(data_management::DataCollection *qCollection);
597 ResultPtr
get(DistributedPartialResultStep3Id id)
const;
604 void set(DistributedPartialResultStep3Id
id,
const ResultPtr &value);
612 virtual services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
620 virtual services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
624 template<
typename Archive,
bool onDeserialize>
625 services::Status serialImpl(Archive *arch)
627 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
630 typedef services::SharedPtr<DistributedPartialResultStep3> DistributedPartialResultStep3Ptr;
636 struct DAAL_EXPORT Parameter :
public daal::algorithms::Parameter
646 using interface1::Input;
647 using interface1::DistributedStep2Input;
648 using interface1::DistributedStep3Input;
649 using interface1::OnlinePartialResult;
650 using interface1::OnlinePartialResultPtr;
651 using interface1::Result;
652 using interface1::ResultPtr;
653 using interface1::DistributedPartialResult;
654 using interface1::DistributedPartialResultPtr;
655 using interface1::DistributedPartialResultStep3;
656 using interface1::DistributedPartialResultStep3Ptr;
657 using interface1::Parameter;
daal::algorithms::qr::DistributedPartialResultCollectionId
DistributedPartialResultCollectionId
Definition: qr_types.h:99
daal::algorithms::qr::interface1::OnlinePartialResult
Provides methods to access partial results obtained with the compute() method of the QR decomposition...
Definition: qr_types.h:295
daal
Definition: algorithm_base_common.h:31
daal::algorithms::qr::outputOfStep1ForStep2
Definition: qr_types.h:89
daal::algorithms::interface1::Result
Base class to represent final results of the computation. Algorithm-specific final results are repres...
Definition: algorithm_types.h:307
daal::algorithms::qr::interface1::Parameter
Parameters for the QR decomposition compute method.
Definition: qr_types.h:636
daal::algorithms::qr::interface1::Result
Provides methods to access final results obtained with the compute() method of the QR decomposition a...
Definition: qr_types.h:392
daal::algorithms::qr::interface1::DistributedPartialResultStep3::~DistributedPartialResultStep3
virtual ~DistributedPartialResultStep3()
Definition: qr_types.h:572
daal::algorithms::qr::finalResultFromStep2Master
Definition: qr_types.h:112
daal::algorithms::qr::matrixR
Definition: qr_types.h:76
daal::algorithms::qr::FinalizeOnLocalInputId
FinalizeOnLocalInputId
Definition: qr_types.h:141
daal::algorithms::qr::defaultDense
Definition: qr_types.h:56
daal::algorithms::qr::inputOfStep3FromStep1
Definition: qr_types.h:143
daal::algorithms::qr::outputOfStep2ForStep3
Definition: qr_types.h:101
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:60
daal::algorithms::qr::InputId
InputId
Definition: qr_types.h:63
daal::algorithms::qr::interface1::Parameter::Parameter
Parameter()
Definition: qr_types.h:641
daal::algorithms::qr::interface1::DistributedPartialResult
Provides methods to access partial results obtained with the compute() method of the second step of t...
Definition: qr_types.h:473
daal::algorithms::qr::data
Definition: qr_types.h:65
daal::algorithms::qr::interface1::OnlinePartialResult::~OnlinePartialResult
virtual ~OnlinePartialResult()
Definition: qr_types.h:302
daal::algorithms::qr::Method
Method
Definition: qr_types.h:54
daal::algorithms::qr::PartialResultId
PartialResultId
Definition: qr_types.h:85
daal::algorithms::qr::DistributedPartialResultStep3Id
DistributedPartialResultStep3Id
Definition: qr_types.h:120
daal::algorithms::math::abs::value
Definition: abs_types.h:86
daal::algorithms::qr::inputOfStep3FromStep2
Definition: qr_types.h:145
daal::algorithms::qr::matrixQ
Definition: qr_types.h:75
daal::algorithms::qr::finalResultFromStep3
Definition: qr_types.h:122
daal::algorithms::qr::interface1::DistributedPartialResult::~DistributedPartialResult
virtual ~DistributedPartialResult()
Definition: qr_types.h:480
daal::algorithms::qr::ResultId
ResultId
Definition: qr_types.h:73
daal::algorithms::qr::DistributedPartialResultId
DistributedPartialResultId
Definition: qr_types.h:110
daal::algorithms::qr::interface1::DistributedPartialResultStep3
Provides methods to access partial results obtained with the compute() method of the third step of th...
Definition: qr_types.h:565
daal::algorithms::qr::MasterInputId
MasterInputId
Definition: qr_types.h:130
daal::algorithms::qr::inputOfStep2FromStep1
Definition: qr_types.h:132
daal::algorithms::qr::outputOfStep1ForStep3
Definition: qr_types.h:87
daal::algorithms::qr::interface1::Result::~Result
virtual ~Result()
Definition: qr_types.h:399