diff options
author | Siddhesh Wani | 2017-05-04 16:15:18 +0530 |
---|---|---|
committer | Siddhesh Wani | 2017-05-04 16:15:18 +0530 |
commit | de82d12658979cd70439f977742f80fac9f6521f (patch) | |
tree | eff661402e749b2402f5576271aefddd42be23fe /2.3-1/src/c/CACSD | |
parent | 472b2e7ebbd2d8b3ecd00b228128aa8a0bd3f920 (diff) | |
download | Scilab2C-de82d12658979cd70439f977742f80fac9f6521f.tar.gz Scilab2C-de82d12658979cd70439f977742f80fac9f6521f.tar.bz2 Scilab2C-de82d12658979cd70439f977742f80fac9f6521f.zip |
Basic functions and image processing working with MSVC on windows x64
Diffstat (limited to '2.3-1/src/c/CACSD')
-rw-r--r-- | 2.3-1/src/c/CACSD/lqe/dlqea.c | 5 | ||||
-rw-r--r-- | 2.3-1/src/c/CACSD/lqr/dlqra.c | 10 | ||||
-rw-r--r-- | 2.3-1/src/c/CACSD/obscont/dobsconta.c | 6 |
3 files changed, 11 insertions, 10 deletions
diff --git a/2.3-1/src/c/CACSD/lqe/dlqea.c b/2.3-1/src/c/CACSD/lqe/dlqea.c index bc729fb9..63f8d62d 100644 --- a/2.3-1/src/c/CACSD/lqe/dlqea.c +++ b/2.3-1/src/c/CACSD/lqe/dlqea.c @@ -12,6 +12,7 @@ /*Function for calculating lqe gain. Refer 'lqe.sci' in scilab source.*/ +#include <stdlib.h> #include "lqr.h" #include "matrixTranspose.h" @@ -24,8 +25,8 @@ void dlqea(double* sys, int sys_rows, int sys_cols, double* X, double* K) int sys_lqr_cols = sys_rows + 2; int no_of_ip, no_of_st; - no_of_ip = sys[sys_rows*(sys_cols-1)+1]; - no_of_st = sys[sys_rows*(sys_cols-1)]; + no_of_ip = (int)sys[sys_rows*(sys_cols-1)+1]; + no_of_st = (int)sys[sys_rows*(sys_cols-1)]; /*Transpose given system and calculate LQR with new system. Transpose result got from LQR*/ diff --git a/2.3-1/src/c/CACSD/lqr/dlqra.c b/2.3-1/src/c/CACSD/lqr/dlqra.c index 26a5e6c4..02ac1504 100644 --- a/2.3-1/src/c/CACSD/lqr/dlqra.c +++ b/2.3-1/src/c/CACSD/lqr/dlqra.c @@ -26,8 +26,8 @@ void dlqra(double* sys, int sys_rows, int sys_cols, double* X, double* K) { int no_of_states, no_of_inputs, no_of_outputs, dom = 1; int row,col; - no_of_states = sys[sys_rows*(sys_cols-1)]; - no_of_inputs = sys[sys_rows*(sys_cols-1) + 1]; + no_of_states = (int)sys[sys_rows*(sys_cols-1)]; + no_of_inputs = (int)sys[sys_rows*(sys_cols-1) + 1]; no_of_outputs = sys_rows - no_of_states; double *A, *B, *C, *D; @@ -88,7 +88,7 @@ void dlqra(double* sys, int sys_rows, int sys_cols, double* X, double* K) } } - dom = sys[(sys_rows*(sys_cols-2)) + no_of_states]; + dom = (int)sys[(sys_rows*(sys_cols-2)) + no_of_states]; Q = (double*) malloc (no_of_states*no_of_states*sizeof(double)); R = (double*) malloc (no_of_inputs*no_of_inputs*sizeof(double)); @@ -186,7 +186,7 @@ void dlqra(double* sys, int sys_rows, int sys_cols, double* X, double* K) /*Find schur decomposition of LA*/ wsmall = (double*) malloc(4*no_of_states*no_of_states*sizeof(double)); - ks = dschura(LA,2*no_of_states,1,2,wsmall,NULL); + ks = (int)dschura(LA,2*no_of_states,1,2,wsmall,NULL); X12 = (double*) malloc(no_of_states*no_of_states*sizeof(double)); phi12 = (double*) malloc(no_of_states*no_of_states*sizeof(double)); @@ -285,7 +285,7 @@ void dlqra(double* sys, int sys_rows, int sys_cols, double* X, double* K) /*Find schur decomposition of LA*/ wsmall = (double*) malloc(4*no_of_states*no_of_states*sizeof(double)); - ks = dgschura(LA,2*no_of_states,LE,2,2,wsmall,NULL,NULL,NULL); + ks = (int)dgschura(LA,2*no_of_states,LE,2,2,wsmall,NULL,NULL,NULL); X12 = (double*) malloc(no_of_states*no_of_states*sizeof(double)); phi12 = (double*) malloc(no_of_states*no_of_states*sizeof(double)); diff --git a/2.3-1/src/c/CACSD/obscont/dobsconta.c b/2.3-1/src/c/CACSD/obscont/dobsconta.c index 7e297525..88837692 100644 --- a/2.3-1/src/c/CACSD/obscont/dobsconta.c +++ b/2.3-1/src/c/CACSD/obscont/dobsconta.c @@ -22,8 +22,8 @@ void dobsconta(double* sys, int sys_rows, int sys_cols, double* Kc, double* Kf, { int no_of_states, no_of_inputs, no_of_outputs, dom = 1; int row,col; - no_of_states = sys[sys_rows*(sys_cols-1)]; - no_of_inputs = sys[sys_rows*(sys_cols-1) + 1]; + no_of_states = (int)sys[sys_rows*(sys_cols-1)]; + no_of_inputs = (int)sys[sys_rows*(sys_cols-1) + 1]; no_of_outputs = sys_rows - no_of_states; int no_of_cols; @@ -85,7 +85,7 @@ void dobsconta(double* sys, int sys_rows, int sys_cols, double* Kc, double* Kf, } } - dom = sys[(sys_rows*(sys_cols-2)) + no_of_states]; + (int)dom = sys[(sys_rows*(sys_cols-2)) + no_of_states]; dmulma(B,no_of_states,no_of_inputs,Kc,no_of_inputs,no_of_states,BKc); dmulma(Kf,no_of_states,no_of_outputs,C,no_of_outputs,no_of_states,KfC); |