Diff for /imach/src/imach.c between versions 1.183 and 1.184

version 1.183, 2015/03/10 20:34:32 version 1.184, 2015/03/11 11:52:39
Line 1 Line 1
 /* $Id$  /* $Id$
   $State$    $State$
   $Log$    $Log$
     Revision 1.184  2015/03/11 11:52:39  brouard
     Summary: Back from Windows 8. Intel Compiler
   
   Revision 1.183  2015/03/10 20:34:32  brouard    Revision 1.183  2015/03/10 20:34:32  brouard
   Summary: 0.98q0, trying with directest, mnbrak fixed    Summary: 0.98q0, trying with directest, mnbrak fixed
   
Line 574 Line 577
   
 #define POWELL /* Instead of NLOPT */  #define POWELL /* Instead of NLOPT */
 /* #define POWELLORIGINAL */ /* Don't use Directest to decide new direction but original Powell test */  /* #define POWELLORIGINAL */ /* Don't use Directest to decide new direction but original Powell test */
   /* #define MNBRAKORIGINAL */ /* Don't use mnbrak fix */
   
 #include <math.h>  #include <math.h>
 #include <stdio.h>  #include <stdio.h>
Line 834  static int split( char *path, char *dirc Line 838  static int split( char *path, char *dirc
       printf("Warning you should use %s as a separator\n",DIRSEPARATOR);*/        printf("Warning you should use %s as a separator\n",DIRSEPARATOR);*/
     /* get current working directory */      /* get current working directory */
     /*    extern  char* getcwd ( char *buf , int len);*/      /*    extern  char* getcwd ( char *buf , int len);*/
     if ( getcwd( dirc, FILENAME_MAX ) == NULL ) {  #ifdef WIN32
       if (_getcwd( dirc, FILENAME_MAX ) == NULL ) {
   #else
           if (getcwd(dirc, FILENAME_MAX) == NULL) {
   #endif
       return( GLOCK_ERROR_GETCWD );        return( GLOCK_ERROR_GETCWD );
     }      }
     /* got dirc from getcwd*/      /* got dirc from getcwd*/
Line 1354  values at the three points, fa, fb , and Line 1362  values at the three points, fa, fb , and
         (*cx=10.098840694817, *fc=298946.631474258087),  (*u=9.852501168332, fu=298948.773013752128, fparabu=298945.434711494134) */          (*cx=10.098840694817, *fc=298946.631474258087),  (*u=9.852501168332, fu=298948.773013752128, fparabu=298945.434711494134) */
       /* In that case, there is no bracket in the output! Routine is wrong with many consequences.*/        /* In that case, there is no bracket in the output! Routine is wrong with many consequences.*/
 #endif   #endif 
 #ifdef MNBRAKORI  #ifdef MNBRAKORIGINAL
 #else  #else
       if (fu > *fc) {        if (fu > *fc) {
 #ifdef DEBUG  #ifdef DEBUG
Line 1635  void powell(double p[], double **xi, int Line 1643  void powell(double p[], double **xi, int
       if (t < 0.0) { /* Then we use it for new direction */        if (t < 0.0) { /* Then we use it for new direction */
 #else  #else
       if (directest*t < 0.0) { /* Contradiction between both tests */        if (directest*t < 0.0) { /* Contradiction between both tests */
       printf("directest= %.12lf, t= %.12lf, f1= %.12lf,f2= %.12lf,f3= %.12lf, del= %.12lf\n",directest, t, fp,(*fret),fptt);        printf("directest= %.12lf, t= %.12lf, f1= %.12lf,f2= %.12lf,f3= %.12lf, del= %.12lf\n",directest, t, fp,(*fret),fptt,del);
       printf("f1-2f2+f3= %.12lf, f1-f2-del= %.12lf, f1-f3= %.12lf\n",fp-2.0*(*fret)+fptt, fp -(*fret) -del, fp-fptt);        printf("f1-2f2+f3= %.12lf, f1-f2-del= %.12lf, f1-f3= %.12lf\n",fp-2.0*(*fret)+fptt, fp -(*fret) -del, fp-fptt);
       fprintf(ficlog,"directest= %.12lf, t= %.12lf, f1= %.12lf,f2= %.12lf,f3= %.12lf, del= %.12lf\n",directest, t, fp,(*fret),fptt);        fprintf(ficlog,"directest= %.12lf, t= %.12lf, f1= %.12lf,f2= %.12lf,f3= %.12lf, del= %.12lf\n",directest, t, fp,(*fret),fptt, del);
       fprintf(ficlog,"f1-2f2+f3= %.12lf, f1-f2-del= %.12lf, f1-f3= %.12lf\n",fp-2.0*(*fret)+fptt, fp -(*fret) -del, fp-fptt);        fprintf(ficlog,"f1-2f2+f3= %.12lf, f1-f2-del= %.12lf, f1-f3= %.12lf\n",fp-2.0*(*fret)+fptt, fp -(*fret) -del, fp-fptt);
     }       } 
       if (directest < 0.0) { /* Then we use it for new direction */        if (directest < 0.0) { /* Then we use it for new direction */
Line 5638  BOOL IsWow64() Line 5646  BOOL IsWow64()
 void syscompilerinfo()  void syscompilerinfo()
  {   {
    /* #include "syscompilerinfo.h"*/     /* #include "syscompilerinfo.h"*/
           /* command line Intel compiler 64bit windows:
           /GS /W3 /Gy /Zc:wchar_t /Zi /O2 /Fd"x64\Release\vc120.pdb" /D "WIN32" 
           /D "NDEBUG" /D "_CONSOLE" /D "_LIB" /D "_UNICODE" /D "UNICODE" /Qipo 
           /Zc:forScope /Oi /MD /Fa"x64\Release\" /EHsc /nologo 
           /Fo"x64\Release\" /Qprof-dir "x64\Release\" /Fp"x64\Release\IMaCh.pch" */
           /*
           /GS /W3 /Gy /Zc:wchar_t /Zi /O3 /Fd"x64\Release\vc120.pdb" /D "WIN32" 
           /D "NDEBUG" /D "_CONSOLE" /D "_LIB" /D "_UNICODE" /D "UNICODE" /Qipo 
           /Zc:forScope /Oi /MD /Fa"x64\Release\" /EHsc /nologo /Qparallel 
           /Fo"x64\Release\" /Qprof-dir "x64\Release\" /Fp"x64\Release\IMaCh.pch" */
 #if defined __INTEL_COMPILER  #if defined __INTEL_COMPILER
 #if defined(__GNUC__)  #if defined(__GNUC__)
         struct utsname sysInfo;  /* For Intel on Linux and OS/X */          struct utsname sysInfo;  /* For Intel on Linux and OS/X */
Line 5827  int prevalence_limit(double *p, double * Line 5844  int prevalence_limit(double *p, double *
         } /* Age */          } /* Age */
         /* was end of cptcod */          /* was end of cptcod */
     } /* cptcov */      } /* cptcov */
           return 0;
 }  }
   
 int hPijx(double *p, int bage, int fage){  int hPijx(double *p, int bage, int fage){
Line 5896  int hPijx(double *p, int bage, int fage) Line 5914  int hPijx(double *p, int bage, int fage)
       }        }
       /*}*/        /*}*/
     }      }
           return 0;
 }  }
   
   
Line 6006  int main(int argc, char *argv[]) Line 6025  int main(int argc, char *argv[])
   
   nberr=0; /* Number of errors and warnings */    nberr=0; /* Number of errors and warnings */
   nbwarn=0;    nbwarn=0;
   #ifdef WIN32
     _getcwd(pathcd, size);
   #else
   getcwd(pathcd, size);    getcwd(pathcd, size);
   #endif
   
   printf("\n%s\n%s",version,fullversion);    printf("\n%s\n%s",version,fullversion);
   if(argc <=1){    if(argc <=1){
Line 6042  int main(int argc, char *argv[]) Line 6065  int main(int argc, char *argv[])
   /* Split argv[1]=pathtot, parameter file name to get path, optionfile, extension and name */    /* Split argv[1]=pathtot, parameter file name to get path, optionfile, extension and name */
   split(pathtot,path,optionfile,optionfilext,optionfilefiname);    split(pathtot,path,optionfile,optionfilext,optionfilefiname);
   printf("\npathtot=%s,\npath=%s,\noptionfile=%s \noptionfilext=%s \noptionfilefiname=%s\n",pathtot,path,optionfile,optionfilext,optionfilefiname);    printf("\npathtot=%s,\npath=%s,\noptionfile=%s \noptionfilext=%s \noptionfilefiname=%s\n",pathtot,path,optionfile,optionfilext,optionfilefiname);
   #ifdef WIN32
     _chdir(path); /* Can be a relative path */
     if(_getcwd(pathcd,MAXLINE) > 0) /* So pathcd is the full path */
   #else
   chdir(path); /* Can be a relative path */    chdir(path); /* Can be a relative path */
   if(getcwd(pathcd,MAXLINE) > 0) /* So pathcd is the full path */    if (getcwd(pathcd, MAXLINE) > 0) /* So pathcd is the full path */
     printf("Current directory %s!\n",pathcd);  #endif
     printf("Current directory %s!\n",pathcd);
   strcpy(command,"mkdir ");    strcpy(command,"mkdir ");
   strcat(command,optionfilefiname);    strcat(command,optionfilefiname);
   if((outcmd=system(command)) != 0){    if((outcmd=system(command)) != 0){
Line 6544  Title=%s <br>Datafile=%s Firstpass=%d La Line 6572  Title=%s <br>Datafile=%s Firstpass=%d La
   
   strcpy(pathr,path);    strcpy(pathr,path);
   strcat(pathr,optionfilefiname);    strcat(pathr,optionfilefiname);
   #ifdef WIN32
     _chdir(optionfilefiname); /* Move to directory named optionfile */
   #else
   chdir(optionfilefiname); /* Move to directory named optionfile */    chdir(optionfilefiname); /* Move to directory named optionfile */
   #endif
             
       
   /* Calculates basic frequencies. Computes observed prevalence at single age    /* Calculates basic frequencies. Computes observed prevalence at single age
      and prints on file fileres'p'. */       and prints on file fileres'p'. */
Line 7341  Interval (in months) between two waves: Line 7374  Interval (in months) between two waves:
   
   
    printf("Before Current directory %s!\n",pathcd);     printf("Before Current directory %s!\n",pathcd);
   #ifdef WIN32
      if (_chdir(pathcd) != 0)
              printf("Can't move to directory %s!\n",path);
      if(_getcwd(pathcd,MAXLINE) > 0)
   #else
    if(chdir(pathcd) != 0)     if(chdir(pathcd) != 0)
     printf("Can't move to directory %s!\n",path);             printf("Can't move to directory %s!\n", path);
   if(getcwd(pathcd,MAXLINE) > 0)     if (getcwd(pathcd, MAXLINE) > 0)
   #endif 
     printf("Current directory %s!\n",pathcd);      printf("Current directory %s!\n",pathcd);
   /*strcat(plotcmd,CHARSEPARATOR);*/    /*strcat(plotcmd,CHARSEPARATOR);*/
   sprintf(plotcmd,"gnuplot");    sprintf(plotcmd,"gnuplot");

Removed from v.1.183  
changed lines
  Added in v.1.184


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>