summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/linearAlgebra
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/src/c/linearAlgebra')
-rw-r--r--2.3-1/src/c/linearAlgebra/hess/dhessa.c8
-rw-r--r--2.3-1/src/c/linearAlgebra/projspec/dprojspeca.c3
-rw-r--r--2.3-1/src/c/linearAlgebra/sqroot/dsqroota.c4
-rw-r--r--2.3-1/src/c/linearAlgebra/sva/dsvaa.c7
4 files changed, 11 insertions, 11 deletions
diff --git a/2.3-1/src/c/linearAlgebra/hess/dhessa.c b/2.3-1/src/c/linearAlgebra/hess/dhessa.c
index 57f81b35..e1f2e2d1 100644
--- a/2.3-1/src/c/linearAlgebra/hess/dhessa.c
+++ b/2.3-1/src/c/linearAlgebra/hess/dhessa.c
@@ -20,11 +20,13 @@
#include "matrixTranspose.h"
#include "matrixMultiplication.h"
+/* Lapack subroutines - which are used*/
extern int dgehrd_(int *, int *,int *,double *,int *,double *,double *,int *,int *);
extern int dorghr_(int *, int *,int *,double *,int *,double *,double *,int *,int *);
-
+/* All the vairbale names are given exactly the same name as scilab source code */
void dhessa(double *in1,int size,int nout,double *out1, double *out2){
+/* Variables names are done through, Lapack library. */
int i,j,k;
int N = size;
int ILO=1;
@@ -41,11 +43,11 @@ void dhessa(double *in1,int size,int nout,double *out1, double *out2){
WORK = (double *)malloc((double)LWORK*sizeof(double));
dgehrd_(&N,&ILO,&IHI,A,&LDA,TAU,WORK,&N,&INFO);
- for(i=0;i<N;i++)
+ for(i=0;i<N;i++) /* copying it in output */
for(j=0;j<N;j++)
out2[i+j*N] = A[i+j*N];
- for(j=1;j<=N-2;j++){
+ for(j=1;j<=N-2;j++){ /* copying it in output */
for(i=j+2;i<=N;i++){
out2[(i-1)+(j-1)*N] = 0;
}
diff --git a/2.3-1/src/c/linearAlgebra/projspec/dprojspeca.c b/2.3-1/src/c/linearAlgebra/projspec/dprojspeca.c
index 6bb6fa52..aea9713e 100644
--- a/2.3-1/src/c/linearAlgebra/projspec/dprojspeca.c
+++ b/2.3-1/src/c/linearAlgebra/projspec/dprojspeca.c
@@ -63,8 +63,5 @@ double dprojspeca(double *inp1,int row,int col,double *out1,double *out2,double
index = 0;
return index;
}
-
index = 1;
-
-
}
diff --git a/2.3-1/src/c/linearAlgebra/sqroot/dsqroota.c b/2.3-1/src/c/linearAlgebra/sqroot/dsqroota.c
index 038afc98..a9062e65 100644
--- a/2.3-1/src/c/linearAlgebra/sqroot/dsqroota.c
+++ b/2.3-1/src/c/linearAlgebra/sqroot/dsqroota.c
@@ -108,9 +108,9 @@ void dsqroota(double *inp,int row,int col, double *out){
}
for(i=0;i<col*rk;i++){
B[i] = V[i];
- printf("%lf ",B[i]);
+ //printf("%lf ",B[i]);
}
- printf("\n");
+ //printf("\n");
/*for(i=0;i<rk;i++){
for(j=0;j<rk;j++){
//A[i*rk+j] = sqrt(S[i*row+j]);
diff --git a/2.3-1/src/c/linearAlgebra/sva/dsvaa.c b/2.3-1/src/c/linearAlgebra/sva/dsvaa.c
index 0d34d8d1..691694e4 100644
--- a/2.3-1/src/c/linearAlgebra/sva/dsvaa.c
+++ b/2.3-1/src/c/linearAlgebra/sva/dsvaa.c
@@ -20,6 +20,7 @@
#define eps 2.22044604925e-16
+/* Ref: Scilab source code */
void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \
double *out2,double *out3){
@@ -70,21 +71,21 @@ void dsvaa(int ninp,double *in1,int row,int col,double in2,double *out1, \
}
}
arow = M;
- acol = Min(M,N);
+ acol = Min(M,N); /* Copying, the output in required format */
for(i=0;i<arow;i++){
for(j=0;j<rk;j++){
out1[i+j*row]=U[i+j*arow];
}
}
arow = Min(M,N);
- for(i=0;i<rk;i++){
+ for(i=0;i<rk;i++){ /* Copying, the output in required format */
for(j=0;j<rk;j++){
out2[i+j*(int)rk] = S[i+j*arow];
}
}
arow = N;
acol = Min(M,N);
- for(i=0;i<arow;i++){
+ for(i=0;i<arow;i++){ /* Copying, the output in required format */
for(j=0;j<rk;j++){
out3[i+j*arow] = V[i+j*arow];
}