Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,58 +37,6 @@ namespace low_order_moments
{
namespace interface1
{
/**
* @defgroup low_order_moments_distributed Distributed
* @ingroup low_order_moments
* @{
*/
/**
* <a name="DAAL-CLASS-ALGORITHMS__LOW_ORDER_MOMENTS__DISTRIBUTEDCONTAINER_STEP_ALGORITHMFPTYPE_METHOD"></a>
* \brief Provides methods to run implementations of the low order moments algorithm in the distributed processing mode.
* This class is associated with daal::algorithms::low_order_moments::Distributed class
*
* \tparam step Step of distributed processing, \ref ComputeStep
* \tparam algorithmFPType Data type to use in intermediate computations of the low order moments, double or float
* \tparam method Computation method, \ref daal::algorithms::low_order_moments::Method
*
*/
template <ComputeStep step, typename algorithmFPType, Method method, CpuType cpu>
class DistributedContainer
{};

/**
* \brief Provides methods to run implementations of the second step of the low order moments algorithm
* in the distributed processing mode.
* This class is associated with daal::algorithms::low_order_moments::Distributed class
*
* \tparam algorithmFPType Data type to use in intermediate computations of the low order moments, double or float
* \tparam method Computation method, \ref daal::algorithms::low_order_moments::Method
*
*/
template <typename algorithmFPType, Method method, CpuType cpu>
class DistributedContainer<step2Master, algorithmFPType, method, cpu> : public daal::algorithms::AnalysisContainerIface<distributed>
{
public:
/**
* Constructs a container for the low order moments algorithm with a specified environment
* in the second step of the distributed processing mode
* \param[in] daalEnv Environment object
*/
DistributedContainer(daal::services::Environment::env * daalEnv);
/** Default destructor */
virtual ~DistributedContainer();
/**
* Computes a partial result of the low order moments algorithm
* in the second step of the distributed processing mode
*/
virtual services::Status compute() DAAL_C11_OVERRIDE;
/**
* Computes the result of the low order moments algorithm
* in the second step of the distributed processing mode
*/
virtual services::Status finalizeCompute() DAAL_C11_OVERRIDE;
};

/**
* <a name="DAAL-CLASS-ALGORITHMS__LOW_ORDER_MOMENTS__DISTRIBUTED"></a>
* \brief Computes moments of low order in the distributed processing mode.
Expand Down Expand Up @@ -285,9 +233,8 @@ class Distributed<step2Master, algorithmFPType, method> : public daal::algorithm

void initialize()
{
Analysis<distributed>::_ac = new __DAAL_ALGORITHM_CONTAINER(distributed, DistributedContainer, step2Master, algorithmFPType, method)(&_env);
_in = &input;
_par = &parameter;
_in = &input;
_par = &parameter;
_result.reset(new ResultType());
_partialResult.reset(new PartialResultType());
}
Expand All @@ -301,7 +248,6 @@ class Distributed<step2Master, algorithmFPType, method> : public daal::algorithm
/** @} */
} // namespace interface1
using interface1::DistributedInput;
using interface1::DistributedContainer;
using interface1::Distributed;

} // namespace low_order_moments
Expand Down
44 changes: 2 additions & 42 deletions cpp/daal/include/algorithms/moments/low_order_moments_online.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,44 +37,6 @@ namespace low_order_moments
{
namespace interface1
{
/**
* @defgroup low_order_moments_online Online
* @ingroup low_order_moments
* @{
*/
/**
* <a name="DAAL-CLASS-ALGORITHMS__LOW_ORDER_MOMENTS__ONLINECONTAINER"></a>
* \brief Provides methods to run implementations of the low order moments algorithm.
* This class is associated with daal::algorithms::low_order_moments::Online class

*
* \tparam method Computation method for the low order moments algorithm, \ref daal::algorithms::low_order_moments::Method
* \tparam algorithmFPType Data type to use in intermediate computations of the low order moments, double or float
*/
template <typename algorithmFPType, Method method, CpuType cpu>
class OnlineContainer : public daal::algorithms::AnalysisContainerIface<online>
{
public:
/**
* Constructs a container for the low order moments algorithm with a specified environment
* in the online processing mode
* \param[in] daalEnv Environment object
*/
OnlineContainer(daal::services::Environment::env * daalEnv);
/** Default destructor */
virtual ~OnlineContainer();
/**
* Computes a partial result of the low order moments algorithm
* in the online processing mode
*/
virtual services::Status compute() DAAL_C11_OVERRIDE;
/**
* Computes the result of the low order moments algorithm
* in the online processing mode
*/
virtual services::Status finalizeCompute() DAAL_C11_OVERRIDE;
};

/**
* <a name="DAAL-CLASS-ALGORITHMS__LOW_ORDER_MOMENTS__ONLINE"></a>
* \brief Computes moments of low order in the online processing mode.
Expand Down Expand Up @@ -189,9 +151,8 @@ class DAAL_EXPORT Online : public daal::algorithms::Analysis<online>

void initialize()
{
Analysis<online>::_ac = new __DAAL_ALGORITHM_CONTAINER(online, OnlineContainer, algorithmFPType, method)(&_env);
_in = &input;
_par = &parameter;
_in = &input;
_par = &parameter;
_result.reset(new ResultType());
_partialResult.reset(new PartialResultType());
}
Expand All @@ -204,7 +165,6 @@ class DAAL_EXPORT Online : public daal::algorithms::Analysis<online>
};
/** @} */
} // namespace interface1
using interface1::OnlineContainer;
using interface1::Online;

} // namespace low_order_moments
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -62,131 +62,6 @@ services::Status BatchContainer<algorithmFPType, method, cpu>::compute()
__DAAL_CALL_KERNEL(env, internal::LowOrderMomentsBatchKernel, __DAAL_KERNEL_ARGUMENTS(algorithmFPType, method), compute, dataTable, result, par);
}

template <typename algorithmFPType, Method method, CpuType cpu>
OnlineContainer<algorithmFPType, method, cpu>::OnlineContainer(daal::services::Environment::env * daalEnv)
{
__DAAL_INITIALIZE_KERNELS(internal::LowOrderMomentsOnlineKernel, algorithmFPType, method);
}

template <typename algorithmFPType, Method method, CpuType cpu>
OnlineContainer<algorithmFPType, method, cpu>::~OnlineContainer()
{
__DAAL_DEINITIALIZE_KERNELS();
}

template <typename algorithmFPType, Method method, CpuType cpu>
services::Status OnlineContainer<algorithmFPType, method, cpu>::compute()
{
bool isOnline = true;
Input * input = static_cast<Input *>(_in);
PartialResult * partialResult = static_cast<PartialResult *>(_pres);

NumericTable * dataTable = input->get(data).get();

Parameter * par = static_cast<Parameter *>(_par);
daal::services::Environment::env & env = *_env;

__DAAL_CALL_KERNEL(env, internal::LowOrderMomentsOnlineKernel, __DAAL_KERNEL_ARGUMENTS(algorithmFPType, method), compute, dataTable,
partialResult, par, isOnline);
}

template <typename algorithmFPType, Method method, CpuType cpu>
services::Status OnlineContainer<algorithmFPType, method, cpu>::finalizeCompute()
{
PartialResult * partialResult = static_cast<PartialResult *>(_pres);
Result * result = static_cast<Result *>(_res);

Parameter * par = static_cast<Parameter *>(_par);
daal::services::Environment::env & env = *_env;

result->set(minimum, partialResult->get(partialMinimum));
result->set(maximum, partialResult->get(partialMaximum));
result->set(sum, partialResult->get(partialSum));
result->set(sumSquares, partialResult->get(partialSumSquares));
result->set(sumSquaresCentered, partialResult->get(partialSumSquaresCentered));

NumericTable * nObservationsTable = partialResult->get(nObservations).get();
NumericTable * sumTable = partialResult->get(partialSum).get();
NumericTable * sumSqTable = partialResult->get(partialSumSquares).get();
NumericTable * sumSqCenTable = partialResult->get(partialSumSquaresCentered).get();

NumericTable * meanTable = result->get(mean).get();
NumericTable * raw2MomTable = result->get(secondOrderRawMoment).get();
NumericTable * varianceTable = result->get(variance).get();
NumericTable * stDevTable = result->get(standardDeviation).get();
NumericTable * variationTable = result->get(variation).get();

__DAAL_CALL_KERNEL(env, internal::LowOrderMomentsOnlineKernel, __DAAL_KERNEL_ARGUMENTS(algorithmFPType, method), finalizeCompute,
nObservationsTable, sumTable, sumSqTable, sumSqCenTable, meanTable, raw2MomTable, varianceTable, stDevTable, variationTable,
par);
}

template <typename algorithmFPType, Method method, CpuType cpu>
DistributedContainer<step2Master, algorithmFPType, method, cpu>::DistributedContainer(daal::services::Environment::env * daalEnv)
{
__DAAL_INITIALIZE_KERNELS(internal::LowOrderMomentsDistributedKernel, algorithmFPType, method);
}

template <typename algorithmFPType, Method method, CpuType cpu>
DistributedContainer<step2Master, algorithmFPType, method, cpu>::~DistributedContainer()
{
__DAAL_DEINITIALIZE_KERNELS();
}

template <typename algorithmFPType, Method method, CpuType cpu>
services::Status DistributedContainer<step2Master, algorithmFPType, method, cpu>::compute()
{
PartialResult * partialResult = static_cast<PartialResult *>(_pres);
DistributedInput<step2Master> * input = static_cast<DistributedInput<step2Master> *>(_in);
data_management::DataCollection * collection = input->get(low_order_moments::partialResults).get();

Parameter * par = static_cast<Parameter *>(_par);
daal::services::Environment::env & env = *_env;

services::Status s;

s = __DAAL_CALL_KERNEL_STATUS(env, internal::LowOrderMomentsDistributedKernel, __DAAL_KERNEL_ARGUMENTS(algorithmFPType, method), compute,
collection, partialResult, par);

collection->clear();
return s;
}

template <typename algorithmFPType, Method method, CpuType cpu>
services::Status DistributedContainer<step2Master, algorithmFPType, method, cpu>::finalizeCompute()
{
PartialResult * partialResult = static_cast<PartialResult *>(_pres);
Result * result = static_cast<Result *>(_res);

Parameter * par = static_cast<Parameter *>(_par);
daal::services::Environment::env & env = *_env;

result->set(minimum, partialResult->get(partialMinimum));
result->set(maximum, partialResult->get(partialMaximum));
result->set(sum, partialResult->get(partialSum));
result->set(sumSquares, partialResult->get(partialSumSquares));
result->set(sumSquaresCentered, partialResult->get(partialSumSquaresCentered));

services::Status s;

NumericTable * nObservationsTable = partialResult->get(nObservations).get();
NumericTable * sumTable = partialResult->get(partialSum).get();
NumericTable * sumSqTable = partialResult->get(partialSumSquares).get();
NumericTable * sumSqCenTable = partialResult->get(partialSumSquaresCentered).get();

NumericTable * meanTable = result->get(mean).get();
NumericTable * raw2MomTable = result->get(secondOrderRawMoment).get();
NumericTable * varianceTable = result->get(variance).get();
NumericTable * stDevTable = result->get(standardDeviation).get();
NumericTable * variationTable = result->get(variation).get();

s = __DAAL_CALL_KERNEL_STATUS(env, internal::LowOrderMomentsDistributedKernel, __DAAL_KERNEL_ARGUMENTS(algorithmFPType, method), finalizeCompute,
nObservationsTable, sumTable, sumSqTable, sumSqCenTable, meanTable, raw2MomTable, varianceTable, stDevTable,
variationTable, par);

return s;
}

} // namespace low_order_moments
} // namespace algorithms
} // namespace daal
Expand Down

This file was deleted.

Loading
Loading