Class NLConstrainedEngineEP

    • Field Detail

      • a

        protected DoubleDouble[] a
        On completion if exitStatus >= 0 a[] contains the latest (best) estimate of the solution point.
      • absoluteConvergence

        protected DoubleDouble absoluteConvergence
        absolute convergence constant Used to test for convergence by the sum of squares being less than the absoluteConvergence squared.
      • bounds

        protected int bounds
        integer scalar code for assessing the bounds bounds = 0 means an unconstrained problem bounds = 1 means the same lower bounds for all unknowns and the same upper bounds for all unknowns. The lower and upper bound must be stored in bl[0] and bu[0] respectively. bounds = 2 means that the bounds must be supplied by the user in bl[i] and bu[i] for i = 0,1, param - 1.
      • covarMat

        protected DoubleDouble[][] covarMat
        2D array of doubles of dimension nPts by max(4,param) containing the main part of the covariance matrix (Jtranspose * J)inverse, where J is the Jacobian matrix computed at a.
      • ctrlMat

        protected int[] ctrlMat
        Wrapper for ctrl or lctrl communication with driver.
      • internalScaling

        protected boolean internalScaling
        If true, the columns of the Jacobian are scaled to have unit length. If false, internal scaling is not used to compute the Gauss-Newton search direction.
      • iters

        protected int iters
        integer scalar containing the number of iterations until termination.
      • maxIterations

        protected int maxIterations
        DOCUMENT ME!
      • nPts

        protected int nPts
        integer scalar containing the number of data points.
      • param

        protected int param
        variables integer scalar containing the number of unknowns.
      • parameterConvergence

        protected DoubleDouble parameterConvergence
        parameter convergence constant Used to test for convergence by the relative change in a[] being less than the parameterConvergence.
      • relativeConvergence

        protected DoubleDouble relativeConvergence
        relative convergence constant Used to test for convergence by reduction in objective function being less than relativeConvergence squared.
      • residuals

        protected DoubleDouble[] residuals
        1D array of doubles of dimension nPts containing the value of the residuals at the termination point a;.
      • secondAllowed

        protected boolean secondAllowed
        The method of Newton is allowed at the end of the iteration in some situations (large residuals). If true, the use of second derivatives is permitted
      • tolerance

        protected DoubleDouble tolerance
        pseudo rank tolerance constant used to determine the pseudo rank of the Jacobian J.
      • aset

        private int[] aset
        1D integer array of length param containing a code which indicates whether an unknown is active or not aset[i] = 0 when a[i] is free = +1 when a[i] == bl[i] = -1 when a[i] == bu[i].
      • beta

        private DoubleDouble beta
        scalar containing the norm of the orthogonal projection of residuals onto the space spanned by the columns of the Jacobian.
      • ctrl

        private int ctrl
        ctrl can have 3 different values on entry. If ctrl = 1 or ctrl = -1, compute the residuals for all nPts at a certain point a and return the residuals = yfit - yseries in the array residuals if the functions are computable. If not successful and ctrl was set to 1, set ctrl = -1. If not successful and ctrl was set to -1, set ctrl
        • d1sqs

          private DoubleDouble d1sqs
          scalar containing the predicted reduction in the objective function if gn-direction is used.
        • diag

          private DoubleDouble[] diag
          1D double array of length param conatiaing the diagonal elements of the diagonal matrix D if internalScaling is true. Otherwise, undefined.
        • dx

          private DoubleDouble[] dx
          double working areas 1D array of length param containing the solution of J * dx = -residuals.
        • errorStatus

          private int errorStatus
          DOCUMENT ME!
        • eval

          private int eval
          DOCUMENT ME!
        • exitStatus

          private int exitStatus
          integer scalar that indicates why the return was taken. If exitStatus != -1 and exitStatus >= -10, then a[] contains the latest (best) estimate of the solution point. = 1000X convergence because relative predicted reduction in the objective function = (0.5 * chisquare) is less than (relativeConvergence)**2 = 200X convergence because sum of squares is less than (absoluteConvergence)**2 = 30X convergence because the relative change in a is less than parameterConvergence = 4X convergence because we are computing at noise level X, the last digit in the convergence code, indicates how the last steps were computed X = 0 no trouble (Gauss-Newton the last 3 steps) = 1 pseudoRank param at termination point = 2 The method of Newton was used (at least) in the last step = 3 The (last - 2) step was subspace minimization, but the last 2 steps were Gauss-Newton steps = 4 The steplength was not unit in both the last 2 steps
          • funcEval

            private int funcEval
            integer scalar containing the total number of function evaluations done inside this routine.
          • g

            private DoubleDouble[] g
            1D array of length param containing the gradient of the objective at the current point.
          • gmat

            private DoubleDouble[][] gmat
            param by param array If secondAllowed if false, gmat can be used as a singly subscripted array of dimension param by setting all second indices to 0.
          • gndok

            private boolean gndok
            DOCUMENT ME!
          • gnorm

            private DoubleDouble gnorm
            scalar containing norm of the gradient divided by norm of Jacobian.
          • icount

            private int icount
            Variables used for restart information.
          • lattry

            private int lattry
            Variables used for restart information.
          • itotal

            private int itotal
            Variables used for restart information.
          • irank

            private int irank
            Variables used for restart information.
          • imax

            private int imax
            Variables used for restart information.
          • ival

            private int ival
            Variables used for restart information.
          • iev

            private int iev
            DOCUMENT ME!
          • ifree

            private int ifree
            DOCUMENT ME!
          • indic

            private int indic
            DOCUMENT ME!
          • info

            private int info
            Consistently use 1 base indexing rather than 0 based indexing
          • jacobianEval

            private int jacobianEval
            integer scalar containing the number of function evaluations caused by computing Jacobians with difference methods.
          • kod

            private int kod
            DOCUMENT ME!
          • lineEval

            private int lineEval
            integer scalar containing the number of function evaluations caused by the linesearch algorithm.
          • mdg

            private int mdg
            Leading dimension of array gmat mdg must be >= param if secondAllowed is true.
          • constraintAct

            private int constraintAct
            Number of active constraints.
          • phi

            private DoubleDouble phi
            double scalar containging the value of the objective function = (0.5 * chisquare) at the termination point a.
          • pivit

            private int[] pivit
            array of integers of dimension param containing the permutation matrix E in the decomposition QTranspose * J * D E = (R) (0) pivit[i] contains the index of the column that was moved into column i.
          • prekm1

            private DoubleDouble prekm1
            scalar containing the predicted reduction in the objective if pseudoRank from previous step is used.
          • restart

            private boolean restart
            DOCUMENT ME!
          • kodkm2

            private int kodkm2
            The suffices km2 and km1 in the names of the variables represent time step k-2 and k-1 respectively. These variables are updated only inside the routine evreuc.
          • rngkm1

            private int rngkm1
            The suffices km2 and km1 in the names of the variables represent time step k-2 and k-1 respectively. These variables are updated only inside the routine evreuc.
          • kodkm1

            private int kodkm1
            The suffices km2 and km1 in the names of the variables represent time step k-2 and k-1 respectively. These variables are updated only inside the routine evreuc.
          • secind

            private int secind
            DOCUMENT ME!
          • secondEval

            private int secondEval
            integer scalar containing the number of function evaluations caused by using second derivatives in the method of Newton.
          • speed

            private DoubleDouble speed
            double scalar containing an estimate of the linear convergence factor.
          • srelpr

            private DoubleDouble srelpr
            single relative precision.
          • v

            private DoubleDouble[] v
            1D array of length nPts containing the orthogonal projection of residuals onto space spanned by the first pseudoRank linear independent columns of the Jacobian.
          • outputMes

            protected boolean outputMes
          • testMode

            private boolean testMode
          • analyticalJacobian

            protected boolean analyticalJacobian
          • testCase

            private int testCase
          • Constructor Detail

            • NLConstrainedEngineEP

              public NLConstrainedEngineEP()
            • NLConstrainedEngineEP

              public NLConstrainedEngineEP​(int nPts,
                                           int param)
              NLConstrainedEngine - non-linear fit to a function.
              Parameters:
              nPts - number of points to fit to the function to
              param - number of parameters of function
          • Method Detail

            • fitTestModel

              private void fitTestModel()
              Creates a new Fit24DModel object.
              Parameters:
              nPoints - DOCUMENT ME!
              xData - DOCUMENT ME!
              yData - DOCUMENT ME!
              initial - DOCUMENT ME!
            • dumpTestResults

              private void dumpTestResults()
            • driverCalls

              private void driverCalls()
            • fitToFunction

              public abstract void fitToFunction​(DoubleDouble[] a,
                                                 DoubleDouble[] residuals,
                                                 DoubleDouble[][] covarMat)
              fitToFunction communicates with 3 protected variables param, nPts, and ctrlMat ctrlMat is used as a wrapper for ctrl or lctrl. Evaluates the residuals or the Jacobian at a certain a[]
              Parameters:
              a - DOCUMENT ME!
              residuals - DOCUMENT ME!
              covarMat - DOCUMENT ME!
            • driver

              public void driver()
              driver.
            • getChiSquared

              public double getChiSquared()
              getChiSquared - accessor to chi-squared value (goodness-of-fit measure).
              Returns:
              the value of chi squared
            • getParameters

              public double[] getParameters()
              getParameters accessor to function parameters.
              Returns:
              the function parameters determined by the algorithm
            • getResiduals

              public double[] getResiduals()
              DOCUMENT ME!
              Returns:
              double[] residuals
            • getExitStatus

              public int getExitStatus()
            • analuc

              private void analuc​(int[] prank)
              DOCUMENT ME!
            • btrunc

              private void btrunc​(int[] prank,
                                  boolean internalScaling,
                                  DoubleDouble[] work)
              DOCUMENT ME!
              Parameters:
              internalScaling - DOCUMENT ME!
              work - DOCUMENT ME!
            • covar

              private void covar()
              DOCUMENT ME!
            • dimsub

              private void dimsub​(int[] prank,
                                  int[] rank)
              DOCUMENT ME!
            • dnrm2

              private DoubleDouble dnrm2​(int n,
                                         DoubleDouble[] x,
                                         int incx)
              DOCUMENT ME!
              Parameters:
              n - DOCUMENT ME!
              x - DOCUMENT ME!
              incx - DOCUMENT ME!
              Returns:
              DOCUMENT ME!
            • evreuc

              private void evreuc​(int[] prank)
              DOCUMENT ME!
            • fsumsq

              private void fsumsq​(DoubleDouble alfk,
                                  DoubleDouble[] xnew,
                                  DoubleDouble[] fnew,
                                  DoubleDouble[] fn_val,
                                  int[] ctrl)
              DOCUMENT ME!
              Parameters:
              alfk - DOCUMENT ME!
              xnew - DOCUMENT ME!
              fnew - DOCUMENT ME!
              phiMat - DOCUMENT ME!
            • gnavuc

              private void gnavuc()
              DOCUMENT ME!
            • gndunc

              private DoubleDouble gndunc​(boolean internalScaling,
                                          int[] prank,
                                          DoubleDouble[] work)
              DOCUMENT ME!
              Parameters:
              internalScaling - DOCUMENT ME!
              pseudoRankMat - DOCUMENT ME!
              work - DOCUMENT ME!
              Returns:
              DOCUMENT ME!
            • hess

              private void hess()
              DOCUMENT ME!
            • jacdif

              private void jacdif​(int[] ctrl)
              DOCUMENT ME!
            • jtrj

              private void jtrj​(int nn)
              DOCUMENT ME!
              Parameters:
              nn - DOCUMENT ME!
            • lineuc

              private void lineuc​(DoubleDouble[] gmod,
                                  DoubleDouble dphize,
                                  DoubleDouble alplow)
              DOCUMENT ME!
              Parameters:
              gmod - DOCUMENT ME!
              dphize - DOCUMENT ME!
              alplow - DOCUMENT ME!
            • lsunc

              private void lsunc()
              DOCUMENT ME!
            • minrm1

              private void minrm1​(DoubleDouble[] v2)
              DOCUMENT ME!
              Parameters:
              v2 - DOCUMENT ME!
            • minrm2

              private void minrm2()
              DOCUMENT ME!
            • newunc

              private void newunc()
              DOCUMENT ME!
            • oner

              private void oner​(DoubleDouble[] x)
              DOCUMENT ME!
            • outuc

              private void outuc()
              DOCUMENT ME!
            • pivec

              private void pivec​(DoubleDouble[] work)
              DOCUMENT ME!
              Parameters:
              work - DOCUMENT ME!
            • pregn

              private void pregn​(DoubleDouble[] work,
                                 int mindim,
                                 int[] prank,
                                 int[] dim)
              DOCUMENT ME!
              Parameters:
              work - DOCUMENT ME!
              mindim - DOCUMENT ME!
            • presub

              private void presub​(DoubleDouble[] work,
                                  int[] prank,
                                  int[] rank)
              DOCUMENT ME!
              Parameters:
              work - DOCUMENT ME!
            • reavuc

              private void reavuc()
              DOCUMENT ME!
            • releps

              private void releps()
              DOCUMENT ME!
            • rtrw1

              private void rtrw1​(int nn)
              DOCUMENT ME!
              Parameters:
              nn - DOCUMENT ME!
            • scalv

              private void scalv​(DoubleDouble[] v,
                                 DoubleDouble factor,
                                 int n)
              DOCUMENT ME!
              Parameters:
              v - DOCUMENT ME!
              factor - DOCUMENT ME!
              n - DOCUMENT ME!
            • scaunc

              private void scaunc()
              DOCUMENT ME!
            • schdc

              private void schdc​(int nn,
                                 int[] jpvt,
                                 int job)
              DOCUMENT ME!
              Parameters:
              nn - DOCUMENT ME!
              jpvt - DOCUMENT ME!
              job - DOCUMENT ME!
            • secuc

              private void secuc()
              DOCUMENT ME!
            • soliuc

              private void soliuc​(DoubleDouble tau,
                                  int[] prank)
              DOCUMENT ME!
              Parameters:
              tau - DOCUMENT ME!
            • sposl

              private void sposl​(int nn)
              DOCUMENT ME!
              Parameters:
              nn - DOCUMENT ME!
            • sqrdc

              private void sqrdc​(DoubleDouble[][] x,
                                 int n,
                                 int p,
                                 DoubleDouble[] qraux,
                                 int[] jpvt,
                                 int job)
              DOCUMENT ME!
              Parameters:
              x - DOCUMENT ME!
              n - DOCUMENT ME!
              p - DOCUMENT ME!
              qraux - DOCUMENT ME!
              jpvt - DOCUMENT ME!
              job - DOCUMENT ME!
            • stepuc

              private void stepuc​(int[] prank)
              DOCUMENT ME!
            • strsl

              private void strsl​(int[] prank,
                                 DoubleDouble[] b)
              DOCUMENT ME!
              Parameters:
              b - DOCUMENT ME!
            • subuc

              private void subuc​(int[] prank,
                                 int[] rank)
              DOCUMENT ME!
            • termuc

              private void termuc​(int[] prank,
                                  DoubleDouble aNorm)
              DOCUMENT ME!
              Parameters:
              aNorm - DOCUMENT ME!
            • triunc

              private void triunc​(DoubleDouble tol,
                                  int constraintAct,
                                  int[] prank)
              DOCUMENT ME!
              Parameters:
              tol - DOCUMENT ME!
              constraintAct - DOCUMENT ME!
            • twor

              private void twor()
              DOCUMENT ME!