Merge pull request #27 from nlesc-dirac/sprint_clang

Sprint clang
This commit is contained in:
Hanno Spreeuw 2018-02-28 14:38:46 +01:00 committed by GitHub
commit 1088583a21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 8 deletions

View File

@ -156,3 +156,8 @@ Each 8 rows of any given column represent the 8 values of a 2x2 Jones matrix. Le
When a luster has a chunk size > 1, there will be more than 1 solution per given time interval.
So for this cluster, there will be more than 1 column in the solution file, the exact number of columns being equal to the chunk size.
### Additional Info
See [LOFAR Cookbook Chapter](https://support.astron.nl/LOFARImagingCookbook/sagecal.html).

View File

@ -878,7 +878,7 @@ mlm_der_single(
printf("Singular matrix info=%d\n",status);
#endif
}
} else {
} else if (solve_axb==2) {
/* SVD solver *********************************/
/* U S VT = A */
status=my_dgesvd('A','A',M,M,JkTJk,M,Sd,Ud,M,VTd,M,WORK,lwork);
@ -940,7 +940,7 @@ mlm_der_single(
printf("Singular matrix info=%d\n",status);
#endif
}
} else {
} else if (solve_axb==2) {
/* SVD solver *********************************/
/* dhatk <= U^T jacTed */
my_dgemv('T',M,M,1.0,Ud,M,JkTe,1,0.0,dhatk,1);

View File

@ -225,7 +225,7 @@ mult_hessian(int m, double *pk, double *gk, double *s, double *y, double *rho, i
fprintf(stderr,"%s: %d: no free memory\n",__FILE__,__LINE__);
exit(1);
}
if ((idx=(int*)calloc((size_t)M,sizeof(double)))==0) {
if ((idx=(int*)calloc((size_t)M,sizeof(int)))==0) {
fprintf(stderr,"%s: %d: no free memory\n",__FILE__,__LINE__);
exit(1);
}

View File

@ -318,7 +318,7 @@ mult_hessian(int m, double *pk, double *gk, double *s, double *y, double *rho, i
#endif
exit(1);
}
if ((idx=(int*)calloc((size_t)M,sizeof(double)))==0) {
if ((idx=(int*)calloc((size_t)M,sizeof(int)))==0) {
#ifndef USE_MIC
fprintf(stderr,"%s: %d: no free memory\n",__FILE__,__LINE__);
#endif

View File

@ -165,7 +165,7 @@ mult_hessian(int m, double *pk, double *gk, double *s, double *y, double *rho, i
#endif
exit(1);
}
if ((idx=(int*)calloc((size_t)M,sizeof(double)))==0) {
if ((idx=(int*)calloc((size_t)M,sizeof(int)))==0) {
#ifndef USE_MIC
fprintf(stderr,"%s: %d: no free memory\n",__FILE__,__LINE__);
#endif

View File

@ -686,8 +686,10 @@ printf("Nc=%d\n",Nc);
memset(buf,0,buff_len);
c=read_next_string(&buf,&buff_len,cfp);
if (c!=1) {
/* first column is solution number (int) 1..8N */
/* first column is solution number (int) 0..8N-1 */
sscanf(buf,"%d",&cn);
/* also do a sanity check */
if ( cn<0 || cn>Nc ) cn=0;
}
#ifdef DEBUG
printf("%d ",cn);

View File

@ -1714,6 +1714,7 @@ predict_visibilities_multifreq_withsol(double *u,double *v,double *w,double *p,d
pthread_attr_destroy(&attr);
if (pinv) free(pinv);
free(th_array);
free(threaddata);

View File

@ -55,7 +55,8 @@ zero_image(long totalrows, long offset, long firstrow, long nrows,
charp= (float *) fits_iter_get_array(&cols[0]);
}
/* NOTE: 1st element of array is the null pixel value! */
/* Loop from 1 to nrows, not 0 to nrows - 1. */
for (ii = 1; ii <= nrows; ii++) {
charp[ii]=0.0;
}
@ -1038,6 +1039,12 @@ int main(int argc, char **argv) {
free(clusterfile);
glist_delete(&slist);
free(ignfile);
} else {
if (ffile) free(ffile);
if (slistname) free(slistname);
if (solfile) free(solfile);
if (clusterfile) free(clusterfile);
if (ignfile) free(ignfile);
}
return 0;
}