1 Pages (2 items)
Feature Req: Matrix Elements as a Group of Individuals - Messages
#1 Posted: 11/16/2010 9:36:28 PM
This is a reply/feature request in response to flybacks matrix question from October 25, 2010
If Andrey could add a new matrix function to be used similar to the transpose function T
but using the identifier ∀ (logic symbol: "For each" )
Then, a new form of matrix calculations could be an operation between two
matrices, but performed element by element with a result of appropriate matrix size without using For loops.
ex 1:
A := [1 2 3] B := [4 5 6]
.∀....∀
A.*B = [4 10 18]
As a default, if the matrices do not match size, just ignore the elements with no partner and
make the result matrix as big as the larger matrix and place unpaired elements in result matrix
unchanged. ex 2:
A := [1 2 3]
B := [4 5
.........6 7
.........8 9]
.∀....∀
A +B = [5 7 3
.............6 7 0
.............8 9 0]
Using index subranges, we could change the elemental alignment. ex 3:
.∀................∀
A +B...............= [7 2 3
.........[2..3,1].......8 0 0]
where the submatrix extracted from B is
[6
.8]
Using augment and stack, we could synthesize a different matrix from the
the elements of A in order to realign the way the elements in A pair up with the elements in B.
However, a more sophisticated method shown below would make desired alignments and also provide
desired result matrix dimensions (for example, realigning A to the Second row of B as ex. 3, but still
having a 3x3 matrix resulting as in example 2 and no submatrix extraction. ex 4:
.∀.............∀
A +B...............= [4 5 0
........[Δ-1]...........7 9 3]
...........................8 9 0]
where the Δ-1 implies a realignment of the rows of B so that the 2nd row decrements to the first row
which pairs up with the elements of A and the first and third rows go along for the ride. A 0Δ1 would
have the rows of B increment by one and a new virtual first row of zeros would be created (stacking
an extra row to make a 4 row matrix)
If Andrey could add a new matrix function to be used similar to the transpose function T
but using the identifier ∀ (logic symbol: "For each" )
Then, a new form of matrix calculations could be an operation between two
matrices, but performed element by element with a result of appropriate matrix size without using For loops.
ex 1:
A := [1 2 3] B := [4 5 6]
.∀....∀
A.*B = [4 10 18]
As a default, if the matrices do not match size, just ignore the elements with no partner and
make the result matrix as big as the larger matrix and place unpaired elements in result matrix
unchanged. ex 2:
A := [1 2 3]
B := [4 5
.........6 7
.........8 9]
.∀....∀
A +B = [5 7 3
.............6 7 0
.............8 9 0]
Using index subranges, we could change the elemental alignment. ex 3:
.∀................∀
A +B...............= [7 2 3
.........[2..3,1].......8 0 0]
where the submatrix extracted from B is
[6
.8]
Using augment and stack, we could synthesize a different matrix from the
the elements of A in order to realign the way the elements in A pair up with the elements in B.
However, a more sophisticated method shown below would make desired alignments and also provide
desired result matrix dimensions (for example, realigning A to the Second row of B as ex. 3, but still
having a 3x3 matrix resulting as in example 2 and no submatrix extraction. ex 4:
.∀.............∀
A +B...............= [4 5 0
........[Δ-1]...........7 9 3]
...........................8 9 0]
where the Δ-1 implies a realignment of the rows of B so that the 2nd row decrements to the first row
which pairs up with the elements of A and the first and third rows go along for the ride. A 0Δ1 would
have the rows of B increment by one and a new virtual first row of zeros would be created (stacking
an extra row to make a 4 row matrix)
1 Pages (2 items)
-
New Posts
-
No New Posts