NAG Library Function Document

nag_idwt_2d (c09ebc)

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1
Purpose

nag_idwt_2d (c09ebc) computes the inverse two-dimensional discrete wavelet transform (DWT) at a single level. The initialization function nag_wfilt_2d (c09abc) must be called first to set up the DWT options.

2
Specification

#include <nag.h>
#include <nagc09.h>
void  nag_idwt_2d (Integer m, Integer n, const double ca[], Integer ldca, const double ch[], Integer ldch, const double cv[], Integer ldcv, const double cd[], Integer ldcd, double b[], Integer ldb, const Integer icomm[], NagError *fail)

3
Description

nag_idwt_2d (c09ebc) performs the inverse operation of function nag_dwt_2d (c09eac). That is, given sets of approximation, horizontal, vertical and diagonal coefficients computed by function nag_dwt_2d (c09eac) using a DWT as set up by the initialization function nag_wfilt_2d (c09abc), on a real matrix, B, nag_idwt_2d (c09ebc) will reconstruct B.

4
References

None.

5
Arguments

1:     m IntegerInput
On entry: number of rows, m, of data matrix B.
Constraint: this must be the same as the value m passed to the initialization function nag_wfilt_2d (c09abc).
2:     n IntegerInput
On entry: number of columns, n, of data matrix B.
Constraint: this must be the same as the value n passed to the initialization function nag_wfilt_2d (c09abc).
3:     ca[dim] const doubleInput
Note: the dimension, dim, of the array ca must be at least ldca×ncn where ncn is the argument nwcn returned by function nag_wfilt_2d (c09abc).
The i,jth element of the matrix is stored in ca[j-1×ldca+i-1].
On entry: contains the ncm by ncn matrix of approximation coefficients, Ca. This array will normally be the result of some transformation on the coefficients computed by function nag_dwt_2d (c09eac).
4:     ldca IntegerInput
On entry: the stride separating matrix row elements in the array ca.
Constraint: ldcancm where ncm=nct/4ncn and ncn, nct are returned by the initialization function nag_wfilt_2d (c09abc).
5:     ch[dim] const doubleInput
Note: the dimension, dim, of the array ch must be at least ldch×ncn where ncn is the argument nwcn returned by function nag_wfilt_2d (c09abc).
The i,jth element of the matrix is stored in ch[j-1×ldch+i-1].
On entry: contains the ncm by ncn matrix of horizontal coefficients, Ch. This array will normally be the result of some transformation on the coefficients computed by function nag_dwt_2d (c09eac).
6:     ldch IntegerInput
On entry: the stride separating matrix row elements in the array ch.
Constraint: ldchncm where ncm=nct/4ncn and ncn, nct are returned by the initialization function nag_wfilt_2d (c09abc).
7:     cv[dim] const doubleInput
Note: the dimension, dim, of the array cv must be at least ldcv×ncn where ncn is the argument nwcn returned by function nag_wfilt_2d (c09abc).
The i,jth element of the matrix is stored in cv[j-1×ldcv+i-1].
On entry: contains the ncm by ncn matrix of vertical coefficients, Cv. This array will normally be the result of some transformation on the coefficients computed by function nag_dwt_2d (c09eac).
8:     ldcv IntegerInput
On entry: the stride separating matrix row elements in the array cv.
Constraint: ldcvncm where ncm=nct/4ncn and ncn, nct are returned by the initialization function nag_wfilt_2d (c09abc).
9:     cd[dim] const doubleInput
Note: the dimension, dim, of the array cd must be at least ldcd×ncn where ncn is the argument nwcn returned by function nag_wfilt_2d (c09abc).
The i,jth element of the matrix is stored in cd[j-1×ldcd+i-1].
On entry: contains the ncm by ncn matrix of diagonal coefficients, Cd. This array will normally be the result of some transformation on the coefficients computed by function nag_dwt_2d (c09eac).
10:   ldcd IntegerInput
On entry: the stride separating matrix row elements in the array cd.
Constraint: ldcdncm where ncm=nct/4ncn and ncn, nct are returned by the initialization function nag_wfilt_2d (c09abc).
11:   b[ldb×n] doubleOutput
Note: the i,jth element of the matrix B is stored in b[j-1×ldb+i-1].
On exit: the m by n reconstructed matrix, B, based on the input approximation, horizontal, vertical and diagonal coefficients and the transform options supplied to the initialization function nag_wfilt_2d (c09abc).
12:   ldb IntegerInput
On entry: the stride separating matrix row elements in the array b.
Constraint: ldbm.
13:   icomm[180] 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_2d (c09abc).
14:   fail NagError *Input/Output
The NAG error argument (see Section 3.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.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INITIALIZATION
Either the initialization function has not been called first or icomm has been corrupted.
Either the initialization function was called with wtrans=Nag_MultiLevel or icomm has been corrupted.
NE_INT
On entry, ldca=value.
Constraint: ldcavalue, the number of wavelet coefficients in the first dimension.
On entry, ldcd=value.
Constraint: ldcdvalue, the number of wavelet coefficients in the first dimension.
On entry, ldch=value.
Constraint: ldchvalue, the number of wavelet coefficients in the first dimension.
On entry, ldcv=value.
Constraint: ldcvvalue, the number of wavelet coefficients in the first dimension.
On entry, m=value.
Constraint: m=value, the value of m on initialization (see nag_wfilt_2d (c09abc)).
On entry, n=value.
Constraint: n=value, the value of n on initialization (see nag_wfilt_2d (c09abc)).
NE_INT_2
On entry, ldb=value and m=value.
Constraint: ldbm.
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_2d (c09ebc) 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.

9
Further Comments

None.

10
Example

See Section 10 in nag_dwt_2d (c09eac).
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017