LinguaPhylo / linguaPhylo

LinguaPhylo: A language for describing, visualising and simulating probabilistic phylogenetic models
GNU Lesser General Public License v3.0
18 stars 7 forks source link

Linear algebra operations for matrices #340

Open kche309 opened 1 year ago

kche309 commented 1 year ago

Linear algebra matrix operations should be implemented and documented on the webpage and docs

Example of matrix multiplication matrixMultiply(matrix1, matrix2);

Example multiplying a matrix list

matrixList = [matrix1, matrix2, matrix3];
matrixMultiply(matrixList);
bredelings commented 1 year ago

Another alternative would be to use an operator like %*% or something, similar to R:

matrix1 %*% matrix2`
matrix1 %*% matrix2 %*% matrix3

But I guess this doesn't work for the list-of-matrices case.

kche309 commented 1 year ago

Thanks for your helpful suggestion, the R style syntax looks like a good approach as well. We will be adding this feature in the future releases.