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

Cookbook recipe for matrix addition and multiplication #2671

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RCHG
Copy link

@RCHG RCHG commented Aug 27, 2024

Hello!

I have prepared a recipe for the matrix addition and multiplication. In this case using the Array module of the standard library and implemented using integer elements for the arrays.

Note that it relies on vector addition and dot product of vectors to define the matrix operations in a kind of functional style (rather than using loops). Also in the process the recipe defines additional useful functions:

  • Transpose of a matrix
  • Vector addition
  • Vector dot product

It can be useful for those cases where Owl library can't be used, otherwise these operations of the matrices are defined in (a more performant way) in Owl.

This example use integer vector and matrix, but I am happy to implement for floats if preferred.

Thanks and kind regards,
Ramiro.

Implementation of the matrix addition and multiplication using the
Array module of the standard library and integer arrays. Note that
it relies on vector addition and dot product to define the matrix
operations in a functional style. It can be useful for those cases
where Owl library can't be used, otherwise these operations of the
matrices are defined in a, probably, more performant way in Owl.
Easy changes to implement it for floats.
@RCHG
Copy link
Author

RCHG commented Aug 27, 2024

Hello. I realised that some recipes have a kind of discussion at the beginning. I don't know exactly the syntax for that but the initial comments in the recipe are aimed to be a kind of discussion. I can work on it.

Matrix addition and multiplication:
A discussion block replace long comment at the beginning of code.
The comments of several functions has been clarified, and the final
tests has been extended to cover more cases. An explation of how to
extend functions to floats has been added in discussion.
@RCHG
Copy link
Author

RCHG commented Oct 1, 2024

This seems to be finished and ready, but their integration seems frozen since 29-Aug. Do I need to do something more? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants