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
example_zposv.c File Reference

Example of solving a linear system with a Cholesky factorization. More...

#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 dependency graph for example_zposv.c:

Go to the source code of this file.

Functions

int check_solution (int, int, PLASMA_Complex64_t *, int, PLASMA_Complex64_t *, PLASMA_Complex64_t *, int)
int main ()

Variables

int IONE = 1
int ISEED [4] = {0,0,0,1}

Detailed Description

Example of solving a linear system with a Cholesky factorization.

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:
Bilel Hadri
Date:
2010-11-15 normal z -> c d s

Definition in file example_zposv.c.


Function Documentation

int check_solution ( int  N,
int  NRHS,
PLASMA_Complex64_t A1,
int  LDA,
PLASMA_Complex64_t B1,
PLASMA_Complex64_t B2,
int  LDB 
)
int main ( )

Definition at line 32 of file example_zposv.c.

References check_solution(), PLASMA_Finalize(), PLASMA_Init(), PLASMA_zlacpy, PLASMA_zplghe(), PLASMA_zplrnt(), PLASMA_zposv(), PlasmaUpper, and PlasmaUpperLower.

{
int cores = 2;
int N = 10;
int LDA = 10;
int NRHS = 5;
int LDB = 10;
int info;
int info_solution;
PLASMA_Complex64_t *B1 = (PLASMA_Complex64_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *B2 = (PLASMA_Complex64_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)){
printf("Out of Memory \n ");
return EXIT_SUCCESS;
}
/* Plasma Initialize */
PLASMA_Init(cores);
printf("-- PLASMA is initialized to run on %d cores. \n",cores);
/*-------------------------------------------------------------
* TESTING ZPOSV
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix (Hessenberg in the complex case) */
PLASMA_zplghe( (double)N, N, A1, LDA, 51 );
PLASMA_zlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_zplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_zlacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
/* PLASMA ZPOSV */
info = PLASMA_zposv(PlasmaUpper, N, NRHS, A2, LDA, B2, LDB);
/* Check the solution */
info_solution = check_solution(N, NRHS, A1, LDA, B1, B2, LDB);
if ((info_solution != 0)|(info != 0))
printf("-- Error in ZPOSV example ! \n");
else
printf("-- Run of ZPOSV example successful ! \n");
free(A1); free(A2); free(B1); free(B2);
return EXIT_SUCCESS;
}

Here is the call graph for this function:


Variable Documentation

int IONE = 1

Definition at line 29 of file example_zposv.c.

int ISEED[4] = {0,0,0,1}

Definition at line 30 of file example_zposv.c.