hhreco.fragmentation
Class FittingUtil

java.lang.Object
  extended byhhreco.fragmentation.FittingUtil

public class FittingUtil
extends java.lang.Object

This class contains routines used during fragmentation and fitting.


Constructor Summary
FittingUtil()
           
 
Method Summary
static void choldc(double[][] a, int n, double[][] l)
           
static void draw_conic(double[] pvec, int nptsk, double[][] points, double[] thetas)
           
static void eigen(double[][] m, double[] eigenvalues, double[][] eigenvectors)
          Find the eigenvalues for 2x2 matrix m.
static boolean ellipticalFit(double[] xvals, double[] yvals, int np, double[] params)
          Given a set of points, calculate the ellipse that best fit this set of points.
static int inverse(double[][] TB, double[][] InvB, int N)
           
static void jacobi(double[][] a, int n, double[] d, double[][] v, int nrot)
          Computes the eigenvectors(v) and eigenvalues(d) of matrix 'a'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FittingUtil

public FittingUtil()
Method Detail

eigen

public static void eigen(double[][] m,
                         double[] eigenvalues,
                         double[][] eigenvectors)
Find the eigenvalues for 2x2 matrix m. indices starts at 1, similar to matlab format.


ellipticalFit

public static boolean ellipticalFit(double[] xvals,
                                    double[] yvals,
                                    int np,
                                    double[] params)
Given a set of points, calculate the ellipse that best fit this set of points. Return the parameters of the ellipse. Return true if an elliptical fit is successful, otherwise return false. False is returned when the number of points is less than 6 and when all parameters are 0. The properties array is of size 2. Index 0 stores the fit error, and index 1 stores the eccentricity of the ellipse.


jacobi

public static void jacobi(double[][] a,
                          int n,
                          double[] d,
                          double[][] v,
                          int nrot)
Computes the eigenvectors(v) and eigenvalues(d) of matrix 'a'. 'n' specifies the dimension of the matrix.


choldc

public static void choldc(double[][] a,
                          int n,
                          double[][] l)

inverse

public static int inverse(double[][] TB,
                          double[][] InvB,
                          int N)

draw_conic

public static void draw_conic(double[] pvec,
                              int nptsk,
                              double[][] points,
                              double[] thetas)