Java Doc for Function.java in  » Science » jscience-4.3.1 » org » jscience » mathematics » function » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » jscience 4.3.1 » org.jscience.mathematics.function 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jscience.mathematics.function.Function

Function
abstract public class Function implements Serializable,Realtime(Code)

This abstract class represents a mapping between two sets such that there is a unique element in the second set assigned to each element in the first set.

Functions can be discrete or continuous and multivariate functions (functions with multiple variables) are also supported as illustrated below:[code] // Defines local variables. Variable.Local varX = new Variable.Local("x"); Variable.Local varY = new Variable.Local("y"); // f(x, y) = x² + x·y + 1; Polynomial x = Polynomial.valueOf(Rational.ONE, varX); Polynomial y = Polynomial.valueOf(Rational.ONE, varY); Polynomial fx_y = x.pow(2).plus(x.times(y)).plus(Rational.ONE); System.out.println("f(x,y) = " + fx_y); // Evaluates f(1,0) System.out.println("f(1,0) = " + fx_y.evaluate(Rational.ONE, Rational.ZERO)); // Calculates df(x,y)/dx System.out.println("df(x,y)/dx = " + fx_y.differentiate(varX)); > f(x,y) = [1/1]x^2 + [1/1]xy + [1/1] > f(1,0) = 2/1 > df(x,y)/dx = [2/1]x + [1/1]y [/code]

Functions are often given by formula (e.g. f(x) = x²-x+1, f(x,y)= x·y) but the general function instance might tabulate the values, solve an equation, etc.


author:
   Jean-Marie Dautelle
version:
   3.1, April 1, 2006
See Also:    * Wikipedia: Functions (mathematics)



Constructor Summary
protected  Function()
     Default constructor.

Method Summary
public  Function<Z, Y>compose(Function<Z, X> that)
     Returns the composition of this function with the one specified.
Parameters:
  that - the function for which the return value is passed asargument to this function.
public  Function<X, Y>differentiate(Variable<X> v)
     Returns the first derivative of this function with respect to the specified variable.
public  Function<X, Y>divide(Function<X, Y> that)
     Returns the quotient of this function with the one specified. Evaluation of this function may raise an exception if the function result is not a {
Parameters:
  that - the function divisor.
public  booleanequals(Object obj)
     Indicates if this function is equals to the specified object.
Parameters:
  obj - the object to be compared with.
abstract public  Yevaluate()
     Evaluates this function using its Variable variables current values.
final public  Yevaluate(X arg)
     Evaluates this function for the specified argument value (convenience method).
final public  Yevaluate(X... args)
     Evaluates this function for the specified arguments values (convenience method).
final public  Variable<X>getVariable(String symbol)
     Retrieves the variable from this function having the specified symbol (convenience method).
abstract public  List<Variable<X>>getVariables()
     Returns a lexically ordered list of the variables (or arguments) for this function (empty list for constant functions).
public  inthashCode()
     Returns the hash code for this function (consistent with Function.equals(Object) .
public  Function<X, Y>integrate(Variable<X> v)
     Returns an integral of this function with respect to the specified variable.
final static  Listmerge(List left, List right)
    
public  Function<X, Y>minus(Function<X, Y> that)
     Returns the difference of this function with the one specified.
Parameters:
  that - the function to be subtracted.
public  Function<X, Y>plus(Function<X, Y> that)
     Returns the sum of this function with the one specified.
Parameters:
  that - the function to be added.
public  Function<X, Y>pow(int n)
     Returns this function raised at the specified exponent.
Parameters:
  n - the exponent.
public  Function<X, Y>times(Function<X, Y> that)
     Returns the product of this function with the one specified.
Parameters:
  that - the function multiplier.
final public  StringtoString()
     Returns the text representation of this function as a java.lang.String.
abstract public  TexttoText()
     Returns the textual representation of this real-time object (equivalent to toString except that the returned value can be allocated from the local context space).


Constructor Detail
Function
protected Function()(Code)
Default constructor.




Method Detail
compose
public Function<Z, Y> compose(Function<Z, X> that)(Code)
Returns the composition of this function with the one specified.
Parameters:
  that - the function for which the return value is passed asargument to this function. the function (this o that)
throws:
  FunctionException - if this function is not monovariate.



differentiate
public Function<X, Y> differentiate(Variable<X> v)(Code)
Returns the first derivative of this function with respect to the specified variable.
Parameters:
  v - the variable for which the derivative is calculated. d[this]/dv
See Also:    * Derivative -- from MathWorld
throws:
  FunctionException - if the derivative is undefined.



divide
public Function<X, Y> divide(Function<X, Y> that)(Code)
Returns the quotient of this function with the one specified. Evaluation of this function may raise an exception if the function result is not a {
Parameters:
  that - the function divisor. this / that.



equals
public boolean equals(Object obj)(Code)
Indicates if this function is equals to the specified object.
Parameters:
  obj - the object to be compared with. true if this function and the specified argumentrepresent the same function; false otherwise.



evaluate
abstract public Y evaluate()(Code)
Evaluates this function using its Variable variables current values. the evaluation of this function.
throws:
  FunctionException - if any of this function's variable is not set.



evaluate
final public Y evaluate(X arg)(Code)
Evaluates this function for the specified argument value (convenience method). The evaluation is performed in a javolution.context.LocalContext LocalContext and can safely be called upon functions with Variable.Global globalvariables .
Parameters:
  arg - the single variable value used for the evaluation. the evaluation of this function.
throws:
  FunctionException - if getVariables().size() != 1



evaluate
final public Y evaluate(X... args)(Code)
Evaluates this function for the specified arguments values (convenience method). The evaluation is performed in a javolution.context.LocalContext LocalContext and can safely be called upon functions with Variable.Global globalvariables .
Parameters:
  args - the variables values used for the evaluation. the evaluation of this function.
throws:
  IllegalArgumentException - if args.length != getVariables().size())



getVariable
final public Variable<X> getVariable(String symbol)(Code)
Retrieves the variable from this function having the specified symbol (convenience method). the variable having the specified symbol or nullif none.



getVariables
abstract public List<Variable<X>> getVariables()(Code)
Returns a lexically ordered list of the variables (or arguments) for this function (empty list for constant functions). this function current unset variables (sorted).



hashCode
public int hashCode()(Code)
Returns the hash code for this function (consistent with Function.equals(Object) . this function hash code.



integrate
public Function<X, Y> integrate(Variable<X> v)(Code)
Returns an integral of this function with respect to the specified variable.
Parameters:
  v - the variable for which the integral is calculated. S[this·dv]
See Also:    * Integral -- from MathWorld



merge
final static List merge(List left, List right)(Code)



minus
public Function<X, Y> minus(Function<X, Y> that)(Code)
Returns the difference of this function with the one specified.
Parameters:
  that - the function to be subtracted. this - that.



plus
public Function<X, Y> plus(Function<X, Y> that)(Code)
Returns the sum of this function with the one specified.
Parameters:
  that - the function to be added. this + that.



pow
public Function<X, Y> pow(int n)(Code)
Returns this function raised at the specified exponent.
Parameters:
  n - the exponent. thisn
throws:
  IllegalArgumentException - if n <= 0



times
public Function<X, Y> times(Function<X, Y> that)(Code)
Returns the product of this function with the one specified.
Parameters:
  that - the function multiplier. this · that.



toString
final public String toString()(Code)
Returns the text representation of this function as a java.lang.String. toText().toString()



toText
abstract public Text toText()(Code)
Returns the textual representation of this real-time object (equivalent to toString except that the returned value can be allocated from the local context space). this object's textual representation.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.