PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
testing_zheev.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <plasma.h>
#include <cblas.h>
#include <lapacke.h>
#include <core_blas.h>
#include "testing_zmain.h"
Include dependency graph for testing_zheev.c:

Go to the source code of this file.

Macros

#define COMPLEX

Functions

int testing_zheev (int argc, char **argv)

Detailed Description

PLASMA testing routines PLASMA is a software package provided by Univ. of Tennessee, Univ. of California Berkeley and Univ. of Colorado Denver

Version:
2.4.5
Author:
Hatem Ltaief
Date:
2010-11-15 normal z -> c d s

Definition in file testing_zheev.c.


Macro Definition Documentation

#define COMPLEX

Definition at line 27 of file testing_zheev.c.


Function Documentation

int testing_zheev ( int  argc,
char **  argv 
)

Definition at line 35 of file testing_zheev.c.

References check_orthogonality(), check_solution(), ISEED, lapack_const, min, PLASMA_Alloc_Workspace_zheev(), PLASMA_Dealloc_Handle_Tile(), PLASMA_Enable(), PLASMA_ERRORS, PLASMA_WARNINGS, PLASMA_zheev(), PlasmaDistSymmetric, PlasmaHermGeev, PlasmaLower, PlasmaNoPacking, PlasmaNoVec, PlasmaVec, Q, T, uplo, and USAGE.

{
/* Check for number of arguments*/
if (argc != 2) {
USAGE("HEEV", "N LDA",
" - N : size of the matrix A\n"
" - LDA : leading dimension of the matrix A\n");
return -1;
}
int N = atoi(argv[0]);
int LDA = atoi(argv[1]);
int LDQ = LDA;
int mode = 4;
double eps = LAPACKE_dlamch_work('e');
double dmax = 1.0;
double rcond = 1.0e6;
int info_ortho = 0;
int info_solution = 0;
int info_reduction = 0;
int i;
int LDAxN = LDA*N;
int LDQxN = LDQ*N;
PLASMA_Complex64_t *A1 = NULL;
double *W1 = (double *)malloc(N*sizeof(double));
double *W2 = (double *)malloc(N*sizeof(double));
PLASMA_Complex64_t *work = (PLASMA_Complex64_t *)malloc(3*N* sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A2) || (!W1) || (!W2) ){
printf("Out of Memory \n ");
return -2;
}
/*
PLASMA_Disable(PLASMA_AUTOTUNING);
PLASMA_Set(PLASMA_TILE_SIZE, 120);
PLASMA_Set(PLASMA_INNER_BLOCK_SIZE, 20);
*/
/*----------------------------------------------------------
* TESTING ZHEEV
*/
/* Initialize A1 */
LAPACKE_zlatms_work( LAPACK_COL_MAJOR, N, N,
lapack_const(PlasmaHermGeev), W1, mode, rcond,
dmax, N, N,
lapack_const(PlasmaNoPacking), A2, LDA, work );
/*
* Sort the eigenvalue because when computing the tridiag
* and then the eigenvalue of the DSTQR are sorted.
* So to avoid testing fail when having good results W1 should be sorted
*/
LAPACKE_dlasrt_work( 'I', N, W1 );
if (getenv("PLASMA_TESTING_VERBOSE"))
{
printf("Eigenvalues original\n");
for (i = 0; i < min(N,25); i++){
printf("%f \n", W1[i]);
}
printf("\n");
}
if ( vec == PlasmaVec ) {
Q = (PLASMA_Complex64_t *)malloc(LDQxN*sizeof(PLASMA_Complex64_t));
A1 = (PLASMA_Complex64_t *)malloc(LDAxN*sizeof(PLASMA_Complex64_t));
/* Copy A2 into A1 */
LAPACKE_zlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A2, LDA, A1, LDA);
}
/* PLASMA ZHEEV */
PLASMA_zheev(vec, uplo, N, A2, LDA, W2, T, Q, LDQ);
if (getenv("PLASMA_TESTING_VERBOSE"))
{
printf("Eigenvalues computed\n");
for (i = 0; i < min(N,25); i++){
printf("%f \n", W2[i]);
}
printf("\n");
}
printf("\n");
printf("------ TESTS FOR PLASMA ZHEEV ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Check the orthogonality, reduction and the eigen solutions */
if (vec == PlasmaVec) {
info_ortho = check_orthogonality(N, N, Q, LDQ, eps);
/*
* WARNING: For now, Q is associated to Band tridiagonal reduction and
* not to the final tridiagonal reduction, so we can not call the check
*/
/*info_reduction = check_reduction(uplo, N, 1, A1, A2, LDA, Q, eps);*/
}
info_solution = check_solution(N, W1, W2, eps);
if ( (info_solution == 0) & (info_ortho == 0) & (info_reduction == 0) ) {
printf("***************************************************\n");
printf(" ---- TESTING ZHEEV ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZHEEV ... FAILED !\n");
printf("************************************************\n");
}
free(A2);
free(W1);
free(W2);
free(work);
if (Q != NULL) free(Q);
if (A1 != NULL) free(A1);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: