commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1392963 - in /commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward: ForwardModeDifferentiator.java analysis/ClassDifferentiator.java
Date Tue, 02 Oct 2012 15:14:48 GMT
Author: luc
Date: Tue Oct  2 15:14:48 2012
New Revision: 1392963

URL: http://svn.apache.org/viewvc?rev=1392963&view=rev
Log:
Use types instead of descriptors for methods.

Modified:
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/ForwardModeDifferentiator.java
    commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/ForwardModeDifferentiator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/ForwardModeDifferentiator.java?rev=1392963&r1=1392962&r2=1392963&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/ForwardModeDifferentiator.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/ForwardModeDifferentiator.java
Tue Oct  2 15:14:48 2012
@@ -179,8 +179,8 @@ public class ForwardModeDifferentiator i
                 new ClassDifferentiator(differentiableClass, mathClasses);
             final Type dsType = Type.getType(DerivativeStructure.class);
             differentiator.differentiateMethod("value",
-                                               Type.getMethodDescriptor(Type.DOUBLE_TYPE,
Type.DOUBLE_TYPE),
-                                               Type.getMethodDescriptor(dsType, dsType));
+                                               Type.getMethodType(Type.DOUBLE_TYPE, Type.DOUBLE_TYPE),
+                                               Type.getMethodType(dsType, dsType));
 
             // create the derivative class
             final ClassNode   derived = differentiator.getDerivedClass();

Modified: commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java?rev=1392963&r1=1392962&r2=1392963&view=diff
==============================================================================
--- commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java
(original)
+++ commons/sandbox/nabla/trunk/src/main/java/org/apache/commons/nabla/forward/analysis/ClassDifferentiator.java
Tue Oct  2 15:14:48 2012
@@ -135,21 +135,20 @@ public class ClassDifferentiator {
     /**
      * Differentiate a method.
      * @param name of the method
-     * @param primitiveDesc descriptor of the method in the primitive class
-     * @param derivativeDesc descriptor of the method in the derivative class
+     * @param primitiveMethodType type of the method in the primitive class
+     * @param derivativedMethodType type of the method in the derivative class
      * @exception DifferentiationException if method cannot be differentiated
      */
-    public void differentiateMethod(final String name, final String primitiveDesc,
-                                    final String derivativeDesc)
+    public void differentiateMethod(final String name, final Type primitiveMethodType,
+                                    final Type derivativedMethodType)
         throws DifferentiationException {
 
         for (final MethodNode method : primitiveNode.methods) {
-            if (method.name.equals(name) && method.desc.equals(primitiveDesc)) {
+            if (method.name.equals(name) && Type.getType(method.desc).equals(primitiveMethodType))
{
 
                 final MethodDifferentiator differentiator =
                         new MethodDifferentiator(mathClasses, classNode);
-                differentiator.differentiate(primitiveNode.name, method,
-                                             Type.getMethodType(derivativeDesc));
+                differentiator.differentiate(primitiveNode.name, method, derivativedMethodType);
 
             }
         }



Mime
View raw message