C H A P T E R  7
 Interval BLAS Routines

## Introduction

This chapter provides a brief overview of an interval Fortran 95 version of the basic linear algebra subroutine (BLAS) library. The interval BLAS version is referred to as the IBLAS library. For a more complete description of the IBLAS library routines, see the white paper Interval Version of the Basic Linear Algebra Subprograms (IBLAS).

For information on the Fortran 95 interfaces and types of arguments used in each IBLAS routine, see the section 3P man pages for the individual routines. For example, to display the man page for the SFFTC routine, type man -s 3P sfftc. Routine names must be lowercase.

For more information on the non-interval version of the BLAS library, see the document Basic Linear Algebra Subprogram Technical (BLAST) Forum Standard, available at http://www.netlib.org/blas/blast-forum/.

 Note - For the Sun Studio Fortran 95 IBLAS routines, information contained in the Interval Version of the Basic Linear Algebra Subprograms (IBLAS) white paper supersedes interval information contained in the Basic Linear Algebra Subprogram Technical (BLAST) Forum Standard document that is available from NetLib.

### Intervals

Intervals have a dual identity as intervals of numbers and as sets of numbers. The empty interval contains no members and is the same as the empty set in the theory of sets. In computer input and output, the empty interval is denoted [empty]. For more information on intrinsic Fortran 95 compiler support for interval data types, see the Fortran 95 Interval Arithmetic Programming Reference and the interval white papers referenced therein.

## IBLAS Routine Names

This section summarizes IBLAS naming conventions derived from the BLAS specification. Language Bindings contains a list of IBLAS routine names organized into the following groups. For the corresponding detailed Fortran language bindings, see the IBLAS man pages or the IBLAS white paper.

As in the BLAS, mathematical operations and routines are grouped into:

New interval-specific routines are grouped into:

• Set Operations on Vectors, listed in TABLE 7-9.
• Set Operations on Matrices, listed in TABLE 7-10.
• Utility Functions of Vectors, listed in TABLE 7-11.
• Utility Functions of Matrices, listed in TABLE 7-12.

### Naming Conventions

Except that the suffix _I or _i is added, IBLAS routines are named the same as the corresponding BLAS routines described in (ref BLAST Standard). IBLAS routine names have the same prefixes as the BLAS routines. Routines with prefixes identify the matrix type. TABLE 7-1 lists the IBLAS prefixes and matrix types.

TABLE 7-1 IBLAS Prefixes and Matrix Types

Prefix

Matrix Type

GE

General

GB

General Banded

SY

Symmetric

SB

Symmetric Banded

SP

Symmetric Packed

TR

Triangular

TB

Triangular Banded

TP

Triangular Packed

As in the BLAS, sparse or complex interval matrices are not treated.

A number of interval-specific, set, and utility IBLAS routines are given new BLAS-style names. See TABLE 7-9 through TABLE 7-12.

## Fortran Interface

The IBLAS Fortran bindings are implemented in a module. Its interface block defines the default interval data type to be TYPE(INTERVAL).

Interval BLAS routines are consistent with regard to:

• Generic interfaces
• Precision
• Rank
• Assumed-shape arrays
• Derived types
• Operator arguments.

Error handling is described in the Basic Linear Algebra Subprogram Technical (BLAST) Forum Standard and in the IBLAS white paper.

Numeric error handling is not required because exceptions are not possible in the closed interval system implemented in the Sun Studio f95 compiler. Argument inconsistency errors are handled as described in IBLAS white paper, the IBLAS man pages, and the BLAST standard.

In general, actual argument shape inconsistencies cause IBLAS routines to return the largest impossible value of -1 for integer indices, a default NaN for REALvalues, and the interval =[ -,+] for computed intervals. The normal BLAS error handling mechanism is also used to communicate actual-parameter errors.

### Binding Format

Each interface is summarized as a SUBROUTINE or FUNCTION statement, in which all the required and optional arguments appear. Optional arguments are grouped in square brackets after the required arguments. Binding format is illustrated with the Scaled Vector Sum Update (AXPBY_I) routine.

SUBROUTINE axpby_i( x, y [, alpha] [,beta] )

TYPE(INTERVAL) (<wp>), INTENT (IN) :: x (:)

TYPE(INTERVAL) (<wp>), INTENT (INOUT) :: y (:)

TYPE(INTERVAL) (<wp>), INTENT (IN), OPTIONAL :: alpha, beta

Because generic interfaces are used, the working precision, denoted <wp> is implicitly defined by the following actual arguments:

<wp> ::= KIND(4) | KIND(8) | KIND(16)

Variables in IBLAS routines are INTEGER, REAL, or TYPE(INTERVAL). See the IBLAS man pages or the IBLAS white pager for individual routine bindings.

### Language Bindings

This section is a brief overview of the IBLAS Fortran routine names and their function. With the one exception of the CANCEL routines, which perform the same operation as the .DSUB. operator in f95, vector and set reductions and operations are the same as in the BLAS. The CANCEL routines and all the vector and matrix set operations and utilities are interval-specific. For interval-specific routines, the f95 equivalent scalar routines are also shown in TABLE 7-3 and TABLE 7-9 through TABLE 7-12. For clarity, lowercase and uppercase Fortran variable names are used to distinguish point from interval types. See TABLE A-11 for an alphabetical list of all the IBLAS routines.

TABLE 7-2 Vector Reductions

Name

Function

DOT_I

Dot Product

NORM_I

Vector Norms

SUM_I

Sum

AMIN_VAL_I

Minimum Absolute Value and Location

AMAX_VAL_I

Maximum Absolute Value and Location

SUMSQ_I

Scaled Sum of Squares and Update

TABLE 7-3 Add or Cancel Vectors

Name

Operation

f95 Equivalent

RSCALE_I

Reciprocally Scale Vector

AXPBY_I

WAXPBY_I

CANCEL_I

Cancel Scaled Vectors and Update

Y = a*X .DSUB. b*Y

WCANCEL_I

Cancel Scaled Vectors

W = a*X .DSUB. b*Y

SUMSQ_I

Scaled Sum of Squares and Update

TABLE 7-4 Vector Movements

Name

Operation

COPY_I

Vector Copy

SWAP_I

Vector Swap

PERMUTE_I

Permute Vector and Update

TABLE 7-5 Matrix-Vector Operations

Name

Operation

{GE,GB}MV_I

General Matrix-Vector Product and Update

{SY,SB,SP}MV_I

Symmetric Matrix-Vector Product and Update

{TR,TB,TP}MV_I

Triangular Matrix-Vector Product and Update

{TR,TB,TP}SV_I

Triangular Matrix Solve and Update

GER_I

General-Matrix Rank-One Update

{SY,SP}R_I

Symmetric-Matrix Rank-One Update

TABLE 7-6 O( n 2 ) Matrix Operations

Name

Operation

{GE, GB, SY, SB, SP, TR, TB, TP}_NORM_I

Matrix Norms

{GE, GB}_DIAG_SCALE_I

Scale General Matrix Rows or Columns and Update

{GE, GB}_LRSCALE_I

Scale General Matrix Rows and Columns and Update

{SY, SB, SP}_LRSCALE_I

Scale Symmetric Matrix Rows and Columns and Update

{GE, GB, SY, SB, SP, TR, TB, TP}_ACC_I

{GE, GB, SY, SB, SP, TR, TB, TP}_ADD_I

TABLE 7-7 O( n 3 ) Matrix Operations

Name

Operation

GEMM_I

General Matrix-Matrix Product and Update

SYMM_I

Symmetric-General Matrix-Matrix Product and Update

TRMM_I

Triangular-General Matrix-Matrix Product and Update

TRSM_I

Triangular Matrix Solve

TABLE 7-8 Matrix Movements

Name

Operation

{GE,GB,SY,SB,SP,TR,TB,TP}_COPY_I

Copy Matrix

GE_TRANS_I

Transpose Matrix

GE_PERMUTE_I

Permute Matrix

TABLE 7-9 Vector Set Operations

Name

Operation

f95 Equivalent

ENCLOSEV_I

Enclose Vector Test

X.SB.Y

INTERIORV_I

Vector Interior Test

X.INT.Y

DISJOINTV_I

Disjoint Vector Test

X.DJ.Y

INTERSECTV_I

Intersect Vectors and Update

Y = X.IX.Y

WINTERSECTV_I

Intersect Vectors

W = X.IX.Y

HULLV_I

Hull of Vectors and Update

Y = X.IH.Y

WHULLV_I

Hull of Vectors

W = X.IH.Y

TABLE 7-10 Matrix Set Operations

Prefix

Name

Operation

f95 Equivalent

ENCLOSEM_I

Enclose Matrix Test

A.SB.B

INTERIORM_I

Matrix Interior Test

A.INT.B

DISJOINTM_I

Disjoint Matrix Test

A.DJ.B

{GE, GB, SY, SB, SP, TR, TB, TP}_

INTERSECTM_I

Intersect Matrices and Update

B = X.IX.B

WINTERSECTM_I

Intersect Matrices

W = X.IX.B

HULLM_I

Hull of Matrices and Update

B = X.IH.B

WHULLM_I

Hull of Matrices

W = X.IH.B

Note: Prefix depends upon matrix type and applies to all routine names in this table.

TABLE 7-11 Vector Utilities

Name

Operation

f95 Equivalent

EMPTYV_I

Empty Vector Element Test and Location

ISEMPTY(X)

INFV_I

Vector Infimum

v = INF(X)

SUPV_I

Vector Supremum

v = SUP(X)

MIDV_I

Vector Midpoint

v = MID(X)

WIDTHV_I

Vector Width

v = WID(X)

INTERVALV_I

Vector Type Conversion to Interval

X = INTERVAL(u,v)

TABLE 7-12 Matrix Utilities

Prefix

Name

Operation

f95 Equivalent

EMPTYM_I

Empty Matrix Element Test and Location

ISEMPTY(A)

INFM_I

Matrix Infimum

c = INF(A)

{GE, GB, SY, SB, SP, TR, TB, TP}_

SUPM_I

Matrix Supremum

c = SUP(A)

MIDM_I

Matrix Midpoint

c = MID(A)

WIDTHM_I

Matrix Width

c = WID(A)

INTERVALM_I

Matrix Type Conversion to Interval

A = INTERVAL(b,c)

Note: Prefix depends upon matrix type and applies to all routine names in this table.

### References

The following white paper is available online. See the Interval Arithmetic readme for the location of this file.

"Interval Version of the Basic Linear Algebra Subprograms Standard (IBLAS)," derived by G.W. Walster from the draft INTERVAL BLAS Chapter 5 prepared by Chenyi Hu, et. al., to be included in the Basic Linear Algebra Subprogram Technical (BLAST) Forum Standard.