Skip to content

Commit

Permalink
memory.c: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin PELLEMOINE committed May 23, 2024
1 parent 65858d8 commit 98d9d8d
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions src/cpp/meschach/mesch12a/src/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
static char rcsid[] = "$Id: memory.c,v 1.13 1994/04/05 02:10:37 des Exp $";

/* m_get -- gets an mxn matrix (in MAT form) by dynamic memory allocation */
MAT *m_get(m,n)
int m,n;
MAT *m_get(int m, int n)
{
MAT *matrix;
int i;
Expand Down Expand Up @@ -90,8 +89,7 @@ int m,n;

/* px_get -- gets a PERM of given 'size' by dynamic memory allocation
-- Note: initialized to the identity permutation */
PERM *px_get(size)
int size;
PERM *px_get(int size)
{
PERM *permute;
int i;
Expand Down Expand Up @@ -121,8 +119,7 @@ int size;

/* v_get -- gets a VEC of dimension 'dim'
-- Note: initialized to zero */
VEC *v_get(size)
int size;
VEC *v_get(int size)
{
VEC *vector;

Expand Down Expand Up @@ -150,8 +147,7 @@ int size;
}

/* m_free -- returns MAT & asoociated memory back to memory heap */
int m_free(mat)
MAT *mat;
int m_free(MAT *mat)
{
#ifdef SEGMENTED
int i;
Expand Down Expand Up @@ -197,8 +193,7 @@ MAT *mat;


/* px_free -- returns PERM & asoociated memory back to memory heap */
int px_free(px)
PERM *px;
int px_free(PERM *px)
{
if ( px==(PERM *)NULL || (int)(px->size) < 0 )
/* don't trust it */
Expand Down Expand Up @@ -227,8 +222,7 @@ PERM *px;


/* v_free -- returns VEC & asoociated memory back to memory heap */
int v_free(vec)
VEC *vec;
int v_free(VEC *vec)
{
if ( vec==(VEC *)NULL || (int)(vec->dim) < 0 )
/* don't trust it */
Expand Down Expand Up @@ -258,9 +252,7 @@ VEC *vec;

/* m_resize -- returns the matrix A of size new_m x new_n; A is zeroed
-- if A == NULL on entry then the effect is equivalent to m_get() */
MAT *m_resize(A,new_m,new_n)
MAT *A;
int new_m, new_n;
MAT *m_resize(MAT *A, int new_m, int new_n)
{
int i;
int new_max_m, new_max_n, new_size, old_m, old_n;
Expand Down Expand Up @@ -395,9 +387,7 @@ int new_m, new_n;

/* px_resize -- returns the permutation px with size new_size
-- px is set to the identity permutation */
PERM *px_resize(px,new_size)
PERM *px;
int new_size;
PERM *px_resize(PERM *px, int new_size)
{
int i;

Expand Down Expand Up @@ -437,9 +427,7 @@ int new_size;

/* v_resize -- returns the vector x with dim new_dim
-- x is set to the zero vector */
VEC *v_resize(x,new_dim)
VEC *x;
int new_dim;
VEC *v_resize(VEC *x, int new_dim)
{

if (new_dim < 0)
Expand Down

0 comments on commit 98d9d8d

Please sign in to comment.