dataset#

The structure consolidates the information of a multi-dimensional dataset.

Description

The dataset struct object is used in Summary Statistics Routines as a multi-dimensional data storage. dataset struct contains information about observations matrix and its size (dimensions x observations), observations weights and indices for dimensions (defines dimensions to be processed).

structure dataset (Buffer version)#

Syntax

namespace oneapi::mkl::stats {
template<layout ObservationsLayout, typename Type>
    struct dataset<ObservationsLayout, sycl::buffer<Type, 1>> {

    explicit dataset(std::int64_t n_dims_, std::int64_t n_observations_,
                sycl::buffer<Type, 1> observations_, sycl::buffer<Type, 1> weights_ = {0},
                sycl::buffer<std::int64_t, 1> indices_ = {0});

    std::int64_t n_dims;
    std::int64_t n_observations;
    sycl::buffer<Type, 1> observations;
    sycl::buffer<Type, 1> weights = {0};
    sycl::buffer<std::int64_t, 1> indices = {0};
    static constexpr layout layout = ObservationsLayout;
    };
}

Template parameters

typename Type

Type of the multi-dimensional data. Supported types:

  • float

  • double

oneapi::mkl::stats::layout ObservationsLayout

Type of the multi-dimensional data layout. Supported types:

  • oneapi::mkl::stats::layout::row_major

  • oneapi::mkl::stats::layout::col_major

Constructors

explicit dataset::dataset(std::int64_t n_dims_, std::int64_t n_observations_,
    sycl::buffer<Type, 1> observations_,
    sycl::buffer<Type, 1> weights_ = {0},
    sycl::buffer<std::int64_t, 1> indices_ = {0});

Description

Constructor with parameters.

  • n_dims_ is the number of dimensions

  • n_observations_ is the number of observations

  • observations_ is the matrix of observations

  • weights_ is an optional parameter, represents an array of weights for observations (of size n_observations). If the parameter is not specified, each observation is assigned a weight equal 1.

  • indices_ is an optional parameter, represents an array of dimensions that are processed (of size n_dims). If the parameter is not specified, all dimensions are processed.

Throws

oneapi::mkl::invalid_argument

Exception is thrown when n_dims_ \(\leq 0\), or n_observations_ \(\leq 0\), or observations_.get_count() == 0

structure dataset (USM version)#

Syntax

namespace oneapi::mkl::stats {
template<layout ObservationsLayout, typename Type>
    struct dataset<Type*, ObservationsLayout> {
    explicit dataset(std::int64_t n_dims_, std::int64_t n_observations_, Type* observations_,
                Type* weights_ = nullptr, std::int64_t* indices_ = nullptr);

    std::int64_t n_dims;
    std::int64_t n_observations;
    Type* observations;
    Type* weights = nullptr;
    std::int64_t* indices = nullptr;
    static constexpr layout layout = ObservationsLayout;
    };
}

Template parameters

typename Type

Type of the multi-dimensional data. Supported types:

  • float

  • double

oneapi::mkl::stats::layout ObservationsLayout

Type of the multi-dimensional data layout. Supported types:

  • oneapi::mkl::stats::layout::row_major

  • oneapi::mkl::stats::layout::col_major

Constructors

explicit dataset::dataset(std::int64_t n_dims_, std::int64_t n_observations_,
    Type* observations_,
    Type* weights_ = nullptr,
    std::int64_t* indices_ = nullptr);

Description

Constructor with parameters.

  • n_dims_ is the number of dimensions

  • n_observations_ is the number of observations

  • observations_ is the matrix of observations

  • weights_ is an optional parameter, represents an array of weights for observations (of size n_observations). If the parameter is not specified, each observation is assigned a weight equal 1.

  • indices_ is an optional parameter, represents an array of dimensions that are processed (of size n_dims). If the parameter is not specified, all dimensions are processed.

Throws

oneapi::mkl::invalid_argument

Exception is thrown when n_dims_ \(\leq 0\), or n_observations_ \(\leq 0\), or observations_ == nullptr

Parent topic: Summary Statistics