Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1452

Named parameters for DerivativeStructure

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      Consider following situation: we have `DerivativeStructure` `struct1` which depends on parameter `a` and parameter `b` and  `DerivativeStructure` `struct2` which depends on parameter `b` and parameter `c`, we want to calculate `struct3 = struct1 + struct2`. The problem is since the parameters are accessible only by number and from implementation it seems that those numbers start with 0, the only way to do so is to define three parameters for both `struct1` and `struct2` and set appropriate derivatives to zero.

       

      The obvious solution is to replace number reference in derivatives by string key reference. In this case `DerivativeStructure` can automatically return zero for derivatives on parameters it does not have.

      This solution does not require any changes to internal workings of `DerivativeStructure` or `DSCompiler`, it could could be implemented without breaking backward compatibility. The derivative structure could still be accessible by number, but in case there is a binary operation, it should check name lists and correctly interconnect the structures.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                darksnake Alexander Nozik
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: