Class MatrixVariable

java.lang.Object
math.matrix.expressParser.MatrixVariable

public class MatrixVariable
extends java.lang.Object
Author:
JIBOYE Oluwagbemiro Olaoluwa
  • Constructor Summary

    Constructors 
    Constructor Description
    MatrixVariable​(java.lang.String name, java.lang.String expression)
    Here an expression like A=[2,3,4:-2,3,4:5,1,20] is passed into the constructor.
    MatrixVariable​(java.lang.String name, Matrix matrix)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getCreatingExpression()  
    Matrix getMatrix()  
    java.lang.String getName()  
    static boolean isMatrixVariableName​(java.lang.String name)
    A + B + 2*C + A.B - A.B^5 + 3*4*A^2*C+I Matrix names must start with # in this syntax.
    static void main​(java.lang.String[] args)  
    void setMatrix​(Matrix matrix)  
    void setMatrixVariable​(java.lang.String expression)  
    void setName​(java.lang.String name)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MatrixVariable

      public MatrixVariable​(java.lang.String name, Matrix matrix)
      Parameters:
      name - The name of the Matrix object.
      matrix - The Matrix object used to set the Matrix value stored by this MatrixVariable object.
    • MatrixVariable

      public MatrixVariable​(java.lang.String name, java.lang.String expression)
      Here an expression like A=[2,3,4:-2,3,4:5,1,20] is passed into the constructor.
      Parameters:
      name - The name of the matrix.
      expression - The compound expression containing information useful in creating the MatrixVariable object..e.g [2,3,4:-2,3,4:5,1,20]
  • Method Details

    • setMatrixVariable

      public void setMatrixVariable​(java.lang.String expression)
    • setMatrix

      public void setMatrix​(Matrix matrix)
    • getMatrix

      public Matrix getMatrix()
    • getName

      public java.lang.String getName()
    • setName

      public void setName​(java.lang.String name)
    • getCreatingExpression

      public java.lang.String getCreatingExpression()
      Returns:
      the equivalent string expression that creates the matrix variable and stores its present matrix value in it.
    • isMatrixVariableName

      public static boolean isMatrixVariableName​(java.lang.String name)
      A + B + 2*C + A.B - A.B^5 + 3*4*A^2*C+I Matrix names must start with # in this syntax.
      Parameters:
      name - The string to be checked if or not it represents a valid matrix name.
      Returns:
      true if the name represents a valid matrix name.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
      Returns:
      the view of the matrix in the format...A = num1, num2, num3 ....numi numi+1,numi+2,numi+3....numj numj+1,numj+2,numj+3....numk e.t.c.
    • main

      public static void main​(java.lang.String[] args)