c09 Chapter Contents
c09 Chapter Introduction
NAG Library Manual

# NAG Library Function Documentnag_idwt_3d (c09fbc)

## 1  Purpose

nag_idwt_3d (c09fbc) computes the three-dimensional inverse discrete wavelet transform (IDWT) at a single level. The initialization function nag_wfilt_3d (c09acc) must be called first to set up the DWT options.

## 2  Specification

 #include #include
 void nag_idwt_3d (Integer m, Integer n, Integer fr, Integer lenc, const double c[], double b[], Integer ldb, Integer sdb, const Integer icomm[], NagError *fail)

## 3  Description

nag_idwt_3d (c09fbc) performs the inverse operation of function nag_dwt_3d (c09fac). That is, given sets of wavelet coefficients computed by function nag_dwt_3d (c09fac) using a DWT as set up by the initialization function nag_wfilt_3d (c09acc), on a real data array, $B$, nag_idwt_3d (c09fbc) will reconstruct $B$.

None.

## 5  Arguments

1:    $\mathbf{m}$IntegerInput
On entry: the number of rows of each two-dimensional frame.
Constraint: this must be the same as the value m passed to the initialization function nag_wfilt_3d (c09acc).
2:    $\mathbf{n}$IntegerInput
On entry: the number of columns of each two-dimensional frame.
Constraint: this must be the same as the value n passed to the initialization function nag_wfilt_3d (c09acc).
3:    $\mathbf{fr}$IntegerInput
On entry: the number two-dimensional frames.
Constraint: this must be the same as the value fr passed to the initialization function nag_wfilt_3d (c09acc).
4:    $\mathbf{lenc}$IntegerInput
On entry: the dimension of the array c.
Constraint: ${\mathbf{lenc}}\ge {n}_{\mathrm{ct}}$, where ${n}_{\mathrm{ct}}$ is the total number of wavelet coefficients, as returned by nag_wfilt_3d (c09acc).
5:    $\mathbf{c}\left[{\mathbf{lenc}}\right]$const doubleInput
On entry: the coefficients of the discrete wavelet transform. This will normally be the result of some transformation on the coefficients computed by function nag_dwt_3d (c09fac).
Note that the coefficients in c may be extracted according to type into three-dimensional arrays using nag_wav_3d_coeff_ext (c09fyc), and inserted using nag_wav_3d_coeff_ins (c09fzc).
6:    $\mathbf{b}\left[\mathit{dim}\right]$doubleOutput
Note: the dimension, dim, of the array b must be at least ${\mathbf{ldb}}×{\mathbf{sdb}}×{\mathbf{fr}}$.
On exit: the $m$ by $n$ by $\mathit{fr}$ reconstructed array, $B$, with ${B}_{ijk}$ stored in ${\mathbf{b}}\left[\left(k-1\right)×{\mathbf{ldb}}×{\mathbf{sdb}}+\left(j-1\right)×{\mathbf{ldb}}+i-1\right]$. The reconstruction is based on the input wavelet coefficients and the transform options supplied to the initialization function nag_wfilt_3d (c09acc).
7:    $\mathbf{ldb}$IntegerInput
On entry: the stride separating row elements of each of the sets of frame coefficients in the three-dimensional data stored in b.
Constraint: ${\mathbf{ldb}}\ge {\mathbf{m}}$.
8:    $\mathbf{sdb}$IntegerInput
On entry: the stride separating corresponding coefficients of consecutive frames in the three-dimensional data stored in b.
Constraint: ${\mathbf{sdb}}\ge {\mathbf{n}}$.
9:    $\mathbf{icomm}\left[260\right]$const IntegerCommunication Array
On entry: contains details of the discrete wavelet transform and the problem dimension as setup in the call to the initialization function nag_wfilt_3d (c09acc).
10:  $\mathbf{fail}$NagError *Input/Output
The NAG error argument (see Section 2.7 in How to Use the NAG Library and its Documentation).

## 6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INITIALIZATION
Either the communication array icomm has been corrupted or there has not been a prior call to the initialization function nag_wfilt_3d (c09acc).
The initialization function was called with ${\mathbf{wtrans}}=\mathrm{Nag_MultiLevel}$.
NE_INT
On entry, ${\mathbf{fr}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{fr}}=〈\mathit{\text{value}}〉$, the value of fr on initialization (see nag_wfilt_3d (c09acc)).
On entry, ${\mathbf{m}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{m}}=〈\mathit{\text{value}}〉$, the value of m on initialization (see nag_wfilt_3d (c09acc)).
On entry, ${\mathbf{n}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{n}}=〈\mathit{\text{value}}〉$, the value of n on initialization (see nag_wfilt_3d (c09acc)).
NE_INT_2
On entry, ${\mathbf{ldb}}=〈\mathit{\text{value}}〉$ and ${\mathbf{m}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{ldb}}\ge {\mathbf{m}}$.
On entry, ${\mathbf{lenc}}=〈\mathit{\text{value}}〉$ and ${n}_{\mathrm{ct}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{lenc}}\ge {n}_{\mathrm{ct}}$, where ${n}_{\mathrm{ct}}$ is the number of DWT coefficients returned by nag_wfilt_3d (c09acc) in argument nwct.
On entry, ${\mathbf{sdb}}=〈\mathit{\text{value}}〉$ and ${\mathbf{n}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{sdb}}\ge {\mathbf{n}}$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.

## 7  Accuracy

The accuracy of the wavelet transform depends only on the floating-point operations used in the convolution and downsampling and should thus be close to machine precision.

## 8  Parallelism and Performance

nag_idwt_3d (c09fbc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the x06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.