From 716c7a821a76e65bff30d0292095c585e37c3ac0 Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Fri, 17 May 2019 17:30:07 +0530 Subject: fix compilation warnings --- src/c/linearAlgebra/sva/dsvaa.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/c/linearAlgebra/sva') diff --git a/src/c/linearAlgebra/sva/dsvaa.c b/src/c/linearAlgebra/sva/dsvaa.c index 691694e4..6c9d95e1 100644 --- a/src/c/linearAlgebra/sva/dsvaa.c +++ b/src/c/linearAlgebra/sva/dsvaa.c @@ -17,6 +17,8 @@ #include #include "string.h" #include "matrixTranspose.h" +#include "max.h" +#include "min.h" #define eps 2.22044604925e-16 @@ -30,18 +32,17 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ if(row == 0 && col == 0) return; int i,j; int arow; /*Actual row of given matrix*/ - int acol; /*Actual col of given matrix*/ /* Calculation of svd of a given matrix */ double *U,*S,*V; - U = (double *)malloc((double)row*Min(row,col)*sizeof(double)); - S = (double *)malloc((double)Min(row,col)*Min(row,col)*sizeof(double)); - V = (double *)malloc((double)col*Min(row,col)*sizeof(double)); + U = (double *)malloc((double)row*min(row,col)*sizeof(double)); + S = (double *)malloc((double)min(row,col)*min(row,col)*sizeof(double)); + V = (double *)malloc((double)col*min(row,col)*sizeof(double)); dsvda(0,in1,M,N,1,3,U,S,V); if (ninp == 1){ /* [u,s,v] = sva(A) when input is only matrix */ - tol = Max(row,col)*S[0]*eps; + tol = max(row,col)*S[0]*eps; rk = 0; for(i=0;i tol){ @@ -53,7 +54,7 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ tol = in2; if(tol > 1){ rk = tol; - if(rk > Min(row,col)){ + if(rk > min(row,col)){ printf("ERROR: Wrong value for input argument !"); out1 = NULL; out2 = NULL; @@ -71,20 +72,18 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \ } } arow = M; - acol = Min(M,N); /* Copying, the output in required format */ for(i=0;i