com.epochx.representation.dbl
Class SecantFunction

java.lang.Object
  extended by com.epochx.representation.Node<TYPE>
      extended by com.epochx.representation.FunctionNode<java.lang.Double>
          extended by com.epochx.representation.dbl.SecantFunction
All Implemented Interfaces:
java.lang.Cloneable

public class SecantFunction
extends FunctionNode<java.lang.Double>

A FunctionNode which performs the reciprocal trigonometric function of secant. Secant x is equal to 1/cos x.


Constructor Summary
SecantFunction()
          Construct a SecantFunction with no children.
SecantFunction(Node<java.lang.Double> child)
          Construct a SecantFunction with one child.
 
Method Summary
 java.lang.Double evaluate()
          Evaluating a SecantFunction involves calculating cos of the child once it's been evaluated, then dividing 1 by the result.
 java.lang.String getFunctionName()
          Get the unique name that identifies this function.
 
Methods inherited from class com.epochx.representation.FunctionNode
equals, toString
 
Methods inherited from class com.epochx.representation.Node
clone, getArity, getChild, getChildren, getDepth, getFunctionNodes, getLength, getNodesAtDepth, getNoDistinctFunctions, getNoDistinctTerminals, getNoFunctions, getNoTerminals, getNthNode, getTerminalNodes, hashCode, setChild, setChildren, setNthNode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SecantFunction

public SecantFunction()
Construct a SecantFunction with no children.


SecantFunction

public SecantFunction(Node<java.lang.Double> child)
Construct a SecantFunction with one child. When evaluated, the child will be evaluated with secant performed on the result.

Parameters:
child - The child which secant will be performed on.
Method Detail

evaluate

public java.lang.Double evaluate()
Evaluating a SecantFunction involves calculating cos of the child once it's been evaluated, then dividing 1 by the result.

Specified by:
evaluate in class Node<java.lang.Double>
Returns:
The result of evaluating the candidate program.

getFunctionName

public java.lang.String getFunctionName()
Get the unique name that identifies this function.

Specified by:
getFunctionName in class FunctionNode<java.lang.Double>
Returns:
the unique name for the SecantFunction which is SEC.