Class MatrixListItem

  • All Implemented Interfaces:
    java.lang.Comparable<MatrixListItem>

    public class MatrixListItem
    extends java.lang.Object
    implements java.lang.Comparable<MatrixListItem>
    Helper class to make it easy to store the necessary information about a minimum. Stores the "point", or vector at which the minimum was reached; the "cost", or value of the cost function at that minimum; and the matrix, which was the true input into the cost function and represents the transformation that gives the minimum cost of differences between the images. Implements Comparable, so that a list of MatrixListItems can be sorted using Java's sort.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double cost
      Cost of function at this minimum.
      protected TransMatrix halfMatrix
      Matrix with the best transformation divided by half.
      protected TransMatrixd halfMatrixd
      Matrix with the best transformation divided by half.
      protected double[] initial
      Rotations, translations, scales, and skews that make up transformation.
      protected TransMatrix matrix
      Matrix that gives best transformation.
      protected TransMatrixd matrixd
      Matrix that gives best transformation.
      protected TransMatrix midsagMatrix
      Matrix with the best transformation's z rot and xy translations.
      protected TransMatrixd midsagMatrixd
      Matrix with the best transformation's z rot and xy translations.
    • Constructor Summary

      Constructors 
      Constructor Description
      MatrixListItem​(double _cost, TransMatrixd _matrix, double[] _initial)
      Creates new minimum object, setting the data and copying the point array explicitly.
      MatrixListItem​(double _cost, TransMatrix _matrix, double[] _initial)
      Creates new minimum object, setting the data and copying the point array explicitly.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(MatrixListItem o)
      Necessary to implement so that list may be sorted.
      double getCost()
      Returns the cost.
      java.lang.String toAbridgedString()
      Creates string of this object with just first 6DOF and cost.
      java.lang.String toString()
      Creates readable string of this object, including cost, matrix, and point with its meanings.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • cost

        protected double cost
        Cost of function at this minimum.
      • halfMatrix

        protected TransMatrix halfMatrix
        Matrix with the best transformation divided by half. Might be null.
      • halfMatrixd

        protected TransMatrixd halfMatrixd
        Matrix with the best transformation divided by half. Might be null.
      • initial

        protected double[] initial
        Rotations, translations, scales, and skews that make up transformation.
      • matrix

        protected TransMatrix matrix
        Matrix that gives best transformation.
      • matrixd

        protected TransMatrixd matrixd
        Matrix that gives best transformation.
      • midsagMatrix

        protected TransMatrix midsagMatrix
        Matrix with the best transformation's z rot and xy translations. Might be null.
      • midsagMatrixd

        protected TransMatrixd midsagMatrixd
        Matrix with the best transformation's z rot and xy translations. Might be null.
    • Constructor Detail

      • MatrixListItem

        public MatrixListItem​(double _cost,
                              TransMatrix _matrix,
                              double[] _initial)
        Creates new minimum object, setting the data and copying the point array explicitly.
        Parameters:
        _cost - Cost of this minimum.
        _matrix - Matrix that gives best transformation.
        _initial - Rotations, translations, scales, and skews that make up transformation.
      • MatrixListItem

        public MatrixListItem​(double _cost,
                              TransMatrixd _matrix,
                              double[] _initial)
        Creates new minimum object, setting the data and copying the point array explicitly.
        Parameters:
        _cost - Cost of this minimum.
        _matrix - Matrix that gives best transformation.
        _initial - Rotations, translations, scales, and skews that make up transformation.
    • Method Detail

      • compareTo

        public int compareTo​(MatrixListItem o)
        Necessary to implement so that list may be sorted. Returns -1 if this cost is less than the parameter's cost; 1 if this cost is greater than the parameter's cost; and 0 if they are equal.
        Specified by:
        compareTo in interface java.lang.Comparable<MatrixListItem>
        Parameters:
        o - MatrixListItem to compare to.
        Returns:
        -1 if this is less than, 1 if greater than, 0 if equal.
      • toAbridgedString

        public java.lang.String toAbridgedString()
        Creates string of this object with just first 6DOF and cost.
        Returns:
        Readable string representation of this object.
      • toString

        public java.lang.String toString()
        Creates readable string of this object, including cost, matrix, and point with its meanings.
        Overrides:
        toString in class java.lang.Object
        Returns:
        Readable string representation of this object.
      • getCost

        public double getCost()
        Returns the cost.
        Returns: