# unitSphere_innerProduct1-class: An S4 class to represent the function... In multIntTestFunc: Provides Test Functions for Multivariate Integration

## Description

Implementation of the function

f \colon S^{n-1} \to R,\, \vec{x} \mapsto f(\vec{x}) = (\vec{x}\cdot\vec{a})(\vec{x}\cdot\vec{b}),

where n \in \{1,2,3,…\} is the dimension of the integration domain S^{n-1} = \{\vec{x}\in R^n : \Vert \vec{x} \Vert_2 = 1\} and \vec{a} and \vec{b} are two n-dimensional parameter vectors. The integral is known to be

\int_{S^{n-1}} f(\vec{x}) d\vec{x} = \frac{2π^{n/2}(\vec{a}\cdot\vec{b})}{nΓ(n/2)},

where \vec{a}\in R^n and \vec{b}\in R^n.

## Details

Due to the difficulty of testing \Vert \vec{x} \Vert_2 = 1 in floating point arithmetic this class also implements the function "domainCheckP". This allows to pass a list with an additional non-negative parameter "eps" representing a non-negative real number \varepsilon and allows to test 1-\varepsilon ≤q \Vert \vec{x} \Vert_2 ≤q 1+\varepsilon. See also the documentation of the function "checkUnitSphere" that is used to perform the checks.

The instance needs to be created with three parameters representing the dimension n and the two n-dimensional (real) vectors \vec{a} and \vec{b}.

## Slots

dim

An integer that captures the dimension

a

A n-dimensional real vector

b

A n-dimensional real vector

## Examples

 1 2 n <- as.integer(3) f <- new("unitSphere_innerProduct1",dim=n,a=c(1,2,3),b=c(-1,-2,-3)) 

multIntTestFunc documentation built on Oct. 5, 2021, 5:08 p.m.