In DRIVE0() TSTPLT works with all 4 examples. Maximum misfit value of 9.86E-16.
authorilb@NIH.GOV <ilb@NIH.GOV@ba61647d-9d00-f842-95cd-605cb4296b96>
Thu, 8 Feb 2018 21:35:21 +0000 (21:35 +0000)
committerilb@NIH.GOV <ilb@NIH.GOV@ba61647d-9d00-f842-95cd-605cb4296b96>
Thu, 8 Feb 2018 21:35:21 +0000 (21:35 +0000)
git-svn-id: https://citdcbmipav.cit.nih.gov/repos-pub/mipav/trunk@15366 ba61647d-9d00-f842-95cd-605cb4296b96

mipav/src/gov/nih/mipav/model/algorithms/SymmsIntegralMapping.java

index 0baf63b..0a6da24 100644 (file)
@@ -859,14 +859,33 @@ public class SymmsIntegralMapping extends AlgorithmBase {
        } // public void PARGEN\r
        \r
        public void DRIVE0() {\r
+               // All examples have MAXIMUM CORNER MISFIT OCCURS AT CORNER 1\r
+               // PARFUN AND DPARFN ARE CONSISTENT\r
+               // TSTPLT: NORMAL EXIT\r
+               // MAXIMUM MISFIT VALUES ARE:\r
+               // EXAMPLE 1: 2.449E-16\r
+               // EXAMPLE 2: 4.78E-16\r
+               // EXAMPLE 3: 2.449E-16;\r
+               // EXAMPLE 4: 9.86E-16\r
         int IER[] = new int[1];\r
         double MXMIS[] = new double[1];\r
         double MXDIF[] = new double[1];\r
         double PSD[] = new double[1];\r
         double MINPD = 0.0;\r
         double MAXPD = 0.0;\r
-\r
-       TSTPLT(MXMIS,MXDIF,NARCS,PSD,MINPD,MAXPD,IER);\r
+        if (example == 1) {\r
+               NARCS = 5;\r
+        }\r
+        else if (example == 2) {\r
+               NARCS = 4;\r
+        }\r
+        else if (example == 3) {\r
+               NARCS = 8;\r
+        }\r
+        else if (example == 4) {\r
+               NARCS = 48;\r
+        }\r
+        TSTPLT(MXMIS,MXDIF,NARCS,PSD,MINPD,MAXPD,IER);\r
        }\r
 \r
 \r
@@ -983,8 +1002,8 @@ public class SymmsIntegralMapping extends AlgorithmBase {
                   PARFUNANS[1] = 2.0+2.0 * Math.exp(-TT[1]*(-0.7853981633974483))*Math.sin(-2.356194490192345+TT[0]*(-0.7853981633974483));\r
           }\r
           else if(IA == 2) {\r
-                  T[0] = 2.3561945+TT[0] * (0.7853981999999999);\r
-                  T[1] = TT[1] * (0.7853981999999999);\r
+                  T[0] = 2.356194490192345+TT[0] * (0.7853981633974481);\r
+              T[1] = TT[1] * (0.7853981633974481);\r
                   PARFUNANS[0] = Math.cos(T[0])*Math.cosh(T[1])-2.0*Math.cos(T[0])*Math.sinh(T[1]);\r
                   PARFUNANS[1] = -Math.sin(T[0])*Math.sinh(T[1])+2.0*Math.sin(T[0])*Math.cosh(T[1]);\r
           }\r
@@ -1148,10 +1167,10 @@ public class SymmsIntegralMapping extends AlgorithmBase {
                        DPARFNANS[1] = (2.0)*(-0.7853981633974483)*Math.exp((-TT[1])*(-0.7853981633974483))*Math.cos(-2.356194490192345+TT[0]*(-0.7853981633974483));\r
                }\r
                else if (IA == 2) {\r
-                   T[0] = 2.3561945+TT[0]*(0.7853981999999999);\r
-                       T[1] = TT[1]*(0.7853981999999999);\r
-                       DPARFNANS[0] = 0.7853981999999999*(-Math.sin(T[0])*Math.cosh(T[1])+2.0*Math.sin(T[0])*Math.sinh(T[1]));\r
-                       DPARFNANS[1] = 0.7853981999999999*(2.0*Math.cos(T[0])*Math.cosh(T[1])-Math.cos(T[0])*Math.sinh(T[1]));\r
+                       T[0] = 2.356194490192345+TT[0]*(0.7853981633974481);\r
+                   T[1] = TT[1]*(0.7853981633974481);\r
+                   DPARFNANS[0] = 0.7853981633974481*(-Math.sin(T[0])*Math.cosh(T[1])+2.0*Math.sin(T[0])*Math.sinh(T[1]));\r
+                   DPARFNANS[1] = 0.7853981633974481*(2.0*Math.cos(T[0])*Math.cosh(T[1])-Math.cos(T[0])*Math.sinh(T[1]));\r
                }\r
                else if (IA == 3) {\r
                    DPARFNANS[0] = -0.5;\r
@@ -1542,6 +1561,12 @@ public class SymmsIntegralMapping extends AlgorithmBase {
                // FMT="(A12,"+REDD+",A1,"+REDD+",A2)";\r
 \r
                try {\r
+                       raFile.writeBytes("      int IB;\n");\r
+                       if (REFLN) {\r
+                               raFile.writeBytes("      int IR, IS;\n");\r
+                               raFile.writeBytes("      double TS[] = new double[2];\n");\r
+                               raFile.writeBytes("      double ZETA[] = new double[2];\n");\r
+                       }\r
                        if (PARFUN) {\r
                                NEEDC = ((CENSY[0] != 0.0) || (CENSY[1] != 0.0));\r
                                if (NEEDC || REFLN) {\r
@@ -1565,7 +1590,8 @@ public class SymmsIntegralMapping extends AlgorithmBase {
                                        } // else\r
                                        raFile.writeBytes("//\n");\r
                                } // if (NEEDC || REFLN)\r
-                       } else if (REFLN) {\r
+                       } // if (PARFUN) \r
+                       else if (REFLN) {\r
                                R = U2[0];\r
                                A = U2[1];\r
                                raFile.writeBytes("      double U2[] = new double[]{"+R+", " + A + "};\n");\r
@@ -2818,7 +2844,7 @@ public class SymmsIntegralMapping extends AlgorithmBase {
                        }\r
                } // for (IA=1; IA <= NARCS; IA++)\r
                if (MXMIS[0] >= TOL1) {\r
-                       System.out.println("MAXIMUM CORNER MISFIT: " + MXMIS);\r
+                       System.out.println("MAXIMUM CORNER MISFIT: " + MXMIS[0]);\r
                        System.out.println("OCCURS AT CORNER: " + IMX);\r
                } else {\r
                        System.out.println("ALL ARCS FIT AT CORNERS:");\r