diff --git a/src/csm/math_utils_gsl.cpp b/src/csm/math_utils_gsl.cpp index 665f987022987df59e2ed0474d4865c747097e56..baa3817d7494c3318731de916aae7455159f28bb 100644 --- a/src/csm/math_utils_gsl.cpp +++ b/src/csm/math_utils_gsl.cpp @@ -34,7 +34,7 @@ gsl_vector * vector_from_array(unsigned int n, double *x) { //} void vector_to_array(const gsl_vector*v, double*x){ - size_t i; + int i; for(i=0;i<v->size();i++) x[i] = gvg(v,i); } diff --git a/src/egsl/egsl.cpp b/src/egsl/egsl.cpp index 0b5efe5f121df48416a2dcb26aae9e1d2ba8b79a..6ab5c092be388adf27ccabfd4e788a691b01084c 100644 --- a/src/egsl/egsl.cpp +++ b/src/egsl/egsl.cpp @@ -171,7 +171,7 @@ val egsl_alloc(size_t rows, size_t columns) { int index = c->nvars; if(index<c->nallocated) { gsl_matrix*m = c->vars[index].gsl_m; - if(m->rows() == rows && m->cols() == columns) { + if((size_t) m->rows() == rows && (size_t) m->cols() == columns) { egsl_cache_hits++; c->nvars++; return assemble_val(cid,index,c->vars[index].gsl_m); @@ -204,7 +204,7 @@ val egsl_alloc_in_context(int context, size_t rows, size_t columns) { int index = c->nvars; if(index<c->nallocated) { gsl_matrix*m = c->vars[index].gsl_m; - if(m->rows() == rows && m->cols() == columns) { + if((size_t) m->rows() == rows && (size_t) m->cols() == columns) { egsl_cache_hits++; c->nvars++; return assemble_val(context,index,c->vars[index].gsl_m); @@ -256,7 +256,7 @@ val egsl_promote(val v) { void egsl_expect_size(val v, size_t rows, size_t cols) { gsl_matrix * m = egsl_gslm(v); - int bad = (rows && (m->rows()!=rows)) || (cols && (m->cols()!=cols)); + int bad = (rows && ((size_t) m->rows()!=rows)) || (cols && ((size_t) m->cols()!=cols)); if(bad) { fprintf(stderr, "Matrix size is %d,%d while I expect %d,%d", (int)m->rows(),(int)m->cols(),(int)rows,(int)cols); @@ -268,7 +268,7 @@ void egsl_expect_size(val v, size_t rows, size_t cols) { void egsl_print(const char*str, val v) { gsl_matrix * m = egsl_gslm(v); - size_t i,j; + int i,j; int context = its_context(v); int var_index = its_var_index(v); fprintf(stderr, "%s = (%d x %d) context=%d index=%d\n", @@ -300,7 +300,7 @@ double* egsl_atmp(val v, size_t i, size_t j) { double egsl_norm(val v1){ egsl_expect_size(v1, 0, 1); double n=0; - size_t i; + int i; gsl_matrix * m = egsl_gslm(v1); for(i=0;i<m->rows();i++) { double v = gsl_matrix_get(m,i,0); @@ -320,7 +320,6 @@ double egsl_atv(val v1, size_t i){ void egsl_free_unused_memory(){ int c; - int freecounter = 0; for(c=0;c<=max_cid;c++) { for(int i=egsl_contexts[c].nvars; i<egsl_contexts[c].nallocated; i++){ gsl_matrix_free(egsl_contexts[c].vars[i].gsl_m); diff --git a/src/egsl/egsl_ops.cpp b/src/egsl/egsl_ops.cpp index 1a5e661be41bc65925e5fb9ec4ac8ea9129ae272..3a7746bbb24168c3f7ffe7c6cab76c38188d7bf3 100644 --- a/src/egsl/egsl_ops.cpp +++ b/src/egsl/egsl_ops.cpp @@ -17,7 +17,7 @@ val egsl_compose_col(val v1, val v2){ egsl_expect_size(v2, 0, m1->cols()); val v3 = egsl_alloc(m1->rows()+m2->rows(),m1->cols()); gsl_matrix *m3 = egsl_gslm(v3); - size_t i,j; + int i,j; for(j=0;j<m1->cols();j++) { for(i=0;i<m1->rows();i++) gsl_matrix_set(m3, i, j, gsl_matrix_get(m1,i,j)); @@ -34,7 +34,7 @@ val egsl_compose_row(val v1, val v2){ egsl_expect_size(v2, m1->rows(), 0); val v3 = egsl_alloc(m1->rows(), m1->cols() + m2->cols()); gsl_matrix *m3 = egsl_gslm(v3); - size_t i,j; + int i,j; for(i=0;i<m1->rows();i++) { for(j=0;j<m1->cols();j++) gsl_matrix_set(m3, i, j, gsl_matrix_get(m1,i,j)); @@ -59,7 +59,7 @@ void egsl_add_to_col(val v1, size_t j, val v2) { /* printf("m1 size = %d,%d j = %d\n",m1->rows(),m1->cols(),j); */ egsl_expect_size(v2, m1->rows(), 1); - size_t i; + int i; for(i=0;i<m1->rows();i++) { *gsl_matrix_ptr(m1, i, j) += gsl_matrix_get(m2,i,0); } diff --git a/src/gpc/gpc_utils.cpp b/src/gpc/gpc_utils.cpp index 5051fe078bd12d566894b6936ca241de4b1d0c32..b13b7afc9f070512e512672a03a3c935855c77f9 100644 --- a/src/gpc/gpc_utils.cpp +++ b/src/gpc/gpc_utils.cpp @@ -84,7 +84,7 @@ double m_dot(const gsl_matrix*A,const gsl_matrix*B) { //} -int poly_greatest_real_root(unsigned int n, const double*a, double *root) { +int poly_greatest_real_root(int n, const double*a, double *root) { // unsigned int i; // // double z[(n-1)*2]; @@ -115,7 +115,7 @@ int poly_greatest_real_root(unsigned int n, const double*a, double *root) { // } Eigen::VectorXd poly_coeffs(n); - for(unsigned int i=0; i<n; i++){ + for(int i=0; i<n; i++){ poly_coeffs(i) = a[i]; } if(n!=5){ diff --git a/src/gpc/gpc_utils.h b/src/gpc/gpc_utils.h index f08139ec1a93a5ad76421f8112649605a25c378b..73524183bae0bd36df94916640b9c8a40ae5352b 100644 --- a/src/gpc/gpc_utils.h +++ b/src/gpc/gpc_utils.h @@ -26,7 +26,7 @@ double m_det(const gsl_matrix*A); /* Returns the real part of the roots in roots */ //int poly_real_roots(unsigned int n, const double*a, double *roots); -int poly_greatest_real_root(unsigned int n, const double*a, double *root); +int poly_greatest_real_root(int n, const double*a, double *root); void m_display(const char*str, gsl_matrix*m);