public class Determinant extends PostfixMathCommand implements UnaryOperatorI
curNumberOfParameters, numberOfParameters| Constructor and Description |
|---|
Determinant() |
| Modifier and Type | Method and Description |
|---|---|
Dimensions |
calcDim(Dimensions ldim)
Find the dimensions of this operator when applied to arguments with given dimensions.
|
MatrixValueI |
calcValue(MatrixValueI res,
MatrixValueI lhs)
Calculates the value of this operator for given input with results stored in res.
|
Object |
det(Object[][] mat)
Calculates the determinant of an array
Uses the fact that
| a b c |
| d e f | = a | e f | - b | d f | + c | d e |
| g h i | | h i | | g i | | g i |
|
static Object[][] |
dropRowCol(Object[][] mat,
int xrow,
int xcol)
returns a matrix excluding the specifyed row and column
|
void |
run(Stack s)
Throws an exception because this method should never be called under
normal circumstances.
|
checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParametersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckNumberOfParameters, getNumberOfParameters, setCurNumberOfParameterspublic Dimensions calcDim(Dimensions ldim)
UnaryOperatorIcalcDim in interface UnaryOperatorIpublic MatrixValueI calcValue(MatrixValueI res, MatrixValueI lhs) throws ParseException
UnaryOperatorIcalcValue in interface UnaryOperatorIParseExceptionpublic static Object[][] dropRowCol(Object[][] mat, int xrow, int xcol)
public Object det(Object[][] mat) throws ParseException
ParseExceptionpublic void run(Stack s) throws ParseException
PostfixMathCommandrun in interface PostfixMathCommandIrun in class PostfixMathCommandParseExceptionCopyright © 2018. All rights reserved.