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_dsygst.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_dmain.h"
Include dependency graph for testing_dsygst.c:

Go to the source code of this file.

Macros

#define REAL

Functions

int testing_dsygst (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 d Tue Nov 22 14:35:49 2011

Definition in file testing_dsygst.c.


Macro Definition Documentation

#define REAL

Definition at line 27 of file testing_dsygst.c.


Function Documentation

int testing_dsygst ( int  argc,
char **  argv 
)

Definition at line 32 of file testing_dsygst.c.

References check_factorization(), itype, itypestr, PLASMA_dplgsy(), PLASMA_dpotrf(), PLASMA_dsygst(), uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if (argc != 3) {
USAGE("HEGST", "N LDA LDB",
" - N : size of the matrices A and B\n"
" - LDA : leading dimension of the matrix A\n"
" - LDB : leading dimension of the matrix B\n");
return -1;
}
double eps = LAPACKE_dlamch_work('e');
int N = atoi(argv[0]);
int LDA = atoi(argv[1]);
int LDB = atoi(argv[2]);
int info_transformation, info_factorization;
int i, u;
int LDAxN = LDA*N;
int LDBxN = LDB*N;
double *A1 = (double *)malloc(LDAxN*sizeof(double));
double *A2 = (double *)malloc(LDAxN*sizeof(double));
double *B1 = (double *)malloc(LDBxN*sizeof(double));
double *B2 = (double *)malloc(LDBxN*sizeof(double));
double *Ainit = (double *)malloc(LDAxN*sizeof(double));
double *Binit = (double *)malloc(LDBxN*sizeof(double));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Ainit)||(!Binit)){
printf("Out of Memory \n ");
return -2;
}
/*----------------------------------------------------------
* TESTING DSYGST
*/
/* Initialize A1 and A2 */
PLASMA_dplgsy(0., N, A1, LDA, 5198);
LAPACKE_dlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A1, LDA, Ainit, LDA);
/* Initialize B1 and B2 */
PLASMA_dplgsy((double)N, N, B1, LDB, 4231);
LAPACKE_dlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, B1, LDB, Binit, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA DSYGST ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrices A and B are 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");
/*----------------------------------------------------------
* TESTING DSYGST
*/
for (i=0; i<3; i++) {
for (u=0; u<2; u++) {
memcpy(A2, Ainit, LDAxN*sizeof(double));
memcpy(B2, Binit, LDBxN*sizeof(double));
PLASMA_dpotrf(uplo[u], N, B2, LDB);
PLASMA_dsygst(itype[i], uplo[u], N, A2, LDA, B2, LDB);
/* Check the Cholesky factorization and the transformation */
info_factorization = check_factorization(N, B1, B2, LDB, uplo[u], eps);
info_transformation = check_transformation(itype[i], uplo[u], N, A1, A2, LDA, B2, LDB, eps);
if ( (info_transformation == 0) && (info_factorization == 0) ) {
printf("***************************************************\n");
printf(" ---- TESTING DSYGST (%s, %s) ....... PASSED !\n", itypestr[i], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DSYGST (%s, %s) ... FAILED !\n", itypestr[i], uplostr[u]);
printf("************************************************\n");
}
}
}
free(A1);
free(A2);
free(B1);
free(B2);
free(Ainit);
free(Binit);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: