Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elementary Mathematical Array operations especially matrix multiplication #3

Closed
3 tasks
oxinabox opened this issue Apr 13, 2019 · 0 comments · Fixed by #7
Closed
3 tasks

Elementary Mathematical Array operations especially matrix multiplication #3

oxinabox opened this issue Apr 13, 2019 · 0 comments · Fixed by #7
Assignees

Comments

@oxinabox
Copy link
Member

oxinabox commented Apr 13, 2019

  • *
  • +
  • -

This needs to be done such that:

  • If both operations are NamedDimsArrays then they must have the same named dimensions.

  • If 1 operand is a NamedDimsArray, and one is not, then the answer uses the named dimensions of the one that is provided.

    • This lets you use a + parent(b) to add a and b that have different named dimensions.
  • * is special,

    • for a * b then we only require the the the name of the last dimension of a needs to match that of the first of b.
    • if one of the operands is not a NamedDimsArray then the result of the operation will have to insert made up names for one of the dimensions.
      • Possibly for ease of implementation we should define names(::AbstractArray) to return those names.
      • I originally thought dim1 and dim2, however on further reflection I think that just calling all artificial dimensions :_ is best.
      • using dim1 and dim2 doesn't help much with avoiding named clashes: Consider where b has names and a does not then the name of ``(abb'a')is(:dim1, :dim2)`. And the mathematically equivalent: `(ab)(ab)'` would get the name `(:dim1, :dim1)`.
        - repairing names of something that has a name `(:, :)` by premultiplcation by something with names `(:time, :)` and post-multiplcation by `(:, :value)` seems easier if you don't have to workout where (prepositionally) the original dimension that was added was from.
        • We might even want to make :_ a special case that is an exception to the rule of dimension names must match for NamedDimArray-NamedDimArray operation.
@oxinabox oxinabox changed the title Mathematical Array operations Elementary Mathematical Array operations especially matrix multiplication Apr 13, 2019
@oxinabox oxinabox self-assigned this Apr 16, 2019
This was referenced Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant