summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/linearAlgebra/sva/dsvaa.c
diff options
context:
space:
mode:
authorSiddhu89902017-07-04 20:09:20 +0530
committerSiddhu89902017-07-04 20:09:20 +0530
commit9981dc71e9478fee921175d300d69fd5ba655dc5 (patch)
treeeb3170cb039ee25a34fb4812d90672af8c16b213 /2.3-1/src/c/linearAlgebra/sva/dsvaa.c
parent0de1d810a20afa0d8a76cecca8d651e7696a86b6 (diff)
parent87a33013355c6367ac01d88c3c945c3b2e8545f6 (diff)
downloadScilab2C-9981dc71e9478fee921175d300d69fd5ba655dc5.tar.gz
Scilab2C-9981dc71e9478fee921175d300d69fd5ba655dc5.tar.bz2
Scilab2C-9981dc71e9478fee921175d300d69fd5ba655dc5.zip
Merge branch 'ukashanoor-master'
Merged after removing bug for dct and idct
Diffstat (limited to '2.3-1/src/c/linearAlgebra/sva/dsvaa.c')
-rw-r--r--2.3-1/src/c/linearAlgebra/sva/dsvaa.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/2.3-1/src/c/linearAlgebra/sva/dsvaa.c b/2.3-1/src/c/linearAlgebra/sva/dsvaa.c
index ee27eef7..b7d07d8c 100644
--- a/2.3-1/src/c/linearAlgebra/sva/dsvaa.c
+++ b/2.3-1/src/c/linearAlgebra/sva/dsvaa.c
@@ -33,14 +33,14 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \
/* 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(in1,M,N,1,3,U,S,V);
+ 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<col;i++){
if(S[i+i*row] > tol){
@@ -52,7 +52,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;
@@ -70,20 +70,20 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \
}
}
arow = M;
- acol = Min(M,N);
+ acol = min(M,N);
for(i=0;i<arow;i++){
for(j=0;j<rk;j++){
out1[i+j*row]=U[i+j*arow];
}
}
- arow = Min(M,N);
+ arow = min(M,N);
for(i=0;i<rk;i++){
for(j=0;j<rk;j++){
out2[i+j*(int)rk] = S[i+j*arow];
}
}
arow = N;
- acol = Min(M,N);
+ acol = min(M,N);
for(i=0;i<arow;i++){
for(j=0;j<rk;j++){
out3[i+j*arow] = V[i+j*arow];