version 1.1.1.2, 2000/01/22 14:15:59 |
version 1.1.1.3, 2003/09/15 07:09:25 |
|
|
static char *RCSid = "$Id$"; |
static char *RCSid = "$Id$"; |
#endif |
#endif |
|
|
|
/* NOTICE: Change of Copyright Status |
|
* |
|
* The author of this module, Carsten Grammes, has expressed in |
|
* personal email that he has no more interest in this code, and |
|
* doesn't claim any copyright. He has agreed to put this module |
|
* into the public domain. |
|
* |
|
* Lars Hecking 15-02-1999 |
|
*/ |
|
|
/* |
/* |
* Matrix algebra, part of |
* Matrix algebra, part of |
* |
* |
|
|
double *dp; |
double *dp; |
if( n < 1 ) |
if( n < 1 ) |
return (double *) NULL; |
return (double *) NULL; |
dp = (double *) gp_alloc ( n * sizeof(double), "vec"); |
dp = (double *) gp_alloc (n * sizeof(double), "vec"); |
return dp; |
return dp; |
} |
} |
|
|
|
|
|
|
if ( rows < 1 || cols < 1 ) |
if ( rows < 1 || cols < 1 ) |
return NULL; |
return NULL; |
m = (double **) gp_alloc ( rows * sizeof(double *) , "matrix row pointers"); |
m = (double **) gp_alloc (rows * sizeof(double *) , "matrix row pointers"); |
m[0] = (double *) gp_alloc ( rows * cols * sizeof(double), "matrix elements"); |
m[0] = (double *) gp_alloc (rows * cols * sizeof(double), "matrix elements"); |
for ( i = 1; i<rows ; i++ ) |
for ( i = 1; i<rows ; i++ ) |
m[i] = m[i-1] + cols; |
m[i] = m[i-1] + cols; |
return m; |
return m; |