Class NL2sol

java.lang.Object
gov.nih.mipav.model.algorithms.NL2sol
Direct Known Subclasses:
AlgorithmELSUNCOpt2D.FitOAR2DNL2solModel, AlgorithmELSUNCOpt3D.FitOAR3DNL2solModel, AlgorithmFRAP.FitDoubleExponentialNoWholeNL2solModel, AlgorithmFRAP.FitPure1DNoWholeModel, AlgorithmFRAP.FitSingleExponentialNoWholeModel, AlgorithmFRAP.FitWholeNL2solInt2, AlgorithmFRAP.FitWholeNL2solModel, AlgorithmSM2.FitAllNL2, AlgorithmSM2.FitSM2nl2solModel, SchwarzChristoffelMapping2.stpfun2

public abstract class NL2sol extends Object
This is a port of the source code nl2sol.f90 and the nl2sol_prb2.f90 extensive set of tests from FORTRAN into Java. Unconstrained non-linear least squares solver algorithm.

From the ACM website:

 ACM Software License Agreement
 
  All software, both binary and source published by the Association for Computing Machinery (hereafter, Software) is copyrighted by the Association (hereafter, ACM) and ownership of all right, title and interest in and to the Software remains with ACM. By using or copying the Software, User agrees to abide by the terms of this Agreement.
  Noncommercial Use
 
  The ACM grants to you (hereafter, User) a royalty-free, nonexclusive right to execute, copy, modify and distribute both the binary and source code solely for academic, research and other similar noncommercial uses, subject to the following conditions:
 
  1. User acknowledges that the Software is still in the development stage and that it is being supplied "as is," without any support services from ACM. Neither ACM nor the author makes any representations or warranties, express or implied, including, without limitation, any representations or warranties of the merchantability or fitness for any particular purpose, or that the application of the software, will not infringe on any patents or other proprietary rights of others.
  2. ACM shall not be held liable for direct, indirect, incidental or consequential damages arising from any claim by User or any third party with respect to uses allowed under this Agreement, or from any use of the Software.
  3. User agrees to fully indemnify and hold harmless ACM and/or the author(s) of the original work from and against any and all claims, demands, suits, losses, damages, costs and expenses arising out of the User's use of the Software, including, without limitation, arising out of the User's modification of the Software.
  4. User may modify the Software and distribute that modified work to third parties provided that: (a) if posted separately, it clearly acknowledges that it contains material copyrighted by ACM (b) no charge is associated with such copies, (c) User agrees to notify ACM and the Author(s) of the distribution, and (d) User clearly notifies secondary users that such modified work is not the original Software.
  5. User agrees that ACM, the authors of the original work and others may enjoy a royalty-free, non-exclusive license to use, copy, modify and redistribute these modifications to the Software made by the User and distributed to third parties as a derivative work under this agreement.
  6. This agreement will terminate immediately upon User's breach of, or non-compliance with, any of its terms. User may be held liable for any copyright infringement or the infringement of any other proprietary rights in the Software that is caused or facilitated by the User's failure to abide by the terms of this agreement.
  7. This agreement will be construed and enforced in accordance with the law of the state of New York applicable to contracts performed entirely within the State. The parties irrevocably consent to the exclusive jurisdiction of the state or federal courts located in the City of New York for all disputes concerning this agreement. 
 
  Commercial Use
 
  Any User wishing to make a commercial use of the Software must contact ACM at permissions@acm.org to arrange an appropriate license. Commercial use includes (1) integrating or incorporating all or part of the source code into a product for sale or license by, or on behalf of, User to third parties, or (2) distribution of the binary or source code to third parties for use with a commercial product sold or licensed by, or on behalf of, User.
 
  Revised 6/98
 

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private double
     
    private boolean
     
    private double
     
    private double
     
    private double
     
    private double
     
    private double
     
    private double
     
    private double
     
    private String[]
     
    private int[][]
     
    private int[]
     
    private double
     
    private int
     
    private String[]
     
    private int
     
    private int
     
    private int
     
    private int
     
    private final int
     
    private double
     
    private double[][]
     
    private double
     
    private double
     
    private double
     
    private boolean
     
    private double
    2**-1022 = D1MACH(1).
    private double
     
    private double
     
    private double
     
    private int[]
     
    private double[]
     
    private double[]
     
    private double[]
     
    private boolean
     
    private double[]
     
    private double[]
     
    private double[]
     
    private double[]
     
    private double[]
     
    private double[]
     
    private double[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    NL2sol(int n, int p, double[] x, int[] iv, double[] v, boolean useAnalyticJacobian, int[] uiparm, double[] urparm)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    assess(double[] d, int[] iv, int p, double[] step, double[] stlstg, double[] v, double[] x, double[] x0)
     
    abstract void
    calcj(int meqn, int nvar, double[] x, int nf, double[][] jac, int[] uiparm, double[] urparm)
     
    private void
    calcjTest(int n, int p, double[] x, int nfcall, double[][] jac, int[] uiparm, double[] urparm)
     
    abstract void
    calcr(int meqn, int nvar, double[] x, int[] nf, double[] r, int[] uiparm, double[] urparm)
     
    private void
    calcrTest(int n, int p, double[] x, int[] nfcall, double[] r, int[] uiparm, double[] urparm)
     
    private void
    covclc(int[] covirc, double[] d, int[] iv, double[][] j, int n, int nn, int p, double[] r, double[] v, double[] x)
     
    private void
    dfault(int[] iv, double[] v)
     
    private double
    dotprd(int p, double[] x, double[] y)
     
    void
     
    private void
    dupdat(double[] d, int[] iv, double[][] j, int n, int nn, int p, double[] v)
     
    double
    getChiSquared - accessor to chi-squared value (goodness-of-fit measure).
    int
     
    private void
    gqtstp(double[] d, double[] dig, double[] dihdi, int[] ka, double[] l, int p, double[] step, double[] v, double[] w)
     
    private void
    itsmry(double[] d, int[] iv, int p, double[] v, double[] x)
     
    private void
    linvrt(int n, double[] lin, double[] l)
     
    private void
    litvmu(int n, double[] x, double[] l, double[] y)
     
    private void
    livmul(int n, double[] x, double[] l, double[] y)
     
    private void
    lmstep(double[] d, double[] g, int[] ierr, int[] ipivot, int[] ka, int p, double[] qtr, double[] r, double[] step, double[] v, double[] w)
     
    private void
    lsqrt(int n1, int n, double[] l, double[] a, int[] irc)
     
    private double
    lsvmin(int p, double[] l, double[] x, double[] y)
     
    private void
    ltsqar(int n, double[] a, double[] l)
     
    private void
     
    private void
    nl2itr(double[] d, int[] iv, double[][] j, int n, int nn, int p, double[] r, double[] v, double[] x)
     
    void
     
    void
     
    private void
    nltest(String title, boolean rstart, int xscal1, int xscal2)
     
    private void
    parchk(int[] iv, int n, int nn, int p, double[] v)
     
    private void
    qapply(int nn, int n, int p, double[][] j, double[] r, int ierr)
     
    private void
    qrfact(int nm, int m, int n, double[][] qr, double[] alpha, int[] ipivot, int[] ierr, int nopivk, double[] sum)
     
    (package private) double
    reldst(int p, double[] d, double[] x, double[] x0)
     
    private void
    rptmul(int func, int[] ipivot, double[][] j, int nn, int p, double[] rd, double[] x, double[] y, double[] z)
     
    private void
    slupdt(double[] a, double cosmin, int p, double size, double[] step, double[] u, double[] w, double[] wchmtd, double[] wscale, double[] y)
     
    private void
    slvmul(int p, double[] y, double[] s, double[] x)
     
    void
    statusMessageNL2sol(int status, int numParam)
     
    private boolean
    stopx(int[] idummy)
     
    private void
     
    private double
    v2norm(int p, double[] x)
     
    private void
    xinit(int p, double[] x, int nex)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • testMode

      private boolean testMode
    • tiny

      private double tiny
      2**-1022 = D1MACH(1).
    • epsilon

      private double epsilon
    • huge

      private double huge
    • expmin_calcjTest

      private double expmin_calcjTest
    • uftolg_calcjTest

      private double uftolg_calcjTest
    • ukow_calcjTest

      private double[] ukow_calcjTest
    • expmax_calcrTest

      private double expmax_calcrTest
    • expmin_calcrTest

      private double expmin_calcrTest
    • uftolg_calcrTest

      private double uftolg_calcrTest
    • ukow_calcrTest

      private double[] ukow_calcrTest
    • ybard_calcrTest

      private double[] ybard_calcrTest
    • ykow_calcrTest

      private double[] ykow_calcrTest
    • ymeyer_calcrTest

      private double[] ymeyer_calcrTest
    • yosb1_calcrTest

      private double[] yosb1_calcrTest
    • yosb2_calcrTest

      private double[] yosb2_calcrTest
    • sqteta_dotprd

      private double sqteta_dotprd
    • dgxfac_gqtstp

      private double dgxfac_gqtstp
    • ix_lsvmin

      private double ix_lsvmin
    • hlim_nl2sno

      private double hlim_nl2sno
    • big_parchk

      private double big_parchk
    • teensy_parchk

      private double teensy_parchk
    • rktol_qrfact

      private double rktol_qrfact
    • ufeta_qrfact

      private double ufeta_qrfact
    • sqteta_v2norm

      private double sqteta_v2norm
    • n

      private int n
    • p

      private int p
    • x

      private double[] x
    • iv

      private int[] iv
    • v

      private double[] v
    • useAnalyticJacobian

      private boolean useAnalyticJacobian
    • uiparm

      private int[] uiparm
    • urparm

      private double[] urparm
    • detailedSummaryPrinting

      private boolean detailedSummaryPrinting
    • prob_max

      private final int prob_max
      See Also:
    • irc

      private String[] irc
    • is

      private int[][] is
    • name

      private String[] name
    • nout

      private int nout
    • nprob

      private int nprob
    • rs

      private double[][] rs
    • nex

      private int nex
  • Constructor Details

    • NL2sol

      public NL2sol()
    • NL2sol

      public NL2sol(int n, int p, double[] x, int[] iv, double[] v, boolean useAnalyticJacobian, int[] uiparm, double[] urparm)
  • Method Details

    • main

      private void main()
    • nltest

      private void nltest(String title, boolean rstart, int xscal1, int xscal2)
    • xinit

      private void xinit(int p, double[] x, int nex)
    • driver

      public void driver()
    • getChiSquared

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

      public int getIterations()
    • nl2sol

      public void nl2sol()
    • nl2sno

      public void nl2sno()
    • assess

      private void assess(double[] d, int[] iv, int p, double[] step, double[] stlstg, double[] v, double[] x, double[] x0)
    • calcj

      public abstract void calcj(int meqn, int nvar, double[] x, int nf, double[][] jac, int[] uiparm, double[] urparm)
    • calcjTest

      private void calcjTest(int n, int p, double[] x, int nfcall, double[][] jac, int[] uiparm, double[] urparm)
    • calcr

      public abstract void calcr(int meqn, int nvar, double[] x, int[] nf, double[] r, int[] uiparm, double[] urparm)
    • calcrTest

      private void calcrTest(int n, int p, double[] x, int[] nfcall, double[] r, int[] uiparm, double[] urparm)
    • covclc

      private void covclc(int[] covirc, double[] d, int[] iv, double[][] j, int n, int nn, int p, double[] r, double[] v, double[] x)
    • dfault

      private void dfault(int[] iv, double[] v)
    • dotprd

      private double dotprd(int p, double[] x, double[] y)
    • dupdat

      private void dupdat(double[] d, int[] iv, double[][] j, int n, int nn, int p, double[] v)
    • gqtstp

      private void gqtstp(double[] d, double[] dig, double[] dihdi, int[] ka, double[] l, int p, double[] step, double[] v, double[] w)
    • itsmry

      private void itsmry(double[] d, int[] iv, int p, double[] v, double[] x)
    • linvrt

      private void linvrt(int n, double[] lin, double[] l)
    • litvmu

      private void litvmu(int n, double[] x, double[] l, double[] y)
    • livmul

      private void livmul(int n, double[] x, double[] l, double[] y)
    • lmstep

      private void lmstep(double[] d, double[] g, int[] ierr, int[] ipivot, int[] ka, int p, double[] qtr, double[] r, double[] step, double[] v, double[] w)
    • lsqrt

      private void lsqrt(int n1, int n, double[] l, double[] a, int[] irc)
    • lsvmin

      private double lsvmin(int p, double[] l, double[] x, double[] y)
    • ltsqar

      private void ltsqar(int n, double[] a, double[] l)
    • nl2itr

      private void nl2itr(double[] d, int[] iv, double[][] j, int n, int nn, int p, double[] r, double[] v, double[] x)
    • parchk

      private void parchk(int[] iv, int n, int nn, int p, double[] v)
    • qapply

      private void qapply(int nn, int n, int p, double[][] j, double[] r, int ierr)
    • qrfact

      private void qrfact(int nm, int m, int n, double[][] qr, double[] alpha, int[] ipivot, int[] ierr, int nopivk, double[] sum)
    • reldst

      double reldst(int p, double[] d, double[] x, double[] x0)
    • rptmul

      private void rptmul(int func, int[] ipivot, double[][] j, int nn, int p, double[] rd, double[] x, double[] y, double[] z)
    • slupdt

      private void slupdt(double[] a, double cosmin, int p, double size, double[] step, double[] u, double[] w, double[] wchmtd, double[] wscale, double[] y)
    • slvmul

      private void slvmul(int p, double[] y, double[] s, double[] x)
    • stopx

      private boolean stopx(int[] idummy)
    • timestamp

      private void timestamp()
    • v2norm

      private double v2norm(int p, double[] x)
    • statusMessageNL2sol

      public void statusMessageNL2sol(int status, int numParam)