Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.lsmp.djep.vectorJep.function
Class Diagonal

    java.lang.Object
      org.nfunk.jep.function.PostfixMathCommand
          org.lsmp.djep.vectorJep.function.Diagonal

All Implemented Interfaces:
  UnaryOperatorI, PostfixMathCommandI

    public class Diagonal

extends PostfixMathCommand
implements UnaryOperatorI

Creates a diagonal matrix, with a given vector as diagonals elements. diag([1,2,3]) -> [[1,0,0],[0,2,0],[0,0,3]]

Author:
  Rich Morris Created on 13-Feb-2005

Field Summary

Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
`curNumberOfParameters, numberOfParameters`

Constructor Summary
`Diagonal()`

Method Summary
`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.
`void` | `run(java.util.Stack s)` Throws an exception because this method should never be called under normal circumstances.

Methods inherited from class org.nfunk.jep.function.PostfixMathCommand
`checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParameters`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.nfunk.jep.function.PostfixMathCommandI
`checkNumberOfParameters, getNumberOfParameters, setCurNumberOfParameters`

Constructor Detail

### Diagonal

    public Diagonal()

Method Detail

### calcDim

    public Dimensions calcDim(Dimensions ldim)

  Description copied from interface: `UnaryOperatorI`
  Find the dimensions of this operator when applied to arguments with given dimensions.

  Specified by:
    `calcDim` in interface `UnaryOperatorI`

### calcValue

    public MatrixValueI calcValue(MatrixValueI res,
                                  MatrixValueI lhs)
                           throws ParseException

  Description copied from interface: `UnaryOperatorI`
  Calculates the value of this operator for given input with results stored in res. res is returned. Using this method is slightly faster than the standard run method as it eliminates the construction of tempoary objects.

  Specified by:
    `calcValue` in interface `UnaryOperatorI`
  Throws:
    `ParseException`

### run

    public void run(java.util.Stack s)
             throws ParseException

  Description copied from class: `PostfixMathCommand`
  Throws an exception because this method should never be called under normal circumstances. Each function should use it's own run() method for evaluating the function. This includes popping off the parameters from the stack, and pushing the result back on the stack.

  Specified by:
    `run` in interface `PostfixMathCommandI`
  Overrides:
    `run` in class `PostfixMathCommand`
  Throws:
    `ParseException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

http://www.singularsys.com/jep Copyright © 2007 Singular Systems