You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
oxinabox
changed the title
Mathematical Array operations
Elementary Mathematical Array operations especially matrix multiplication
Apr 13, 2019
*
+
-
This needs to be done such that:
If both operations are
NamedDimsArray
s 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.a + parent(b)
to adda
andb
that have different named dimensions.*
is special,a * b
then we only require the the the name of the last dimension ofa
needs to match that of the first ofb
.NamedDimsArray
then the result of the operation will have to insert made up names for one of the dimensions.names(::AbstractArray)
to return those names.dim1
anddim2
, however on further reflection I think that just calling all artificial dimensions:_
is best.dim1
anddim2
doesn't help much with avoiding named clashes: Consider whereb
has names anda
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.
:_
a special case that is an exception to the rule of dimension names must match forNamedDimArray
-NamedDimArray
operation.The text was updated successfully, but these errors were encountered: