LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
 All Files Functions Typedefs Macros
lapacke_ssyswapr_work.c File Reference
#include "lapacke_utils.h"
Include dependency graph for lapacke_ssyswapr_work.c:

Go to the source code of this file.

Functions

lapack_int LAPACKE_ssyswapr_work (int matrix_order, char uplo, lapack_int n, float *a, lapack_int i1, lapack_int i2)
 

Function Documentation

lapack_int LAPACKE_ssyswapr_work ( int  matrix_order,
char  uplo,
lapack_int  n,
float *  a,
lapack_int  i1,
lapack_int  i2 
)

Definition at line 36 of file lapacke_ssyswapr_work.c.

38 {
39  lapack_int info = 0;
40  if( matrix_order == LAPACK_COL_MAJOR ) {
41  /* Call LAPACK function and adjust info */
42  LAPACK_ssyswapr( &uplo, &n, a, &i1, &i2 );
43  if( info < 0 ) {
44  info = info - 1;
45  }
46  } else if( matrix_order == LAPACK_ROW_MAJOR ) {
47  float* a_t = NULL;
48  /* Allocate memory for temporary array(s) */
49  a_t = (float*)LAPACKE_malloc( sizeof(float) * n * MAX(1,n) );
50  if( a_t == NULL ) {
52  goto exit_level_0;
53  }
54  /* Transpose input matrices */
55  LAPACKE_ssy_trans( matrix_order, uplo, n, a, n, a_t, n );
56  /* Call LAPACK function and adjust info */
57  LAPACK_ssyswapr( &uplo, &n, a_t, &i1, &i2 );
58  info = 0; /* LAPACK call is ok! */
59  /* Transpose output matrices */
60  LAPACKE_ssy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, n, a, n );
61  /* Release memory and exit */
62  LAPACKE_free( a_t );
63 exit_level_0:
64  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
65  LAPACKE_xerbla( "LAPACKE_ssyswapr_work", info );
66  }
67  } else {
68  info = -1;
69  LAPACKE_xerbla( "LAPACKE_ssyswapr_work", info );
70  }
71  return info;
72 }
void LAPACKE_ssy_trans(int matrix_order, char uplo, lapack_int n, const float *in, lapack_int ldin, float *out, lapack_int ldout)
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void LAPACKE_xerbla(const char *name, lapack_int info)
void LAPACK_ssyswapr(char *uplo, lapack_int *n, float *a, lapack_int *i1, lapack_int *i2)
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
#define MAX(x, y)
Definition: lapacke_utils.h:47
#define LAPACKE_free(p)
Definition: lapacke.h:113
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:123
#define lapack_int
Definition: lapacke.h:47

Here is the call graph for this function:

Here is the caller graph for this function: