NAG CL Interface
c09ebc (dim2_​sngl_​inv)

Settings help

CL Name Style:


1 Purpose

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

2 Specification

#include <nag.h>
void  c09ebc (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)
The function may be called by the names: c09ebc, nag_wav_dim2_sngl_inv or nag_idwt_2d.

3 Description

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

4 References

None.

5 Arguments

1: m Integer Input
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 c09abc.
2: n Integer Input
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 c09abc.
3: ca[dim] const double Input
Note: the dimension, dim, of the array ca must be at least ldca×ncn where ncn is the argument nwcn returned by function c09abc.
The (i,j)th element of the matrix is stored in ca[(j-1)×ldca+i-1].
On entry: contains the ncm×ncn matrix of approximation coefficients, Ca. This array will normally be the result of some transformation on the coefficients computed by function c09eac.
4: ldca Integer Input
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 c09abc.
5: ch[dim] const double Input
Note: the dimension, dim, of the array ch must be at least ldch×ncn where ncn is the argument nwcn returned by function c09abc.
The (i,j)th element of the matrix is stored in ch[(j-1)×ldch+i-1].
On entry: contains the ncm×ncn matrix of horizontal coefficients, Ch. This array will normally be the result of some transformation on the coefficients computed by function c09eac.
6: ldch Integer Input
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 c09abc.
7: cv[dim] const double Input
Note: the dimension, dim, of the array cv must be at least ldcv×ncn where ncn is the argument nwcn returned by function c09abc.
The (i,j)th element of the matrix is stored in cv[(j-1)×ldcv+i-1].
On entry: contains the ncm×ncn matrix of vertical coefficients, Cv. This array will normally be the result of some transformation on the coefficients computed by function c09eac.
8: ldcv Integer Input
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 c09abc.
9: cd[dim] const double Input
Note: the dimension, dim, of the array cd must be at least ldcd×ncn where ncn is the argument nwcn returned by function c09abc.
The (i,j)th element of the matrix is stored in cd[(j-1)×ldcd+i-1].
On entry: contains the ncm×ncn matrix of diagonal coefficients, Cd. This array will normally be the result of some transformation on the coefficients computed by function c09eac.
10: ldcd Integer Input
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 c09abc.
11: b[ldb×n] double Output
Note: the (i,j)th element of the matrix B is stored in b[(j-1)×ldb+i-1].
On exit: the m×n reconstructed matrix, B, based on the input approximation, horizontal, vertical and diagonal coefficients and the transform options supplied to the initialization function c09abc.
12: ldb Integer Input
On entry: the stride separating matrix row elements in the array b.
Constraint: ldbm.
13: icomm[180] const Integer Communication Array
On entry: contains details of the discrete wavelet transform and the problem dimension as setup in the call to the initialization function c09abc.
14: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface 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 c09abc).
On entry, n=value.
Constraint: n=value, the value of n on initialization (see 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 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface 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

Background information to multithreading can be found in the Multithreading documentation.
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 c09eac.