-
Notifications
You must be signed in to change notification settings - Fork 1
/
Check.h
59 lines (45 loc) · 2.6 KB
/
Check.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/** ***************************************************** **/
/** ** Phonon Vibration Analysis ** **/
/** **/
/** ** Version 2 ** **/
/** **/
/** By: Pedro Brandimarte (brandimarte@gmail.com) and **/
/** Alexandre Reily Rocha (reilya@ift.unesp.br) **/
/** **/
/** ***************************************************** **/
/** Interface for alternative calls of well known **/
/** functions from 'stdio.h' and 'stdlib.h', and also **/
/** functions from 'LAPACK' package, to avoid code **/
/** repetition when checking errors. **/
/** ***************************************************** **/
/* Calls Lapack rotine 'dsyevd' for computing all eigenvalues and */
/* eigenvectors of a real symmetric matrix and checks if it succeeds. */
void CHECKdsyevd (int n, double *M, double *eigval);
/* Calls Lapack rotine 'dgetrf' for triangular */
/* matrix factorization and checks if it succeeds. */
void CHECKdgetrf (int n, double *M, int *ipiv);
/* Calls Lapack rotine 'dgetri' for computing the */
/* inverse matrix and checks if it succeeds. */
void CHECKdgetri (int n, double *M, int *ipiv);
/* Allocates a block of bytes if there are */
/* enough memory, otherwise exits the program. */
void *CHECKmalloc (unsigned int nbytes);
/* Change the size of a block of bytes if there */
/* are enough memory or exits the program. */
void *CHECKrealloc (void *ptr1, unsigned int nbytes);
/* Opens the file named 'filename' in order to */
/* execute a 'mode' operation and verifies error. */
FILE *CHECKfopen (const char *filename, const char *mode);
/* Verifies the returned value of a call to the */
/* 'fclose' function to close the file 'filename'. */
void CHECKfclose (int info, const char *filename);
/* Verifies the returned value of a call to the 'fscanf' */
/* function to read data from the file named 'filename'. */
void CHECKfscanf (int info, const char *filename);
/* Verifies the returned value of a call to the 'sscanf' */
/* function to read 'nvar' variables from an string 'str'. */
void CHECKsscanf (int info, int nvar, char *str);
/* Verifies the returned value of a call to the 'fread' function */
/* to read 'count' blocks of data from the file named 'filename'. */
void CHECKfread (unsigned int info, unsigned int count, const char *filename);
/* ************************ Drafts ************************* */