# sopalin_compute_linux.h

Blas interface definition for LINUX/GNU operating systems.

Sensible to those defines : FORCE_DOUBLE - Determine if coefficients are doubles or not.  FORCE_COMPLEX - Determine if coefficients are complex or not.  INT - Defined in common_pastix.h to determine integer type.  CBLAS - Determine if we want to use cblas or not.  DEBUG_NAN - If we want to check for NaN values in BLAS operartions, must be used with DBG_SOPALIN_NAN set to 1.  BLAS_USE_COPY - To use memcpy instead of BLAS copy function.  BLAS_USE_SCAL - To use “by hand” scal macro instead of BLAS one.

#### Authors

 Ramet Pierre ra.nosp@m.met@labr.nosp@m.i.fr Xavier Lacoste lac.nosp@m.oste@labr.nosp@m.i.fr
Summary
 sopalin_compute_linux.h Blas interface definition for LINUX/GNU operating systems. Macros BLAS_INT integer to use in blas calls. BLAS macros Defines to set the correct blas depending on the coefficients type and the set of cblas usage or not. dim_dgeam Macros and Variables SOPALIN_GEAM Computes $b = x \times a + b$. iter iter2 SOPALIN_COPY Copy x vector to y vector. varin SOPALIN_LACPY Equivalent of lacpy form LAPACK with uplo = ‘General’ SOPALIN_SCAL Multiply a vector by a scalar. i varin TRSM Macros SOPALIN_TRSM Solves $A \times X = x \times B$ or $X \times A = x \times B$ depending on s value. Variables varim TRSV Macros and Variables SOPALIN_TRSV Solves a system of linear equation with a triangular matrix. varin SOPALIN_GEMM Computes $c = x \times a \times b + y \times c$. varim GEMV Variables varim AXPY Variables varin varin SYR Variables varin SYRK Variables varin varim

### BLAS_INT

integer to use in blas calls.

### BLAS macros

Defines to set the correct blas depending on the coefficients type and the set of cblas usage or not.

## dim_dgeam

 void dim_dgeam( char * transa, char * transb, INT m, INT n, FLOAT alpha, FLOAT * a, INT lda, FLOAT * b, INT ldb )
Summary
 Macros and Variables SOPALIN_GEAM Computes $b = x \times a + b$. iter iter2 SOPALIN_COPY Copy x vector to y vector. varin SOPALIN_LACPY Equivalent of lacpy form LAPACK with uplo = ‘General’ SOPALIN_SCAL Multiply a vector by a scalar. i varin

### SOPALIN_GEAM

Computes $b = x \times a + b$.

#### Parameters

 i indicates if a needs to be transposed. j indicates if b needs to be transposed. m number of row in a and b. n number of colonnes in a and b. x scalar. a Matrix a. u Stride between 2 columns of a. b Matrix b. v Stride between 2 columns of b.

### iter

 INT iter

### iter2

 INT iter2

### SOPALIN_COPY

Copy x vector to y vector.

Care: if BLAS_USE_COPY is defined, only works with u and v equal to 1.

#### Parameters

 n Size of the vectors. x Source vector u x vector stride between to cefficients. y Destination vector. v y vector stride between to cefficients.

### varin

 BLAS_INT varin

### SOPALIN_LACPY

Equivalent of lacpy form LAPACK with uplo = ‘General’

Care: if BLAS_USE_COPY is defined, only works with lda and ldb equal to 1.

#### Parameters

 m Number of rows to copy n Number of columns to copy A lda-by-n Matrix A lda Leading dimension of A (lda >= m) B Destination ldb-by-n matrix B ldb Leading dimension of B (ldb >= m)

### SOPALIN_SCAL

Multiply a vector by a scalar.

Care: if BLAS_USE_SCAL is defined, only works with u equal to 1.

#### Parameters

 n Size of the vector a Scalar to multiply the vector by. x Vector. u stride between to element of the vector.

 INT i

### varin

 BLAS_INT varin

## TRSM

 extern void TRSM ( char * s, char * p, char * t, char * d, BLAS_INT * m, BLAS_INT * n , FLOAT * x, FLOAT * a, BLAS_INT * u, FLOAT * b, BLAS_INT * v )
Summary
 Macros SOPALIN_TRSM Solves $A \times X = x \times B$ or $X \times A = x \times B$ depending on s value. Variables varim

### SOPALIN_TRSM

Solves $A \times X = x \times B$ or $X \times A = x \times B$ depending on s value.  A is a triangular matrix.

#### Parameters

 s Position of a ‘L’ or ‘l’ for left, ‘R’ or ‘r’ for right. p Indicate if the matrice is upper (‘U’) or lower (‘L’) triangular matrix. t Indicate if user wants to transpose a. d Indicate if diagonal is united (‘U’) or not (‘N’). m Number of lines in b. n Number of columns in b. x Coefficient to multiply right-hand-side by. a a matrix (MxM or NxN depending on s). u Stride for a b b MxN matrix. v Stride for b.

### varim

 BLAS_INT varim

## TRSV

 extern void TRSV( char * , char * , char * , BLAS_INT * , FLOAT * , BLAS_INT * , FLOAT * , BLAS_INT * )
Summary
 Macros and Variables SOPALIN_TRSV Solves a system of linear equation with a triangular matrix. varin SOPALIN_GEMM Computes $c = x \times a \times b + y \times c$. varim

### SOPALIN_TRSV

Solves a system of linear equation with a triangular matrix.

#### Parameters

 p Indicate if the matrix is upper (‘U’) or lower (‘L’) triangular. t Indicate if user wants to transpose (‘T’) the matrix or not (‘N’). d Indicate if the matrix has a united diagonal (‘U’) ot not (‘N’). n Size of the matrix and vector. a Triangular matrix NxN. u Stride for a. b Right-hand-side member. v Stride for b.

### varin

 BLAS_INT varin

### SOPALIN_GEMM

Computes $c = x \times a \times b + y \times c$.

#### Parameters

 i indicate if user wants to transpose a. j indicate if user wants to transpose b. m Number of lines in c and a. n Number of columns in c and b. k Number of lines in b and columns in a. x coefficient for $a \times b$ a $m \times k$ Matrix. u Stride for a. b $k \times n$ Matrix. v Stride for b. y Coefficient for c c $m \times n$ matrix. w Stride for c

### varim

 BLAS_INT varim

## GEMV

 extern void GEMV( char * , BLAS_INT * , BLAS_INT * , FLOAT*, FLOAT*, BLAS_INT*, FLOAT*, BLAS_INT*, FLOAT*, FLOAT*, BLAS_INT* )
Summary
 Variables varim

### varim

 BLAS_INT varim

## AXPY

 extern void AXPY( BLAS_INT * n , FLOAT * a, FLOAT * x, BLAS_INT * ix, FLOAT * y, BLAS_INT * iy )
Summary
 Variables varin varin

### varin

 BLAS_INT varin

### varin

 BLAS_INT varin

## SYR

 extern void SYR( char * i, BLAS_INT * n , FLOAT * x, FLOAT * a, BLAS_INT * u, FLOAT * b, BLAS_INT * v )
Summary
 Variables varin

### varin

 BLAS_INT varin

## SYRK

 extern void SYRK ( char * i, char * t, BLAS_INT * n, BLAS_INT * k, FLOAT * x, FLOAT * a, BLAS_INT * u, FLOAT * y, FLOAT * b, BLAS_INT * v )
Summary
 Variables varin varim

### varin

 BLAS_INT varin

### varim

 BLAS_INT varim
 void dim_dgeam( char * transa, char * transb, INT m, INT n, FLOAT alpha, FLOAT * a, INT lda, FLOAT * b, INT ldb )
 INT iter
 INT iter2
 BLAS_INT varin
 INT i
 extern void TRSM ( char * s, char * p, char * t, char * d, BLAS_INT * m, BLAS_INT * n , FLOAT * x, FLOAT * a, BLAS_INT * u, FLOAT * b, BLAS_INT * v )
 BLAS_INT varim
 extern void TRSV( char * , char * , char * , BLAS_INT * , FLOAT * , BLAS_INT * , FLOAT * , BLAS_INT * )
 extern void GEMV( char * , BLAS_INT * , BLAS_INT * , FLOAT*, FLOAT*, BLAS_INT*, FLOAT*, BLAS_INT*, FLOAT*, FLOAT*, BLAS_INT* )
 extern void AXPY( BLAS_INT * n , FLOAT * a, FLOAT * x, BLAS_INT * ix, FLOAT * y, BLAS_INT * iy )
 extern void SYR( char * i, BLAS_INT * n , FLOAT * x, FLOAT * a, BLAS_INT * u, FLOAT * b, BLAS_INT * v )
 extern void SYRK ( char * i, char * t, BLAS_INT * n, BLAS_INT * k, FLOAT * x, FLOAT * a, BLAS_INT * u, FLOAT * y, FLOAT * b, BLAS_INT * v )