Skip to content

Commit

Permalink
norm.c: prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin PELLEMOINE committed May 23, 2024
1 parent 5019ce5 commit 65858d8
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/cpp/meschach/mesch12a/src/norm.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ static char rcsid[] = "$Id: norm.c,v 1.6 1994/01/13 05:34:35 des Exp $";


/* _v_norm1 -- computes (scaled) 1-norms of vectors */
double _v_norm1(x,scale)
VEC *x, *scale;
double _v_norm1(VEC *x, VEC *scale)
{
int i, dim;
Real s, sum;
Expand All @@ -61,18 +60,15 @@ VEC *x, *scale;
}

/* square -- returns x^2 */
double square(x)
double x;
double square(double x)
{ return x*x; }

/* cube -- returns x^3 */
double cube(x)
double x;
double cube(double x)
{ return x*x*x; }

/* _v_norm2 -- computes (scaled) 2-norm (Euclidean norm) of vectors */
double _v_norm2(x,scale)
VEC *x, *scale;
double _v_norm2(VEC *x, VEC *scale)
{
int i, dim;
Real s, sum;
Expand Down Expand Up @@ -100,8 +96,7 @@ VEC *x, *scale;
#define max(a,b) ((a) > (b) ? (a) : (b))

/* _v_norm_inf -- computes (scaled) infinity-norm (supremum norm) of vectors */
double _v_norm_inf(x,scale)
VEC *x, *scale;
double _v_norm_inf(VEC *x, VEC *scale)
{
int i, dim;
Real s, maxval, tmp;
Expand Down Expand Up @@ -129,8 +124,7 @@ VEC *x, *scale;
}

/* m_norm1 -- compute matrix 1-norm -- unscaled */
double m_norm1(A)
MAT *A;
double m_norm1(MAT *A)
{
int i, j, m, n;
Real maxval, sum;
Expand All @@ -153,8 +147,7 @@ MAT *A;
}

/* m_norm_inf -- compute matrix infinity-norm -- unscaled */
double m_norm_inf(A)
MAT *A;
double m_norm_inf(MAT *A)
{
int i, j, m, n;
Real maxval, sum;
Expand All @@ -177,8 +170,7 @@ MAT *A;
}

/* m_norm_frob -- compute matrix frobenius-norm -- unscaled */
double m_norm_frob(A)
MAT *A;
double m_norm_frob(MAT *A)
{
int i, j, m, n;
Real sum;
Expand Down

0 comments on commit 65858d8

Please sign in to comment.