Guide and Reference


Use Considerations

This section describes what you use the utility subroutines for.

Determining the Level of ESSL Installed

IESSL gets the level of ESSL and returns it to your program. The level consists of the following: version number, release number, modification number, and number of the most recently installed ESSL PTF. You can use this function to verify that you are running on or using the capabilities of the desired level.

Finding the Optimal Stride(s) for Your Fourier Transforms

STRIDE is used to determine optimal stride values for your Fourier transforms when using any of the Fourier transform subroutines, except _RCFT and _CRFT. You must invoke STRIDE for each optimal stride you want computed. Sometimes you need a separate stride for your input and output data. For the three-dimensional Fourier transforms, you need an optimal stride for both the second and third dimensions of the array. The examples provided for STRIDE explain how it is used for each of the subroutines listed above.

After obtaining the optimal strides from STRIDE, you should arrange your data using these stride values. After the data is set up, call the Fourier transform subroutine. For additional information on how to set up your data, see "Setting Up Your Data".

Converting Sparse Matrix Storage

DSRSM is used to migrate your existing program from sparse matrices stored by rows to sparse matrices stored in compressed-matrix storage mode. This converts the matrices into a storage format that is compatible with the input requirements for some ESSL sparse matrix subroutines, such as DSMMX.

DGKTRN and DSKTRN are used to convert your sparse matrix from one skyline storage mode to another, if necessary, before calling the subroutines DGKFS/DGKFSP or DSKFS/DSKFSP, respectively.

Utility Subroutines

This section contains the utility subroutine descriptions.

EINFO--ESSL Error Information-Handler Subroutine

This subroutine returns information to your program about the data involved in a computational error that occurred in an ESSL subroutine. This is the same information that is provided in the ESSL messages; however, it allows you to check the information in your program at run time and continue processing. You pass the computational error code of interest to this subroutine in icode, and it passes back one or more pieces of information in the output arguments inf1 and, optionally, inf2, as defined in Table 167. You should use this subroutine only for those computational errors listed in the table. It does not apply to computational errors that do not return information.

For multithreaded application programs, if you want the error handling capabilities that this subroutine provides to be implemented on each thread created by your program, this subroutine must be called from each thread. If your application creates multiple threads, the action performed by a call to this subroutine applies to the thread that this subroutine was invoked from. For an example, see "Example of Handling Errors in a Multithreaded Application Program".

Table 167. Computational Error Information Returned by EINFO
Error Code Receiver Type of Information
2100 inf1

inf2

Lower range of a vector

Upper range of a vector

2101 inf1

inf2

Index of the eigenvalue that failed to converge

Number of iterations after which it failed to converge

2102 inf1

inf2

Index of the last eigenvector that failed to converge

Number of iterations after which it failed to converge

2103 inf1 Index of the pivot with zero value
2104 inf1 Index of the last pivot with nonpositive value
2105 inf1 Index of the pivot element near zero causing factorization to fail
2107 inf1

inf2

Index of the singular value that failed to converge

Number of iterations after which it failed to converge

2109 inf1 Iteration count when it was determined that the matrix was not definite
2114 inf1

inf2

Index of the last eigenvalue that failed to converge

Number of iterations after which it failed to converge

2115 inf1 Order of the leading minor that was discovered to have a nonpositive determinant
2117 inf1 Column number for which pivot value was near zero
2118 inf1 Row number for which pivot value was near zero
2120 inf1 Row number of empty row where factorization failed
2121 inf1 Column number of empty column where factorization failed
2126 inf1 Row number for which pivot value was unacceptable
2145 inf1 First diagonal element with zero value

Syntax

Fortran CALL EINFO (icode[, inf1[, inf2]])
C and C++ einfo (icode, inf1, inf2);
PL/I CALL EINFO (icode[, inf1[, inf2]]);

On Entry

icode

has the following meaning, where:

If icode = 0, this indicates that the ESSL error option table is to be initialized. (You specify this value once in the beginning of your program before calls to ERRSET.)

If icode has any of the allowable error code values listed in Table 167, this is the computational error code of interest. (You specify one of these values whenever you want information returned about a computational error.)

Specified as: a fullword integer; icode = 0 or an error code value indicated in Table 167.

inf1

See 'On Return'.

inf2

See 'On Return'.

On Return

inf1

has the following meaning, where:

If icode = 0, this argument is not used in the computation. In this case, inf1 is an optional argument, except in C and C++ programs.

If icode <> 0, then inf1 is the first information receiver, containing numerical information related to the computational error.

Returned as: a fullword integer.

inf2

has the following meaning, where:

If icode = 0, this argument is not used in the computation.

If icode <> 0, then inf2 is the second information receiver, containing numerical information related to the computational error. It should be specified when the error code provides a second piece of information, and you want the information.

In both of these cases, inf2 is an optional argument, except in C and C++ programs. For more details, see "Notes".

Returned as: a fullword integer.

Notes

  1. If icode is not 0 and is not one of the error codes specified in Table 167, this subroutine returns to the caller, and no information is provided in inf1 and inf2.

  2. If there are two pieces of information for the error and you specify one output argument, the second piece of information is not returned to the caller.

  3. If there is one piece of information for the error and you specify two output arguments, the second output argument is not set by this subroutine.

  4. In C and C++ programs you must code the inf1 and inf2 arguments, because they are not optional arguments.

  5. In Fortran programs, inf1 and inf2 are optional arguments. This is an exception to the rule, because other ESSL subroutines do not allow optional arguments.

  6. Examples of how to use EINFO are provided in "Coding Your Program".

ERRSAV--ESSL ERRSAV Subroutine for ESSL

The ERRSAV subroutine copies an ESSL error option table entry into an 8-byte storage area that is accessible to your program.

For multithreaded application programs, if you want the error handling capabilities that this subroutine provides to be implemented on each thread created by your program, this subroutine must be called from each thread. If your application creates multiple threads, the action performed by a call to this subroutine applies to the thread that this subroutine was invoked from. For an example, see "Example of Handling Errors in a Multithreaded Application Program".

Syntax

Fortran CALL ERRSAV (ierno, tabent)
C and C++ errsav (ierno, tabent);
PL/I CALL ERRSAV (ierno, tabent);

On Entry

ierno

is the error number in the option table. The entry for ierno in the ESSL error option table is stored in the 8-byte storage area tabent. Specified as: a fullword integer; ierno must be one of the error numbers in the option table. For a list of these numbers, see Table 26.

tabent

is the storage area where the option table entry is stored. Specified as: an area of storage of length 8-bytes.

Note

Examples of how to use ERRSAV are provided in "Coding Your Program".

ERRSET--ESSL ERRSET Subroutine for ESSL

The ERRSET subroutine allows you to control execution when error conditions occur. It modifies the information in the ESSL error option table for the error number indicated. For a range of error messages, you can specify the following:

For multithreaded application programs, if you want the error handling capabilities that this subroutine provides to be implemented on each thread created by your program, this subroutine must be called from each thread. If your application creates multiple threads, the action performed by a call to this subroutine applies to the thread that this subroutine was invoked from. For an example, see "Example of Handling Errors in a Multithreaded Application Program".

Syntax

Fortran CALL ERRSET (ierno, inoal, inomes, itrace, iusadr, irange)
C and C++ errset (ierno, inoal, inomes, itrace, iusadr, irange);
PL/I CALL ERRSET (ierno, inoal, inomes, itrace, iusadr, irange);

On Entry

ierno

is the error number in the option table. The entry for ierno in the ESSL error option table is updated as indicated by the other arguments. Specified as: a fullword integer; ierno must be one of the error numbers in the option table. For a list of these numbers, see Table 26.

inoal

indicates the number of errors allowed before each execution is terminated, where:

If inoal <= 0, the specification is ignored, and the number-of-errors option is not changed.

If inoal = 1, execution is terminated after one error.

If 2 <= inoal <= 255, then inoal specifies the number of errors allowed before each execution is terminated.

If inoal > 255, an unlimited number of errors is allowed.

Specified as: a fullword integer, where:

If iusadr = ENOTRM, then 2 <= inoal <= 255.

inomes

indicates the number of messages to be printed, where:

If inomes < 0, all messages are suppressed.

If inomes = 0, the number-of-messages option is not changed.

If 0 < inomes <= 255, then inomes specifies the number of messages to be printed.

If inomes > 255, an unlimited number of error messages is allowed.

Specified as: a fullword integer.

itrace

this argument is ignored for ESSL/6000, but must be specified. Specified as: a fullword integer where, itrace = 0, 1, or 2 (for migration purposes).

iusadr

indicates whether or not the ESSL error exit routine is to be invoked, where:

If iusadr = 0, the option table is not altered.

If iusadr = 1, the option table is set to show no exit routine. Therefore, standard corrective action is to be used when continuing execution.

If iusadr = ENOTRM, the option table entry is set to the ESSL error exit routine ENOTRM. Therefore, the ENOTRM subroutine is to be invoked after the occurrence of the indicated errors. (ENOTRM must appear in an EXTERNAL statement in your program.)

Specified as: a fullword integer or the name of a subroutine; iusadr = 0, 1, or ENOTRM.

irange

indicates the range of errors to be updated in the ESSL error option table, where:

If irange < ierno, the parameter is ignored.

If irange >= ierno, the options specified for the other parameters are to be applied to the entire range of error conditions encompassed by ierno and irange.

Specified as: a fullword integer.

Notes

  1. Examples of how to use ERRSET are provided in "Coding Your Program".

  2. If you specify ENOTRM for iusadr, then inoal must be in the following range: 2 <= inoal <= 255.

ERRSTR--ESSL ERRSTR Subroutine for ESSL

The ERRSTR subroutine stores an entry in the ESSL error option table.

For multithreaded application programs, if you want the error handling capabilities that this subroutine provides to be implemented on each thread created by your program, this subroutine must be called from each thread. If your application creates multiple threads, the action performed by a call to this subroutine applies to the thread that this subroutine was invoked from. For an example, see "Example of Handling Errors in a Multithreaded Application Program".

Syntax

Fortran CALL ERRSTR (ierno, tabent)
C and C++ errstr (ierno, tabent);
PL/I CALL ERRSTR (ierno, tabent);

On Entry

ierno

is the error number in the option table. The information in the 8-byte storage area tabent is stored into the entry for ierno in the ESSL error option table. Specified as: a fullword integer; ierno must be one of the error numbers in the option table. For a list of these numbers, see Table 26.

tabent

is the storage area containing the table entry data. Specified as: an area of storage of length 8-bytes.

Note

Examples of how to use ERRSTR are provided in "Coding Your Program".

IESSL--Determine the Level of ESSL Installed

This function returns the level of ESSL installed on your system, where the level consists of a version number, release number, and modification number, plus the fix number of the most recent PTF installed.

Syntax

Fortran CALL IESSL ()
C and C++ iessl ();
PL/I CALL IESSL ();

On Return

Function value

 

is the level of ESSL installed on your system. It is provided as a fullword integer in the form vvrrmmff, where each two digits represents a part of the level:

Returned as: a fullword integer; vvrrmmff > 0.

Notes

  1. To use IESSL effectively, you must install your ESSL PTFs in their proper sequential order. As part of the result, IESSL returns the value ff of the most recent PTF installed, rather than the highest number PTF installed. Therefore, if you do not install your PTFs sequentially, the ff value returned by IESSL does not reflect the actual level of ESSL.

  2. Declare the IESSL function in your program as returning a fullword integer value.

Function

The IESSL function enables you to determine the current level of ESSL installed on your system. It is useful to you in those instances where your program is using a subroutine or feature that exists only in certain levels of ESSL. It is also useful when your program is dependent upon certain PTFs being applied to ESSL.

Example

This example shows several ways to use the IESSL function. Most typically, you use IESSL for checking the version and release level of ESSL. Suppose you are dependent on a new capability in ESSL, such as a new subroutine or feature, provided for the first time in ESSL Version 3. You can add the following check in your program before using the new capability:

   IF IESSL() >= 3010000

By specifying 0000 for mmff, the modification and fix level, you are independent of the order in which your modifications and PTFs are installed.

Less typically, you use IESSL for checking the PTF level of ESSL. Suppose you are dependent on PTF 2 being installed on your ESSL Version 3 system. You want to know whether to call a different user-callable subroutine to set up your array data. You can add the following check in your program before making the call:

   IF IESSL() >= 3010002

If your system support group installed the ESSL PTFs in their proper sequential order, this test works properly; otherwise, it is unpredictable.

STRIDE--Determine the Stride Value for Optimal Performance in Specified Fourier Transform Subroutines

This subroutine determines an optimal stride value for you to use for your input or output data when you are computing large row Fourier transforms in any of the Fourier transform subroutines, except _RCFT and _CRFT. The strides determined by this subroutine allow your arrays to fit comfortably in various levels of storage hierarchy on your particular processor, thus allowing you to improve your run-time performance.
Note: This subroutine returns a single stride value. Where you need multiple strides, you must invoke this subroutine multiple times; for example, in the multidimensional Fourier transforms and, also, when input and output data types differ. For more details, see "Function".

Syntax

Fortran CALL STRIDE (n, incd, incr, dt, iopt)
C and C++ stride (n, incd, incr, dt, iopt);
PL/I CALL STRIDE (n, incd, incr, dt, iopt);

On Entry

n

is the length n of the Fourier transform for which the optimal stride is being determined. The transform corresponding to n is usually a row transform; that is, the data elements are stored using a stride value.

Specified as: a fullword integer; n > 0.

incd

is the minimum allowable stride for the Fourier transform for which the optimal stride is being determined. For each situation in each subroutine, there is a specific way to compute this minimum value. This is explained in the examples starting on page "Example 1--SCFT".

Specified as: a fullword integer; incd > 0 or incd < 0.

incr

See 'On Return'.

dt

is the data type of the numbers for the Fourier transform for which the optimal stride is being determined, where:

If dt = 'S', the numbers are short-precision real.

If dt = 'D', the numbers are long-precision real.

If dt = 'C', the numbers are short-precision complex.

If dt = 'Z', the numbers are long-precision complex.

Specified as: a single character; dt = 'S', 'D', 'C', or 'Z'.

iopt

is provided only for migration purposes from ESSL Version 1 and is no longer used; however, you must still specify it as a dummy argument. Specified as: a fullword integer; iopt = 0, 1, or 2.

On Return

incr

is the stride that allows you to improve your run-time performance in your Fourier transform computation on your particular processor. In general, this value differs for each processor you are running on.

Returned as: a fullword integer; incr > 0 or incr < 0 and |incr| >= |incd|, where incr has the same sign (+ or -) as incd.

Notes

  1. In your C program, argument incr must be passed by reference.

  2. All subroutines accept lowercase letters for the dt argument.

  3. For each situation in each of the Fourier transform subroutines, there is a specific way to compute the value you should specify for the incd argument. Details on how to compute each of these values is given in the examples starting on page "Example 1--SCFT". See the example corresponding to the Fourier transform subroutine you are using.

  4. Where different data types are specified for the input and output data in your Fourier transform subroutine, you should be careful to indicate the correct data type in the dt argument in this subroutine.

  5. For additional information on how to set up your data, see "Setting Up Your Data".

Function

This subroutine determines an optimal stride, incr, for you to use for your input or output data when computing large row Fourier transforms. The stride value returned by this subroutine is based on the size and structure of your transform data, using:

This information is used in determining the optimal stride for the processor you are currently running on. The stride determined by this subroutine allows your arrays to fit comfortably in various levels of storage hierarchy for that processor, thus giving you the ability to improve your run-time performance.

You get only one stride value returned by this subroutine on each invocation. Therefore, in many instances, you may need to invoke this subroutine multiple times to obtain several stride values to use in your Fourier transform computation:

Where multiple invocations are necessary, they are explained in the examples starting on page "Example 1--SCFT". The examples also explain how to calculate the incd values for each invocation. There are nine examples to cover the Fourier transform subroutines that can use the STRIDE subroutine.

After calling this subroutine and obtaining the optimal stride value, you then set up your input or output array accordingly. This may involve movement of data for input arrays or increasing the sizes of input or output arrays. To accomplish this, you may want to set up a separate subroutine with the stride values passed into it as arguments. You can then dimension your arrays in that subroutine, depending on the values calculated by STRIDE. For additional information on how to set up your data, see "Setting Up Your Data".

Error Conditions

Computational Errors

None

Input-Argument Errors
  1. n <= 0
  2. incd = 0
  3. iopt <> 0, 1, or 2
  4. dt <> S, D, C, or Z

Example 1--SCFT

This example shows the use of the STRIDE subroutine in computing one-dimensional row transforms using the SCFT subroutine.

If inc2x = 1, the input sequences are stored in the transposed form as rows of a two-dimensional array X(INC1X,N). In this case, the STRIDE subroutine helps in determining a good value of inc1x for this array. The required minimum value of inc1x is m, the number of Fourier transforms being computed. To find a good value of inc1x, use STRIDE as follows:

             N  INCD  INCR    DT   IOPT
             |   |     |       |    |
CALL STRIDE( N , M  , INC1X , 'C' , 0  )

Here, the arguments refer to the SCFT subroutine. In the following table, values of inc1x are given (as obtained from the STRIDE subroutine) for some combinations of n and m and for POWER2-P2SC with 64KB level 1 cache using the POWER2 library for ESSL:

     N      M    INC1X
 
     128    64     64
     240    32     32
     240    64     65
     256   256    264
     512    60     60
    1024    64     65

The above example also applies when the output sequences are stored in the transposed form (inc2y = 1). In that case, in the above example, inc1x is replaced by inc1y.

In computing column transforms (inc1x = inc1y = 1), the values of inc2x and inc2y are not very important. For these, any value over the required minimum of n can be used.

Example 2--DCOSF

This example shows the use of the STRIDE subroutine in computing one-dimensional row transforms using the DCOSF subroutine.

If inc2x = 1, the input sequences are stored in the transposed form as rows of a two-dimensional array X(INC1X,N/2+1). In this case, the STRIDE subroutine helps in determining a good value of inc1x for this array. The required minimum value of inc1x is m, the number of Fourier transforms being computed. To find a good value of inc1x, use STRIDE as follows:

              N     INCD  INCR    DT  IOPT
              |      |      |      |    |
CALL STRIDE( N/2+1 , M  , INC1X , 'D' , 0  )

Here, the arguments refer to the DCOSF subroutine. In the following table, values of inc1x are given (as obtained from the STRIDE subroutine) for some combinations of n and m and for POWER2-P2SC with 64KB level 1 cache using the POWER2 library for ESSL:

     N      M    INC1X
 
     128    64     64
     240    32     32
     240    64     64
     256   256    264
     512    60     60
    1024    64     65

The above example also applies when the output sequences are stored in the transposed form (inc2y = 1). In that case, in the above example, inc1x is replaced by inc1y.

In computing column transforms (inc1x = inc1y = 1), the values of inc2x and inc2y are not very important. For these, any value over the required minimum of n/2+1 can be used.

Example 3--DSINF

This example shows the use of the STRIDE subroutine in computing one-dimensional row transforms using the DSINF subroutine.

If inc2x = 1, the input sequences are stored in the transposed form as rows of a two-dimensional array X(INC1X,N/2). In this case, the STRIDE subroutine helps in determining a good value of inc1x for this array. The required minimum value of inc1x is m, the number of Fourier transforms being computed. To find a good value of inc1x, use STRIDE as follows:

              N   INCD  INCR    DT   IOPT
              |    |     |       |    |
CALL STRIDE( N/2 , M  , INC1X , 'D' , 0  )

Here, the arguments refer to the DSINF subroutine. In the following table, values of inc1x are given (as obtained from the STRIDE subroutine) for some combinations of n and m and for POWER2-P2SC with 64KB level 1 cache using the POWER2 library for ESSL:

     N      M    INC1X
 
     128    64     64
     240    32     32
     240    64     64
     256   256    264
     512    60     60
    1024    64     65

The above example also applies when the output sequences are stored in the transposed form (inc2y = 1). In that case, in the above example, inc1x is replaced by inc1y.

In computing column transforms (inc1x = inc1y = 1), the values of inc2x and inc2y are not very important. For these, any value over the required minimum of n/2 can be used.

Example 4--SCFT2

This example shows the use of the STRIDE subroutine in computing two-dimensional transforms using the SCFT2 subroutine.

If inc1y = 1, the two-dimensional output array is stored in the normal form. In this case, the output array can be declared as Y(INC2Y,N2), where the required minimum value of inc2y is n1. The STRIDE subroutine helps in picking a good value of inc2y. To find a good value of inc2y, use STRIDE as follows:

             N   INCD  INCR    DT   IOPT
             |    |     |       |    |
CALL STRIDE( N2 , N1 , INC2Y , 'C' , 0  )

Here, the arguments refer to the SCFT2 subroutine. In the following table, values of inc2y are given (as obtained from the STRIDE subroutine) for some two-dimensional arrays with n1 = n2 and for POWER2-P2SC with 64KB level 1 cache using the POWER2 library for ESSL:

     N1      N2   INC2Y
 
      64     64     64
     128    128    136
     240    240    240
     512    512    520
     840    840    848

If the input array is stored in the normal form (inc1x = 1), the value of inc2x is not important. However, if you want to use the same array for input and output, you should use inc2x = inc2y.

If inc2y = 1, the two-dimensional output array is stored in the transposed form. In this case, the output array can be declared as Y(INC1Y,N1), where the required minimum value of inc1y is n2. The STRIDE subroutine helps in picking a good value of inc1y. To find a good value of inc1y, use STRIDE as follows:

             N   INCD  INCR    DT   IOPT
             |    |     |       |    |
CALL STRIDE( N1 , N2 , INC1Y , 'C' , 0  )

Here, the arguments refer to the SCFT2 subroutine. In the following table, values of inc1y are given (as obtained from the STRIDE subroutine) for some combinations of n1 and n2 and for POWER2-P2SC with 64K level 1 cache using the POWER2 library for ESSL:

     N1     N2   INC1Y
 
     60     64     64
    120    128    136
    256    240    240
    512    512    520
    840    840    848

If the input array is stored in the transposed form (inc2x = 1), the value of inc1x is also important. The above example can be used to find a good value of inc1x, by replacing inc1y with inc1x. If both arrays are stored in the transposed form, a good value for inc1y is also a good value for inc1x. In that situation, the two arrays can also be made equivalent.

Example 5--SRCFT2

This example shows the use of the STRIDE subroutine in computing two-dimensional transforms using the SRCFT2 subroutine.

For this subroutine, the output array is declared as Y(INC2Y,N2), where the required minimum value of inc2y is n1/2+1. The STRIDE subroutine helps in picking a good value of inc2y. To find a good value of inc2y, use STRIDE as follows:

             N      INCD     INCR    DT   IOPT
             |        |        |      |    |
CALL STRIDE( N2 , N1/2 + 1 , INC2Y , 'C' , 0  )

Here, the arguments refer to the SRCFT2 subroutine. In the following table, values of inc2y are given (as obtained from the STRIDE subroutine) for some two-dimensional arrays with n1 = n2 and for POWER2-P2SC with 64KB level 1 cache using the POWER2 library for ESSL:

     N1      N2    INC2Y
 
     240     240    121
     420     420    211
     512     512    257
     840     840    421
    1024    1024    513
    2048    2048   1032

For this subroutine, the leading dimension of the input array (inc2x) is not important. If you want to use the same array for input and output, you should use inc2x >= 2(inc2y).

Example 6--SCRFT2

This example shows the use of the STRIDE subroutine in computing two-dimensional transforms using the SCRFT2 subroutine.

For this subroutine, the output array is declared as Y(INC2Y,N2), where the required minimum value of inc2y is n1+2. The STRIDE subroutine helps in picking a good value of inc2y. To find a good value of inc2y, use STRIDE as follows:

             N     INCD    INCR    DT   IOPT
             |       |       |      |    |
CALL STRIDE( N2 , N1 + 2 , INC2Y , 'S' , 0  )

Here, the arguments refer to the SCRFT2 subroutine. In the following table, values of inc2y are given (as obtained from the STRIDE subroutine) for some two-dimensional arrays with n1 = n2 and for POWER2-P2SC with 64KB level 1 cache using the POWER2 library for ESSL:

     N1      N2    INC2Y
 
     240     240    242
     420     420    422
     512     512    514
     840     840    842
     1024   1024   1026
     2048   2048   2064

For this subroutine, the leading dimension of the input array (inc2x) is also important. In general, inc2x = inc2y/2 is a good choice. This is also the requirement if you want to use the same array for input and output.

Example 7--SCFT3

This example shows the use of the STRIDE subroutine in computing three-dimensional transforms using the SCFT3 subroutine.

For this subroutine, the strides for the input array are not important. They are important for the output array. The STRIDE subroutine helps in picking good values of inc2y and inc3y. This requires two calls to the STRIDE subroutine as shown below. First, you should find a good value for inc2y. The minimum acceptable value for inc2y is n1.

             N   INCD  INCR    DT   IOPT
             |    |      |      |    |
CALL STRIDE( N2 , N1 , INC2Y , 'C' , 0  )

Here, the arguments refer to the SCFT3 subroutine. Next, you should find a good value for inc3y. The minimum acceptable value for inc3y is (n2)(inc2y).

             N      INCD    INCR    DT   IOPT
             |       |        |      |    |
CALL STRIDE( N3 , N2*INC2Y, INC3Y , 'C' , 0  )

If inc3y turns out to be a multiple of inc2y, then Y can be declared a three-dimensional array as Y(INC2Y,INC3Y/INC2Y,N3). For large problems, this may not happen. In that case, you can declare the Y array as a two-dimensional array Y(0:INC3Y-1,0:N3-1) or a one-dimensional array Y(0:INC3Y*N3-1). Using zero-based indexing, the element y(k1,k2,k3) is stored in the following location in these arrays:

In the following table, values of inc2y and inc3y are given (as obtained from the STRIDE subroutine) for some three-dimensional arrays with n1 = n2 = n3 and for POWER2-P2SC with 64KB level 1 cache using the POWER2 library for ESSL:

  N1,N2,N3    INC2Y    INC3Y
 
     30         30       900
     32         32      1032
     64         64      4112
    120        120     14400
    128        136     17416
    240        240     57608
    256        264     67592
    420        420    176400

As mentioned before, the strides of the input array are not important. The array can be declared as a three-dimensional array. If you want to use the same array for input and output, the requirements are inc2x >= inc2y and inc3x >= inc3y. A simple thing to do is to use inc2x = inc2y and make inc3x a multiple of inc2x not smaller than inc3y. Then X can be declared as a three-dimensional array X(INC2X,INC3X/INC2X,N3).

Example 8--SRCFT3

This example shows the use of the STRIDE subroutine in computing three-dimensional transforms using the SRCFT3 subroutine.

For this subroutine, the strides for the input array are not important. They are important for the output array. The STRIDE subroutine helps in picking good values of inc2y and inc3y. This requires two calls to the STRIDE subroutine as shown below. First, you should find a good value for inc2y. The minimum acceptable value for inc2y is n1/2+1.

             N       INCD    INCR    DT   IOPT
             |        |        |      |    |
CALL STRIDE( N2 , N1/2 + 1 , INC2Y , 'C' , 0  )

Here, the arguments refer to the SRCFT3 subroutine. Next, you should find a good value for inc3y. The minimum acceptable value for inc3y is (n2)(inc2y).

             N      INCD     INCR    DT   IOPT
             |       |         |      |    |
CALL STRIDE( N3 , N2*INC2Y , INC3Y , 'C' , 0  )

If inc3y turns out to be a multiple of inc2y, then Y can be declared a three-dimensional array as Y(INC2Y,INC3Y/INC2Y,N3). For large problems, this may not happen. In that case, you can declare the Y array as a two-dimensional array Y(0:INC3Y-1,0:N3-1) or a one-dimensional array Y(0:INC3Y*N3-1). Using zero-based indexing, the element y(k1,k2,k3) is stored in the following location in these arrays:

In the following table, values of inc2y and inc3y are given (as obtained from the STRIDE subroutine) for some three-dimensional arrays with n1 = n2 = n3 and for POWER2-P2SC with 64KB level 1 cache using the POWER2 library for ESSL:

  N1,N2,N3   INC2Y      INC3Y
 
     32        17         544
     64        33        2112
    120        61        7320
    128        65        8328
    240       121       29064
    256       129       33032

As mentioned before, the strides of the input array are not important. The array can be declared as a three-dimensional array. If you want to use the same array for input and output, the requirements are inc2x >= 2(inc2y) and inc3x >= 2(inc3y). A simple thing to do is to use inc2x = 2(inc2y) and make inc3x a multiple of inc2x not smaller than 2(inc3y). Then X can be declared as a three-dimensional array X(INC2X,INC3X/INC2X,N3).

Example 9--SCRFT3

This example shows the use of the STRIDE subroutine in computing three-dimensional transforms using the SCRFT3 subroutine.

The STRIDE subroutine helps in picking good values of inc2y and inc3y. This requires two calls to the STRIDE subroutine as shown below. First, you should find a good value for inc2y. The minimum acceptable value for inc2y is n1+2.

             N     INCD    INCR    DT   IOPT
             |       |       |      |    |
CALL STRIDE( N2 , N1 + 2 , INC2Y , 'S' , 0  )

Here, the arguments refer to the SCRFT3 subroutine. Next, you should find a good value for inc3y. The minimum acceptable value for inc3y is (n2)(inc2y).

             N      INCD     INCR    DT   IOPT
             |        |        |      |    |
CALL STRIDE( N3 , N2*INC2Y , INC3Y , 'S' , 0  )

If inc3y turns out to be a multiple of inc2y, then Y can be declared a three-dimensional array as Y(INC2Y,INC3Y/INC2Y,N3). For large problems, this may not happen. In that case, you can declare the Y array as a two-dimensional array Y(0:INC3Y-1,0:N3-1) or a one-dimensional array Y(0:INC3Y*N3-1). Using zero-based indexing, the element y(k1,k2,k3) is stored in the following location in these arrays:

In the following table, values of inc2y and inc3y are given (as obtained from the STRIDE subroutine) for some three-dimensional arrays with n1 = n2 = n3 and for POWER2-P2SC with 64KB level 1 cache using the POWER2 library for ESSL:

  N1,N2,N3    INC2Y     INC3Y
 
     32         34       1088
     64         66       4224
    120        122      14640
    128        130      16656
    240        242      58128
    256        258      66064

For this subroutine, the strides (inc2x and inc3x) of the input array are also important. In general, inc2x = inc2y/2 and inc3x = inc3y/2 are good choices. These are also the requirement if you want to use the same array for input and output.

DSRSM--Convert a Sparse Matrix from Storage-by-Rows to Compressed-Matrix Storage Mode

This subroutine converts either m by n general sparse matrix A or symmetric sparse matrix A of order n from storage-by-rows to compressed-matrix storage mode, where matrix A contains long-precision real numbers.

Syntax

Fortran CALL DSRSM (iopt, ar, ja, ia, m, nz, ac, ka, lda)
C and C++ dsrsm (iopt, ar, ja, ia, m, nz, ac, ka, lda);
PL/I CALL DSRSM (iopt, ar, ja, ia, m, nz, ac, ka, lda);

On Entry

iopt

indicates the storage variation used for sparse matrix A storage-by-rows:

If iopt = 0, matrix A is a general sparse matrix, where all the nonzero elements in matrix A are used to set up the storage arrays.

If iopt = 1, matrix A is a symmetric sparse matrix, where only the upper triangle and diagonal elements are used to set up the storage arrays.

Specified as: a fullword integer; iopt = 0 or 1.

ar

is the sparse matrix A, stored by rows in an array, referred to as AR. The iopt argument indicates the storage variation used for storing matrix A. Specified as: a one-dimensional array, containing long-precision real numbers. The number of elements, ne, in this array can be determined by subtracting 1 from the value in IA(m+1).

ja

is the array, referred to as JA, containing the column numbers of each nonzero element in sparse matrix A. Specified as: a one-dimensional array, containing fullword integers; 1 <= (JA elements) <= n. The number of elements, ne, in this array can be determined by subtracting 1 from the value in IA(m+1).

ia

is the row pointer array, referred to as IA, containing the starting positions of each row of matrix A in array AR and one position past the end of array AR. Specified as: a one-dimensional array of (at least) length m+1, containing fullword integers; IA(i+1) >= IA(i) for i = 1, m+1.

m

is the number of rows in sparse matrix A. Specified as: a fullword integer; m >= 0.

nz

is the number of columns in output arrays AC and KA that are available for use. Specified as: a fullword integer; nz > 0.

ac

See 'On Return'.

ka

See 'On Return'.

lda

is the size of the leading dimension of the arrays specified for ac and ka. Specified as: a fullword integer; 0 < lda <= m.

On Return

nz

is the maximum number of nonzero elements, nz, in each row of matrix A, which is stored in compressed-matrix storage mode. Returned as: a fullword integer; (input argument) nz <= (output argument) nz.

ac

is the m by n general sparse matrix A or symmetric matrix A of order n stored in compressed-matrix storage mode in an array, referred to as AC. Returned as: an lda by at least (input argument) nz array, containing long-precision real numbers, where only the first (output argument) nz columns are used to store the matrix.

ka

is the array, referred to as KA, containing the column numbers of the matrix A elements that are stored in the corresponding positions in array AC. Returned as: an lda by at least (input argument) nz array, containing fullword integers, where only the first (output argument) nz columns are used to store the column numbers.

Notes

  1. In your C program, argument nz must be passed by reference.

  2. The value specified for input argument nz should be greater than or equal to the number of nonzero elements you estimate to be in each row of sparse matrix A. The value returned in output argument nz corresponds to the nz value defined for compressed-matrix storage mode. This value is less than or equal to the value specified for input argument nz.

  3. For a description of the storage modes for sparse matrices, see "Compressed-Matrix Storage Mode" and "Storage-by-Rows".

Function

A sparse matrix A is converted from storage-by-rows (using arrays AR, JA, and IA) to compressed-matrix storage mode (using arrays AC and KA). The argument iopt indicates whether the input matrix A is stored by rows using the storage variation for general sparse matrices or for symmetric sparse matrices. See reference [67].

This subroutine is meant for existing programs that need to convert their sparse matrices to a storage mode compatible with some of the ESSL sparse matrix subroutines, such as DSMMX.

Error Conditions

Computational Errors

None

Input-Argument Errors
  1. iopt <> 0 or 1
  2. m < 0
  3. lda < 1
  4. lda < m
  5. nz <= 0
  6. IA(m+1) < 1
  7. IA(i+1)-IA(i) < 0, for any i = 1, m
  8. nz is too small to store matrix A in array AC, where:

Example 1

This example shows a general sparse matrix A, which is stored by rows and converted to compressed-matrix storage mode, where sparse matrix A is:

                    *                        *
                    | 11.0   0.0   0.0  14.0 |
                    |  0.0  22.0   0.0  24.0 |
                    |  0.0   0.0  33.0  34.0 |
                    |  0.0   0.0   0.0  44.0 |
                    *                        *

Because there is a maximum of only two nonzero elements in each row of A, and argument nz is specified as 5, columns 3 through 5 of arrays AC and KA are not used.

Call Statement and Input
           IOPT  AR   JA   IA   M   NZ  AC   KA  LDA
            |    |    |    |    |   |   |    |    |
CALL DSRSM( 0  , AR , JA , IA , 4 , 5 , AC , KA , 4 )
 
AR       =  (11.0, 14.0, 22.0, 24.0, 33.0, 34.0, 44.0)
JA       =  (1, 4, 2, 4, 3, 4, 4)
IA       =  (1, 3, 5, 7, 8)

Output
NZ       =  2
 
        *                     *
        | 11.0  14.0  .  .  . |
AC   =  | 22.0  24.0  .  .  . |
        | 33.0  34.0  .  .  . |
        | 44.0   0.0  .  .  . |
        *                     *
        *               *
        | 1  4  .  .  . |
KA   =  | 2  4  .  .  . |
        | 3  4  .  .  . |
        | 4  4  .  .  . |
        *               *

Example 2

This example shows a symmetric sparse matrix A, which is stored by rows and converted to compressed-matrix storage mode, where sparse matrix A is:

                    *                        *
                    | 11.0   0.0   0.0  14.0 |
                    |  0.0  22.0   0.0  24.0 |
                    |  0.0   0.0  33.0  34.0 |
                    | 14.0  24.0  34.0  44.0 |
                    *                        *

Because there is a maximum of only four nonzero elements in each row of A, and argument nz is specified as 6, columns 5 and 6 of arrays AC and KA are not used.

Call Statement and Input
           IOPT  AR   JA   IA   M   NZ  AC   KA  LDA
            |    |    |    |    |   |   |    |    |
CALL DSRSM( 1  , AR , JA , IA , 4 , 6 , AC , KA , 4 )
 
AR       =  (11.0, 14.0, 22.0, 24.0, 33.0, 34.0, 44.0)
JA       =  (1, 4, 2, 4, 3, 4, 4)
IA       =  (1, 3, 5, 7, 8)

Output
NZ       =  4
 
        *                              *
        | 11.0  14.0   0.0   0.0  .  . |
AC   =  | 22.0  24.0   0.0   0.0  .  . |
        | 33.0  34.0   0.0   0.0  .  . |
        | 44.0  24.0  34.0  14.0  .  . |
        *                              *
        *                  *
        | 1  4  4  4  .  . |
KA   =  | 2  4  4  4  .  . |
        | 3  4  4  4  .  . |
        | 4  2  3  1  .  . |
        *                  *

DGKTRN--For a General Sparse Matrix, Convert Between Diagonal-Out and Profile-In Skyline Storage Mode

This subroutine converts general sparse matrix A of order n from one skyline storage mode to another--that is, between the following:

Syntax

Fortran CALL DGKTRN (n, au, nu, idu, al, nl, idl, itran, aux, naux)
C and C++ dgktrn (n, au, nu, idu, al, nl, idl, itran, aux, naux);
PL/I CALL DGKTRN (n, au, nu, idu, al, nl, idl, itran, aux, naux);

On Entry

n

is the order of general sparse matrix A. Specified as: a fullword integer; n >= 0.

au

is the array, referred to as AU, containing the upper triangular part of general sparse matrix A, stored as follows, where:

If ITRAN(1) = 0, A is stored in diagonal-out skyline storage mode.

If ITRAN(1) = 1, A is stored in profile-in skyline storage mode.

Specified as: a one-dimensional array of (at least) length nu, containing long-precision real numbers.

nu

is the length of array AU. Specified as: a fullword integer; nu >= 0 and nu >= (IDU(n+1)-1).

idu

is the array, referred to as IDU, containing the relative positions of the diagonal elements of matrix A in input array AU. Specified as: a one-dimensional array of (at least) length n+1, containing fullword integers.

al

is the array, referred to as AL, containing the lower triangular part of general sparse matrix A, stored as follows, where:

If ITRAN(1) = 0, A is stored in diagonal-out skyline storage mode.

If ITRAN(1) = 1, A is stored in profile-in skyline storage mode.
Note: Entries in AL for diagonal elements of A are assumed not to have meaningful values.

Specified as: a one-dimensional array of (at least) length nl, containing long-precision real numbers.

nl

is the length of array AL. Specified as: a fullword integer; nl >= 0 and nl >= (IDL(n+1)-1).

idl

is the array, referred to as IDL, containing the relative positions of the diagonal elements of matrix A in input array AL. Specified as: a one-dimensional array of (at least) length n+1, containing fullword integers.

itran

is an array of parameters, ITRAN(i), where:

Specified as: a one-dimensional array of (at least) length 3, containing fullword integers, where:

ITRAN(1) = 0 or 1
ITRAN(2) = 0 or 1
ITRAN(3) = -1 or 1

aux

has the following meaning:

If naux = 0 and error 2015 is unrecoverable, aux is ignored.

Otherwise, it is the storage work area used by this subroutine. Its size is specified by naux.

Specified as: an area of storage, containing naux long-precision real numbers.

naux

is the size of the work area specified by aux--that is, the number of elements in aux. Specified as: a fullword integer, where:

If naux = 0 and error 2015 is unrecoverable, DGKTRN dynamically allocates the work area used by this subroutine. The work area is deallocated before control is returned to the calling program.

Otherwise, naux >= 2n.

On Return

au

is the array, referred to as AU, containing the upper triangular part of general sparse matrix A, stored as follows, where:

If ITRAN(2) = 0, A is stored in diagonal-out skyline storage mode.

If ITRAN(2) = 1, A is stored in profile-in skyline storage mode.

Returned as: a one-dimensional array of (at least) length nu, containing long-precision real numbers.

idu

is the array, referred to as IDU, containing the relative positions of the diagonal elements of matrix A in output array AU. Returned as: a one-dimensional array of (at least) length n+1, containing fullword integers.

al

is the array, referred to as AL, containing the lower triangular part of general sparse matrix A, stored as follows, where:

If ITRAN(2) = 0, A is stored in diagonal-out skyline storage mode.

If ITRAN(2) = 1, A is stored in profile-in skyline storage mode.
Note: You should assume that entries in AL for diagonal elements of A do not have meaningful values.

Returned as: a one-dimensional array of (at least) length nl, containing long-precision real numbers.

idl

is the array, referred to as IDL, containing the relative positions of the diagonal elements of matrix A in output array AL. Returned as: a one-dimensional array of (at least) length n+1, containing fullword integers.

Notes

  1. Your various arrays must have no common elements; otherwise, results are unpredictable.

  2. The ITRAN(3) argument allows you to specify the direction of travel through matrix A that ESSL takes during the transformation. By properly specifying ITRAN(3), you can optimize the performance of the transformation, which is especially beneficial when transforming large matrices.

    The direction specified by ITRAN(3) should be opposite the most recent direction of access through the matrix performed by the DGKFS or DGKFSP subroutine, as indicated in the following table:
    Most Recent Computation Performed by DGKFS/DGKFSP Direction Used by DGKFS/DGKFSP Direction to Specify in ITRAN(3)
    Factor and Solve Negative Positive (ITRAN(3) = 1)
    Factor Only Positive Negative (ITRAN(3) = -1)
    Solve Only Negative Positive (ITRAN(3) = 1)

  3. For a description of how sparse matrices are stored in skyline storage mode, see "Profile-In Skyline Storage Mode" and "Diagonal-Out Skyline Storage Mode".

  4. You have the option of having the minimum required value for naux dynamically returned to your program. For details, see "Using Auxiliary Storage in ESSL".

Function

A general sparse matrix A, stored in diagonal-out or profile-in skyline storage mode is converted to either of these same two storage modes. (Generally, you convert from one to the other, but the capability exists to specify the same storage mode for input and output.) The argument ITRAN(3) indicates the direction in which you want the transformation performed on matrix A, allowing you to optimize your performance in this subroutine. This is especially beneficial for large matrices.

This subroutine is meant to be used in conjunction with DGKFS and DGKFSP, which process matrices stored in these skyline storage modes.

Error Conditions

Resource Errors

Error 2015 is unrecoverable, naux = 0, and unable to allocate work area.

Computational Errors

None

Input-Argument Errors
  1. n < 0
  2. nu < 0
  3. IDU(n+1) > nu+1
  4. IDU(i+1) <= IDU(i) for i = 1, n
  5. IDU(i+1) > IDU(i)+i and ITRAN(1) = 0 for i = 1, n
  6. IDU(i) > IDU(i-1)+i and ITRAN(1) = 1 for i = 2, n
  7. nl < 0
  8. IDL(n+1) > nl+1
  9. IDL(i+1) <= IDL(i) for i = 1, n
  10. IDL(i+1) > IDL(i)+i and ITRAN(1) = 0 for i = 1, n
  11. IDL(i) > IDL(i-1)+i and ITRAN(1) = 1 for i = 2, n
  12. ITRAN(1) <> 0 or 1
  13. ITRAN(2) <> 0 or 1
  14. ITRAN(3) <> -1 or 1
  15. Error 2015 is recoverable or naux<>0, and naux is too small--that is, less than the minimum required value. Return code 1 is returned if error 2015 is recoverable.

Example 1

This example shows how to convert a 9 by 9 general sparse matrix A from diagonal-out skyline storage mode to profile-in skyline storage mode. Matrix A is:

     *                                                      *
     | 11.0  12.0  13.0   0.0   0.0   0.0   0.0   0.0   0.0 |
     | 21.0  22.0  23.0  24.0  25.0   0.0   0.0   0.0  29.0 |
     | 31.0  32.0  33.0  34.0  35.0   0.0  37.0   0.0  39.0 |
     | 41.0  42.0  43.0  44.0  45.0  46.0  47.0   0.0  49.0 |
     |  0.0   0.0   0.0  54.0  55.0  56.0  57.0  58.0  59.0 |
     |  0.0  62.0  63.0  64.0  65.0  66.0  67.0  68.0  69.0 |
     |  0.0   0.0   0.0  74.0  75.0  76.0  77.0  78.0  79.0 |
     |  0.0   0.0   0.0  84.0  85.0  86.0  87.0  88.0  89.0 |
     | 91.0  92.0  93.0  94.0  95.0  96.0  97.0  98.0  99.0 |
     *                                                      *

Assuming that DGKFS last performed a solve on matrix A, the direction of the transformation is positive; that is, ITRAN(3) is 1. This provides the best performance here.
Note: On input and output, the diagonal elements in AL do not have meaningful values.

Call Statement and Input


             N   AU   NU   IDU   AL   NL   IDL   ITRAN   AUX   NAUX
             |   |    |     |    |    |     |      |      |     |
CALL DGKTRN( 9 , AU , 33 , IDU , AL , 35 , IDL , ITRAN , AUX ,  18

AU       =  (11.0, 22.0, 12.0, 33.0, 23.0, 13.0, 44.0, 34.0, 24.0,
             55.0, 45.0, 35.0, 25.0, 66.0, 56.0, 46.0, 77.0, 67.0,
             57.0, 47.0, 37.0, 88.0, 78.0, 68.0, 58.0, 99.0, 89.0,
             79.0, 69.0, 59.0, 49.0, 39.0, 29.0)
IDU      =  (1, 2, 4, 7, 10, 14, 17, 22, 26, 34)
AL       =  ( . , . , 21.0, . , 32.0, 31.0, . , 43.0, 42.0, 41.0, . ,
             54.0, . , 65.0, 64.0, 63.0, 62.0, . , 76.0, 75.0, 74.0,
             . , 87.0, 86.0, 85.0, 84.0, . , 98.0, 97.0, 96.0, 95.0,
             94.0, 93.0, 92.0, 91.0)
IDL      =  (1, 2, 4, 7, 11, 13, 18, 22, 27, 36)
ITRAN    =  (0, 1, 1)

Output
AU       =  (11.0, 12.0, 22.0, 13.0, 23.0, 33.0, 24.0, 34.0, 44.0,
             25.0, 35.0, 45.0, 55.0, 46.0, 56.0, 66.0, 37.0, 47.0,
             57.0, 67.0, 77.0, 58.0, 68.0, 78.0, 88.0, 29.0, 39.0,
             49.0, 59.0, 69.0, 79.0, 89.0, 99.0)
IDU      =  (1, 3, 6, 9, 13, 16, 21, 25, 33, 34)
AL       =  ( . , 21.0, . , 31.0, 32.0, . , 41.0, 42.0, 43.0, . , 54.0,
             . , 62.0, 63.0, 64.0, 65.0, . , 74.0, 75.0, 76.0, . ,
             84.0, 85.0, 86.0, 87.0, . , 91.0, 92.0, 93.0, 94.0, 95.0,
             96.0, 97.0, 98.0, . )
IDL      =  (1, 3, 6, 10, 12, 17, 21, 26, 35, 36)

Example 2

This example shows how to convert the same 9 by 9 general sparse matrix A in Example 1 from profile-in skyline storage mode to diagonal-out skyline storage mode.

Assuming that DGKFS last performed a factorization on matrix A, the direction of the transformation is negative; that is, ITRAN(3) is -1. This provides the best performance here.
Note: On input and output, the diagonal elements in AL do not have meaningful values.

Call Statement and Input


             N   AU   NU   IDU   AL   NL   IDL   ITRAN   AUX   NAUX
             |   |    |     |    |    |     |      |      |     |
CALL DGKTRN( 9 , AU , 33 , IDU , AL , 35 , IDL , ITRAN , AUX ,  18

AU       =(same as output AU in Example 1)
IDU      =(same as output IDU in Example 1)
AL       =(same as output AL in Example 1)
IDL      =(same as output IDL in Example 1)
ITRAN    =  (1, 0, -1)

Output
AU       =(same as input AU in Example 1)
IDU      =(same as input IDU in Example 1)
AL       =(same as input AL in Example 1)
IDL      =(same as input IDL in Example 1)

DSKTRN--For a Symmetric Sparse Matrix, Convert Between Diagonal-Out and Profile-In Skyline Storage Mode

This subroutine converts symmetric sparse matrix A of order n from one skyline storage mode to another--that is, between the following:

Syntax

Fortran CALL DSKTRN (n, a, na, idiag, itran, aux, naux)
C and C++ dsktrn (n, a, na, idiag, itran, aux, naux);
PL/I CALL DSKTRN (n, a, na, idiag, itran, aux, naux);

On Entry

n

is the order of symmetric sparse matrix A. Specified as: a fullword integer; n >= 0.

a

is the array, referred to as A, containing the upper triangular part of symmetric sparse matrix A, stored as follows, where:

If ITRAN(1) = 0, A is stored in diagonal-out skyline storage mode.

If ITRAN(1) = 1, A is stored in profile-in skyline storage mode.

Specified as: a one-dimensional array of (at least) length na, containing long-precision real numbers.

na

is the length of array A. Specified as: a fullword integer; na >= 0 and na >= (IDIAG(n+1)-1).

idiag

is the array, referred to as IDIAG, containing the relative positions of the diagonal elements of matrix A in input array A. Specified as: a one-dimensional array of (at least) length n+1, containing fullword integers.

itran

is an array of parameters, ITRAN(i), where:

Specified as: a one-dimensional array of (at least) length 3, containing fullword integers, where:

ITRAN(1) = 0 or 1
ITRAN(2) = 0 or 1
ITRAN(3) = -1 or 1

aux

has the following meaning:

If naux = 0 and error 2015 is unrecoverable, aux is ignored.

Otherwise, it is the storage work area used by this subroutine. Its size is specified by naux.

Specified as: an area of storage, containing naux long-precision real numbers.

naux

is the size of the work area specified by aux--that is, the number of elements in aux. Specified as: a fullword integer, where:

If naux = 0 and error 2015 is unrecoverable, DSKTRN dynamically allocates the work area used by this subroutine. The work area is deallocated before control is returned to the calling program.

Otherwise, naux >= n.

On Return

a

is the array, referred to as A, containing the upper triangular part of symmetric sparse matrix A, stored as follows, where:

If ITRAN(2) = 0, A is stored in diagonal-out skyline storage mode.

If ITRAN(2) = 1, A is stored in profile-in skyline storage mode.

Returned as: a one-dimensional array of (at least) length na, containing long-precision real numbers.

idiag

is the array, referred to as IDIAG, containing the relative positions of the diagonal elements of matrix A in output array A. Returned as: a one-dimensional array of (at least) length n+1, containing fullword integers.

Notes

  1. Your various arrays must have no common elements; otherwise, results are unpredictable.

  2. The ITRAN(3) argument allows you to specify the direction of travel through matrix A that ESSL takes during the transformation. By properly specifying ITRAN(3), you can optimize the performance of the transformation, which is especially beneficial when transforming large matrices.

    The direction specified by ITRAN(3) should be opposite the most recent direction of access through the matrix performed by the DSKFS or DSKFSP subroutine, as indicated in the following table:
    Most Recent Computation Performed by DSKFS/DSKFSP Direction Used by DSKFS/DSKFSP Direction to Specify in ITRAN(3)
    Factor and Solve Negative Positive (ITRAN(3) = 1)
    Factor Only Positive Negative (ITRAN(3) = -1)
    Solve Only Negative Positive (ITRAN(3) = 1)

  3. For a description of how sparse matrices are stored in skyline storage mode, see "Profile-In Skyline Storage Mode" and "Diagonal-Out Skyline Storage Mode".

  4. You have the option of having the minimum required value for naux dynamically returned to your program. For details, see "Using Auxiliary Storage in ESSL".

Function

A symmetric sparse matrix A, stored in diagonal-out or profile-in skyline storage mode is converted to either of these same two storage modes. (Generally, you convert from one to the other, but the capability exists to specify the same storage mode for input and output.) The argument ITRAN(3) indicates the direction in which you want the transformation performed on matrix A, allowing you to optimize your performance in this subroutine. This is especially beneficial for large matrices.

This subroutine is meant to be used in conjunction with DSKFS and DSKFSP, which process matrices stored in these skyline storage modes.

Error Conditions

Resource Errors

Error 2015 is unrecoverable, naux = 0, and unable to allocate work area.

Computational Errors

None

Input-Argument Errors
  1. n < 0
  2. na < 0
  3. IDIAG(n+1) > na+1
  4. IDIAG(i+1) <= IDIAG(i) for i = 1, n
  5. IDIAG(i+1) > IDIAG(i)+i and ITRAN(1) = 0 for i = 1, n
  6. IDIAG(i) > IDIAG(i-1)+i and ITRAN(1) = 1 for i = 2, n
  7. ITRAN(1) <> 0 or 1
  8. ITRAN(2) <> 0 or 1
  9. ITRAN(3) <> -1 or 1
  10. naux Error 2015 is recoverable or naux<>0, and is too small--that is, less than the minimum required value. Return code 1 is returned if error 2015 is recoverable.

Example 1

This example shows how to convert a 9 by 9 symmetric sparse matrix A from diagonal-out skyline storage mode to profile-in skyline storage mode. Matrix A is:

     *                                                      *
     | 11.0  12.0  13.0  14.0   0.0   0.0   0.0   0.0   0.0 |
     | 12.0  22.0  23.0  24.0  25.0  26.0   0.0  28.0   0.0 |
     | 13.0  23.0  33.0  34.0  35.0  36.0   0.0  38.0   0.0 |
     | 14.0  24.0  34.0  44.0  45.0  46.0   0.0  48.0   0.0 |
     |  0.0  25.0  35.0  45.0  55.0  56.0  57.0  58.0   0.0 |
     |  0.0  26.0  36.0  46.0  56.0  66.0  67.0  68.0  69.0 |
     |  0.0   0.0   0.0   0.0  57.0  67.0  77.0  78.0  79.0 |
     |  0.0  28.0  38.0  48.0  58.0  68.0  78.0  88.0  89.0 |
     |  0.0   0.0   0.0   0.0   0.0  69.0  79.0  89.0  99.0 |
     *                                                      *

Assuming that DSKFS last performed a factorization on matrix A, the direction of the transformation is negative; that is, ITRAN(3) is -1. This provides the best performance here.

Call Statement and Input


             N   A   NA   IDIAG   ITRAN   AUX   NAUX
             |   |   |      |       |      |     |
CALL DSKTRN( 9 , A , 33 , IDIAG , ITRAN , AUX ,  9  )

A        =  (11.0, 22.0, 12.0, 33.0, 23.0, 13.0, 44.0, 34.0, 24.0,
             14.0, 55.0, 45.0, 35.0, 25.0, 66.0, 56.0, 46.0, 36.0,
             26.0, 77.0, 67.0, 57.0, 88.0, 78.0, 68.0, 58.0, 48.0,
             38.0, 28.0, 99.0, 89.0, 79.0, 69.0)
IDIAG    =  (1, 2, 4, 7, 11, 15, 20, 23, 30, 34)
ITRAN    =  (0, 1, -1)

Output
A        =  (11.0, 12.0, 22.0, 13.0, 23.0, 33.0, 14.0, 24.0, 34.0,
             44.0, 25.0, 35.0, 45.0, 55.0, 26.0, 36.0, 46.0, 56.0,
             66.0, 57.0, 67.0, 77.0, 28.0, 38.0, 48.0, 58.0, 68.0,
             78.0, 88.0, 69.0, 79.0, 89.0, 99.0)
IDIAG    =  (1, 3, 6, 10, 14, 19, 22, 29, 33, 34)

Example 2

This example shows how to convert the same 9 by 9 symmetric sparse matrix A in Example 1 from profile-in skyline storage mode to diagonal-out skyline storage mode.

Assuming that DSKFS last performed a solve on matrix A, the direction of the transformation is positive; that is, ITRAN(3) is 1. This provides the best performance here.

Call Statement and Input


             N   A   NA   IDIAG   ITRAN   AUX   NAUX
             |   |   |      |       |      |     |
CALL DSKTRN( 9 , A , 33 , IDIAG , ITRAN , AUX ,  9

A        =(same as output A in Example 1)
IDIAG    =(same as output IDIAG in Example 1)
ITRAN    =  (1, 0, 1)

Output
A        =(same as input A in Example 1)
IDIAG    =(same as input IDIAG in Example 1)


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]