Bug fixing. Added externs for memory allocation functions and fixed SMPcDProd code.

This commit is contained in:
pnenzi 2003-08-23 19:49:03 +00:00
parent 397d46f977
commit 858f0442eb
4 changed files with 13 additions and 12 deletions

View File

@ -59,8 +59,10 @@
* Matrix type and macro definitions for the sparse matrix routines.
*/
#include <assert.h>
#include <stdlib.h>
#define spINSIDE_SPARSE
#include "spconfig.h"
#include "spmatrix.h"
#include "spdefs.h"
@ -69,9 +71,6 @@
#endif /* PARALLEL_ARCH */
/*
* Function declarations
*/

View File

@ -368,7 +368,11 @@ typedef struct
/* Allocation */
#define ALLOC(type,number) ((type *)tmalloc((unsigned)(sizeof(type)*(number))))
extern void * tmalloc(size_t);
extern void * txfree(void *);
extern void * trealloc(void *, size_t);
#define ALLOC(type,number) ((type *)tmalloc((size_t)(sizeof(type)*(number))))
#define REALLOC(ptr,type,number) \
ptr = (type *)trealloc((char *)ptr,(unsigned)(sizeof(type)*(number)))
#define FREE(ptr) { if ((ptr) != NULL) txfree((char *)(ptr)); (ptr) = NULL; }

View File

@ -46,6 +46,7 @@
* Matrix type and macro definitions for the sparse matrix routines.
*/
#include <assert.h>
#include <stdlib.h>
#define spINSIDE_SPARSE
#include "spconfig.h"

View File

@ -95,16 +95,13 @@
*/
#include <config.h>
#include <assert.h>
#include <stdio.h>
#include <math.h>
#include <spmatrix.h>
#include "spdefs.h"
#include <smpdefs.h>
static void LoadGmin(SMPmatrix *eMatrix, double Gmin);
@ -358,14 +355,14 @@ SMPcDProd(SMPmatrix *Matrix, SPcomplex *pMantissa, int *pExponent)
y = z;
*pExponent = x + y;
x = scalb(re, (int) -y);
z = scalb(im, (int) -y);
x = scalbn(re, (int) -y);
z = scalbn(im, (int) -y);
#ifdef debug_print
printf(" ** values are: re %g, im %g, y %g, re' %g, im' %g\n",
re, im, y, x, z);
#endif
pMantissa->real = scalb(re, (int) -y);
pMantissa->imag = scalb(im, (int) -y);
pMantissa->real = scalbn(re, (int) -y);
pMantissa->imag = scalbn(im, (int) -y);
#ifdef debug_print
printf("Determinant 10->2: (%20g,%20g)^%d\n", pMantissa->real,