# 2. oneMKL Domain Interfaces¶

This section describes the Data Parallel C++ (DPC++) interface.

## 2.1. Dense Linear Algebra¶

This section contains information about dense linear algebra routines:

Matrix Storage provides information about dense matrix and vector storage formats that are used by oneMKL BLAS Routines and LAPACK Routines.

BLAS Routines provides vector, matrix-vector, and matrix-matrix routines for dense matrices and vector operations.

LAPACK Routines provides more complex dense linear algebra routines, e.g., solving dense systems of linear equations, least square problems, eigenvalue, singular value problems, and Sylvester’s equations.

## 2.2. Sparse Linear Algebra¶

The oneAPI Math Kernel Library provides a Data Parallel C++ interface to some of the Sparse Linear Algebra routines.

Sparse BLAS Routines provide basic operations on sparse vectors and matrices

## 2.3. Discrete Fourier Transforms¶

The Fourier Transform Functions offer several options for computing Discrete Fourier Transforms (DFTs).

## 2.4. Random Number Generators¶

Statistics Random Number Generators provide a set of routines implementing commonly used pseudorandom, quasi-random, and non-deterministic generators with continuous and discrete distributions.

Definitions

Pseudo-random number generator is defined by a structure(S, μ, f, U, g), where:

• S is a finite set of states (the state space)

• μ is a probability distribution on S for the initial state (or seed) s0

• f:S→S is the transition function

• U – a finite set of output symbols

• g∶S→U an output function

The generation of random numbers is as follows:

1. Generate the initial state (called the seed) s0 according to μ and compute u0=g(s0).

2. Iterate for i=1,…,si = f(s(i-1)) and ui = g(si). Output values ui are the so-called random numbers produced by the PRNG.

In computational statistics, random variate generation is usually made in two steps:

1. Generating imitations of independent and identically distributed (i.i.d.) random variables having the uniform distribution over the interval (0, 1)

2. Applying transformations to these i.i.d. U(0, 1) random variates in order to generate (or imitate) random variates and random vectors from arbitrary distributions.

All RNG routines can be classified into several categories:

• Engines (Basic random number generators) classes, which holds state of generator and is a source of i.i.d. random. Refer to Engines (Basic Random Number Generators) for a detailed description.

• Transformation classes for different types of statistical distributions, for example, uniform, normal (Gaussian), binomial, etc. These classes contain all of the distribution’s parameters (including generation method). Refer to Distribution Generators for a detailed description of the distributions.

• Generate function. The current routine is used to obtain random numbers from a given engine with proper statistics defined by a given distribution. Refer to the Generate Routine section for a detailed description.

• Service routines to modify the engine state: skip ahead and leapfrog functions. Refer to Service Routines for a description of these routines.

## 2.5. Vector Math¶

oneMKL Vector Mathematics functions (VM) compute a mathematical function of each of the vector elements. VM includes a set of functions (arithmetic, power, trigonometric, exponential, hyperbolic, special, and rounding) that operate on vectors of real and complex numbers.

Application programs that improve performance with VM include nonlinear programming software, computation of integrals, financial calculations, computer graphics, and many others.

VM functions fall into the following groups according to the operations they perform:

• VM Mathematical Functions compute values of mathematical functions, such as sine, cosine, exponential, or logarithm, on vectors stored contiguously in memory.

• VM Service Functions set/get the accuracy modes and the error codes,and create error handlers for mathematical functions.

The VM mathematical functions take an input vector as an argument, compute values of the respective function element-wise, and return the results in an output vector. All the VM mathematical functions can perform in-place operations, where the input and output arrays are at the same memory locations.