Sun S3L 3.0 Programming and Reference Guide

Chapter 4 Sun S3L Data Types

Data type information is encoded in the S3L array handle for both C and Fortran interfaces and is decoded at run time. This allows appropriate branching to occur during execution, which makes it unnecessary to maintain separate routines with different names for each language interface.

Table 4-1 shows the data types supported for the various Sun S3L routines. Table 4-2 lists the C and Fortran language-specific data type equivalents.

Within each subroutine call, elements of all array arguments must match in data type, unless the argument descriptions indicate otherwise.

Place one of the following include lines at the top of any C or Fortran program unit that makes an S3L call:

C and C++ Programs

#include <s3l/s3l-c.h>

F77 and F90 Programs

include 's3l/s3l-f.h'

Note -

For Sun S3L 2.0, the S3L array handles for the F77 interfaces are of type integer*4 and for Sun S3L 3.0, they are of type integer*8. Therefore, when porting F77 programs from Sun S3L 2.0 to Sun S3L 3.0, be sure to change the array handle data type definitions accordingly. If you want your F77 program to be compatible with both Sun S3L 2.0 and Sun S3L 3.0, you should insert #ifdef statements in appropriate places in the code.


Table 4-1 Array Data Types Supported for C/C++ and F77/F90

Operation 

int 

long integer 

float 

double 

complex 

dcomplex 

2-norm 

 

 

x 

x 

x 

x 

Autocorrelation 

 

 

x 

x 

x 

x 

Convolve 

 

 

x 

x 

x 

x 

Copy array 

x 

x 

x 

x 

x 

x 

Circular shift 

x 

x 

x 

x 

x 

x 

Declare array 

x 

x 

x 

x 

x 

x 

Deconvolve 

 

 

x 

x 

x 

x 

Define array 

x 

x 

x 

x 

x 

x 

Describe array 

x 

x 

x 

x 

x 

x 

Exit 

 

 

 

- N/A - 

 

 

FFT, simple and detailed  

complex-to-complex 

 

 

 

 

x 

x 

FFT, inverse 

 

 

 

 

x 

x 

FFT, simple real-to-complex 

 

 

x 

x 

 

 

FFT, simple complex-to-real 

 

 

x 

x 

 

 

Forall 

x 

x 

x 

x 

x 

x 

Free array handle 

x 

x 

x 

x 

x 

x 

General band solver 

 

 

x 

x 

x 

x 

General iterative solver  

 

 

x 

x 

x 

x 

General least squares 

 

 

x 

x 

x 

x 

General singular value decomposition (SVD) 

 

 

x 

x 

x 

x 

General tridiagonal 

 

 

x 

x 

x 

x 

Get array elements 

x 

x 

x 

x 

x 

x 

Get array attributes 

x 

x 

x 

x 

x 

x 

Grade up/down 

x 

x 

x 

x 

x 

x 

Initialize S3L environment 

 

 

 

- N/A - 

 

 

Inner product 

 

 

x 

x 

x 

x 

LU factor 

 

 

x 

x 

x 

x 

LU solve 

 

 

x 

x 

x 

x 

LU invert 

 

 

x 

x 

x 

x 

Matrix multiplication 

 

 

x 

x 

x 

x 

Matrix vector multiplication 

 

 

x 

x 

x 

x 

Matrix vector sparse 

 

 

x 

x 

x 

x 

Outer product 

 

 

x 

x 

x 

x 

Print array 

x 

x 

x 

x 

x 

x 

Print sparse array 

 

 

x 

x 

x 

x 

Read array 

x 

x 

x 

x 

x 

x 

Read sparse array 

 

 

x 

x 

x 

x 

Reduce 

x 

x 

x 

x 

x 

x 

Reduce axis 

x 

x 

x 

x 

x 

x 

RNG, lagged Fibonacci 

x 

x 

x 

x 

x 

x 

RNG, linear congruential 

x 

x 

x 

x 

x 

x 

RNG, sparse matrix 

 

 

x 

x 

x 

x 

Set array elements 

x 

x 

x 

x 

x 

x 

Set process grid 

 

 

 

- N/A - 

 

 

Set safety 

 

 

 

- N/A - 

 

 

Sort 

x 

x 

x 

x 

 

 

Thread communicator setup 

 

 

 

- N/A - 

 

 

Symmetric eigenvalues, eigenvectors 

 

 

x 

x 

x 

x 

Transpose 

x 

x 

x 

x 

x 

x 

Write array 

x 

x 

x 

x 

x 

x 

Zero elements 

x 

x 

x 

x 

x 

x 

Table 4-2 Equivalent S3L, Fortran, and C Array Data Types

S3L Data Types 

F77/F90 Data Types 

C/C++ Data Types 

S3L_integer

INTEGER*4

int

S3L_long_integer

INTEGER*8

long long

S3L_float

REAL*4

float

S3L_double

REAL*8

double

S3L_complex

COMPLEX*8

typedef struct

   { float real;

     float imag;

   } S3L_cmpx8

S3L_double_complex

COMPLEX*16

typedef struct cmpx16_s

   { float double real;

     float double imag;

   } S3L_cmpx16