Package math.matrix.expressParser
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.StringgetCreatingExpression()MatrixgetMatrix()java.lang.StringgetName()static booleanisMatrixVariableName(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 voidmain(java.lang.String[] args)voidsetMatrix(Matrix matrix)voidsetMatrixVariable(java.lang.String expression)voidsetName(java.lang.String name)java.lang.StringtoString()
-
Constructor Details
-
MatrixVariable
- 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
-
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:
toStringin classjava.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)
-