Commons Math
  1. Commons Math
  2. MATH-1036

GradStructure: A DerivativeStructure that works for large number of variables.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Labels:
      None

      Description

      Ran into problems with DerivativeStructure today. It requires a lot of
      memory with 6000 or so independent variables. The problem starts with the number of DSCompiler objects instantiated.

      Here is a faster/leaner(less memory) GradStructure that only computes up to the first derivative for the case where there are a large number of independent variables.

      1. GradStructure.java
        7 kB
        Ajo Fod
      2. grad-patch.txt
        14 kB
        Ajo Fod

        Activity

        Hide
        Ajo Fod added a comment -

        Changed the name to GradStructure to reflect the relationship with the more generic DerivativeStructure and the idea that it is limited to computing gradients.

        Show
        Ajo Fod added a comment - Changed the name to GradStructure to reflect the relationship with the more generic DerivativeStructure and the idea that it is limited to computing gradients.
        Hide
        Ajo Fod added a comment -

        IMHO: This can be extended to higher orders using more complex hashmap key structure.

        Show
        Ajo Fod added a comment - IMHO: This can be extended to higher orders using more complex hashmap key structure.
        Hide
        Ajo Fod added a comment - - edited

        A patch with a few tests are included here.

        Show
        Ajo Fod added a comment - - edited A patch with a few tests are included here.
        Hide
        Luc Maisonobe added a comment -

        Fixed in subversion as of r1536073.

        The name of the class has been changed to SparseGradient and the factory methods for constant and variables changed from get to create.

        The RealFieldElement<SparseGradient> interface is implemented, meaning instances can be used in the same kind of computation as all other field elements, including with functions like trigonometric, hyperbolic or power functions. The high accuracy linear combinations are also available for these instances.

        Thanks for the report and the patch.

        Show
        Luc Maisonobe added a comment - Fixed in subversion as of r1536073. The name of the class has been changed to SparseGradient and the factory methods for constant and variables changed from get to create. The RealFieldElement<SparseGradient> interface is implemented, meaning instances can be used in the same kind of computation as all other field elements, including with functions like trigonometric, hyperbolic or power functions. The high accuracy linear combinations are also available for these instances. Thanks for the report and the patch.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ajo Fod
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development