24 #ifndef __COVARIANCE_TYPES_H__
25 #define __COVARIANCE_TYPES_H__
27 #include "data_management/data/homogen_numeric_table.h"
81 lastPartialResultId = sum
91 correlation = covariance,
100 enum OutputMatrixType
113 lastMasterInputId = partialResults
125 class DAAL_EXPORT InputIface :
public daal::algorithms::Input
128 InputIface(
size_t nElements) : daal::algorithms::Input(nElements) {}
129 InputIface(
const InputIface& other) : daal::algorithms::Input(other){}
130 virtual size_t getNumberOfFeatures()
const = 0;
131 virtual ~InputIface() {}
138 class DAAL_EXPORT Input :
public InputIface
142 Input(
const Input& other) : InputIface(other){}
150 size_t getNumberOfFeatures()
const DAAL_C11_OVERRIDE;
157 data_management::NumericTablePtr
get(InputId id)
const;
164 void set(InputId
id,
const data_management::NumericTablePtr &ptr);
171 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
180 class DAAL_EXPORT PartialResult :
public daal::algorithms::PartialResult
183 DECLARE_SERIALIZABLE_CAST(PartialResult);
186 virtual ~PartialResult()
195 template <
typename algorithmFPType>
196 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
205 template <
typename algorithmFPType>
206 DAAL_EXPORT services::Status initialize(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
212 size_t getNumberOfFeatures()
const;
219 data_management::NumericTablePtr
get(PartialResultId id)
const;
226 void set(PartialResultId
id,
const data_management::NumericTablePtr &ptr);
234 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
241 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
245 services::Status checkImpl(
size_t nFeatures)
const;
248 template<
typename Archive,
bool onDeserialize>
249 services::Status serialImpl(Archive *arch)
251 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
254 typedef services::SharedPtr<PartialResult> PartialResultPtr;
260 struct DAAL_EXPORT Parameter :
public daal::algorithms::Parameter
264 OutputMatrixType outputMatrixType;
271 struct DAAL_EXPORT OnlineParameter :
public Parameter
280 OnlineParameter(
const OnlineParameter& other);
285 services::Status check()
const DAAL_C11_OVERRIDE;
293 class DAAL_EXPORT Result :
public daal::algorithms::Result
296 DECLARE_SERIALIZABLE_CAST(Result);
307 template <
typename algorithmFPType>
308 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
316 template <
typename algorithmFPType>
317 DAAL_EXPORT services::Status allocate(
const daal::algorithms::PartialResult *partialResult,
const daal::algorithms::Parameter *parameter,
const int method);
324 data_management::NumericTablePtr
get(ResultId id)
const;
331 void set(ResultId
id,
const data_management::NumericTablePtr &value);
339 services::Status check(
const daal::algorithms::PartialResult *partialResult,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
347 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
351 services::Status checkImpl(
size_t nFeatures, OutputMatrixType outputMatrixType)
const;
354 template<
typename Archive,
bool onDeserialize>
355 services::Status serialImpl(Archive *arch)
357 return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
360 typedef services::SharedPtr<Result> ResultPtr;
368 template<ComputeStep step>
369 class DistributedInput {};
377 class DAAL_EXPORT DistributedInput<step1Local> :
public Input
380 DistributedInput() : Input()
382 DistributedInput(
const DistributedInput& other) : Input(other)
385 virtual ~DistributedInput()
395 class DAAL_EXPORT DistributedInput<step2Master> :
public InputIface
399 DistributedInput(
const DistributedInput& other) : InputIface(other)
402 virtual ~DistributedInput()
409 size_t getNumberOfFeatures()
const DAAL_C11_OVERRIDE;
416 void add(MasterInputId
id,
const PartialResultPtr &partialResult);
423 data_management::DataCollectionPtr
get(MasterInputId id)
const;
430 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
434 using interface1::InputIface;
435 using interface1::Input;
436 using interface1::PartialResult;
437 using interface1::PartialResultPtr;
438 using interface1::Parameter;
439 using interface1::OnlineParameter;
440 using interface1::Result;
441 using interface1::ResultPtr;
442 using interface1::DistributedInput;
447 #endif // __COVARIANCE_TYPES_H__
daal::step1Local
Definition: daal_defines.h:123
daal::algorithms::covariance::interface1::InputIface
Abstract class that specifies interface for classes that declare input of the correlation or variance...
Definition: covariance_types.h:125
daal::algorithms::covariance::ResultId
ResultId
Available identifiers of results of the correlation or variance-covariance matrix algorithm...
Definition: covariance_types.h:88
daal::algorithms::covariance::InputId
InputId
Definition: covariance_types.h:66
daal::algorithms::covariance::correlationMatrix
Definition: covariance_types.h:103
daal::algorithms::covariance::interface1::Result
Provides methods to access final results obtained with the compute() method of the correlation or var...
Definition: covariance_types.h:293
daal::algorithms::covariance::covariance
Definition: covariance_types.h:90
daal::algorithms::covariance::interface1::PartialResult
Provides methods to access partial results obtained with the compute() method of the correlation or v...
Definition: covariance_types.h:180
daal::algorithms::covariance::mean
Definition: covariance_types.h:92
daal::algorithms::covariance::Method
Method
Definition: covariance_types.h:48
daal::step2Master
Definition: daal_defines.h:124
daal::algorithms::covariance::nObservations
Definition: covariance_types.h:78
daal::algorithms::covariance::partialResults
Definition: covariance_types.h:112
daal::algorithms::covariance::defaultDense
Definition: covariance_types.h:50
daal::algorithms::covariance::OutputMatrixType
OutputMatrixType
Definition: covariance_types.h:100
daal::algorithms::covariance::sumCSR
Definition: covariance_types.h:58
daal::algorithms::covariance::interface1::DistributedInput
Input parameters of the distributed Covariance algorithm.
Definition: covariance_types.h:369
daal::algorithms::covariance::interface1::OnlineParameter
Parameters of the correlation or variance-covariance matrix algorithm in the online processing mode...
Definition: covariance_types.h:271
daal::algorithms::covariance::correlation
Definition: covariance_types.h:91
daal::algorithms::covariance::PartialResultId
PartialResultId
Definition: covariance_types.h:76
daal::algorithms::covariance::data
Definition: covariance_types.h:68
daal::algorithms::covariance::singlePassCSR
Definition: covariance_types.h:56
daal::algorithms::covariance::crossProduct
Definition: covariance_types.h:79
daal::algorithms::covariance::fastCSR
Definition: covariance_types.h:55
daal::algorithms::covariance::covarianceMatrix
Definition: covariance_types.h:102
daal::algorithms::covariance::singlePassDense
Definition: covariance_types.h:51
daal::algorithms::covariance::interface1::Input
Input objects of the correlation or variance-covariance matrix algorithm
Definition: covariance_types.h:138
daal::algorithms::covariance::sum
Definition: covariance_types.h:80
daal::algorithms::covariance::MasterInputId
MasterInputId
Available identifiers of master node input arguments of the Covariance algorithm. ...
Definition: covariance_types.h:110
daal::algorithms::covariance::sumDense
Definition: covariance_types.h:53
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::covariance::interface1::Parameter
Parameters of the correlation or variance-covariance matrix algorithm.
Definition: covariance_types.h:260
daal::algorithms::covariance::interface1::Parameter::outputMatrixType
OutputMatrixType outputMatrixType
Definition: covariance_types.h:264