NAG FL Interface
c09ebf (dim2_​sngl_​inv)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

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

2 Specification

Fortran Interface
Subroutine c09ebf ( m, n, ca, ldca, ch, ldch, cv, ldcv, cd, ldcd, b, ldb, icomm, ifail)
Integer, Intent (In) :: m, n, ldca, ldch, ldcv, ldcd, ldb, icomm(180)
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: ca(ldca,*), ch(ldch,*), cv(ldcv,*), cd(ldcd,*)
Real (Kind=nag_wp), Intent (Inout) :: b(ldb,n)
C Header Interface
#include <nag.h>
void  c09ebf_ (const Integer *m, const Integer *n, const double ca[], const Integer *ldca, const double ch[], const Integer *ldch, const double cv[], const Integer *ldcv, const double cd[], const Integer *ldcd, double b[], const Integer *ldb, const Integer icomm[], Integer *ifail)
The routine may be called by the names c09ebf or nagf_wav_dim2_sngl_inv.

3 Description

c09ebf performs the inverse operation of routine c09eaf. That is, given sets of approximation, horizontal, vertical and diagonal coefficients computed by routine c09eaf using a DWT as set up by the initialization routine c09abf, on a real matrix, B, c09ebf 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 routine c09abf.
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 routine c09abf.
3: ca(ldca,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array ca must be at least ncn where ncn is the argument nwcn returned by routine c09abf.
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 routine c09eaf.
4: ldca Integer Input
On entry: the first dimension of the array ca as declared in the (sub)program from which c09ebf is called.
Constraint: ldcancm where ncm=nct/(4ncn) and ncn, nct are returned by the initialization routine c09abf.
5: ch(ldch,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array ch must be at least ncn where ncn is the argument nwcn returned by routine c09abf.
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 routine c09eaf.
6: ldch Integer Input
On entry: the first dimension of the array ch as declared in the (sub)program from which c09ebf is called.
Constraint: ldchncm where ncm=nct/(4ncn) and ncn, nct are returned by the initialization routine c09abf.
7: cv(ldcv,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array cv must be at least ncn where ncn is the argument nwcn returned by routine c09abf.
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 routine c09eaf.
8: ldcv Integer Input
On entry: the first dimension of the array cv as declared in the (sub)program from which c09ebf is called.
Constraint: ldcvncm where ncm=nct/(4ncn) and ncn, nct are returned by the initialization routine c09abf.
9: cd(ldcd,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array cd must be at least ncn where ncn is the argument nwcn returned by routine c09abf.
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 routine c09eaf.
10: ldcd Integer Input
On entry: the first dimension of the array cd as declared in the (sub)program from which c09ebf is called.
Constraint: ldcdncm where ncm=nct/(4ncn) and ncn, nct are returned by the initialization routine c09abf.
11: b(ldb,n) Real (Kind=nag_wp) array Output
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 routine c09abf.
12: ldb Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which c09ebf is called.
Constraint: ldbm.
13: icomm(180) Integer array Communication Array
On entry: contains details of the discrete wavelet transform and the problem dimension as setup in the call to the initialization routine c09abf.
14: ifail Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or −1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
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.
ifail=2
On entry, ldb=value and m=value.
Constraint: ldbm.
ifail=4
On entry, m=value.
Constraint: m=value, the value of m on initialization (see c09abf).
On entry, n=value.
Constraint: n=value, the value of n on initialization (see c09abf).
ifail=6
Either the initialization routine has not been called first or icomm has been corrupted.
Either the initialization routine was called with wtrans='M' or icomm has been corrupted.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL 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.
c09ebf 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 routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

None.

10 Example

See c09eaf.