Class DoubleMatrix

java.lang.Object
org.scictrl.mp.orbitcorrect.math.DoubleMatrix
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DispersionVector, DoubleVector, TransferMatrix

public class DoubleMatrix extends Object implements Cloneable

DoubleMatrix class.

Author:
igor@scictrl.com
  • Field Details

    • matrix

      protected final double[][] matrix
      Full matrix.
    • columns

      protected final int columns
      Number of columns.
    • rows

      protected final int rows
      Number of rows.
  • Constructor Details

    • DoubleMatrix

      public DoubleMatrix(int dimension)
      Creates new square matrix with specified dimension.
      Parameters:
      dimension - a int
    • DoubleMatrix

      public DoubleMatrix(int rows, int columns)
      Creates new matrix with specified number of rows and columns.
      Parameters:
      rows - a int
      columns - a int
  • Method Details

    • canJoin

      public boolean canJoin(DoubleMatrix matrix)
      Test if can be joined with this matrix.
      Parameters:
      matrix - DoubleMatrix
      Returns:
      boolean
    • canMulitplay

      public boolean canMulitplay(DoubleMatrix matrix)
      Test if can be multiplied with this matrix.
      Parameters:
      matrix - DoubleMatrix
      Returns:
      boolean
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • columns

      public int columns()
      Nuber of columns in this matrix.
      Returns:
      double columns
    • dimensionEquals

      public boolean dimensionEquals(DoubleMatrix matrix)
      Test if dimensions of these matrices match.
      Parameters:
      matrix - DoubleMatrix
      Returns:
      boolean dimension equals
    • get

      public double get(int r, int c)
      Returns value from matrix at (row,column) position.
      Parameters:
      r - int row
      c - int column
      Returns:
      double value
    • identity

      public static final DoubleMatrix identity(int dim)

      identity.

      Parameters:
      dim - int
      Returns:
      DoubleMatrix
    • join

      public DoubleMatrix join(DoubleMatrix matrix)
      Multiplies matrix from right with this matrix and stores result in this matrix. Return Matrix is stih matrix.
      Parameters:
      matrix - DoubleMatrix
      Returns:
      DoubleMatrix this matrix =matrix times this matrix
    • multiplay

      public DoubleMatrix multiplay(DoubleMatrix matrix)
      Multiplies matrix from right with this matrix and returns result as new matrix
      Parameters:
      matrix - DoubleMatrix
      Returns:
      DoubleMatrix result=matrix times this matrix
    • rows

      public int rows()
      Nuber of rows in this matrix.
      Returns:
      double rows
    • toString

      public String toString()
      Overrides:
      toString in class Object