fave77 / Mathball

A JavaScript library for Competitive Programming
https://fave77.github.io/Mathball-Docs/
MIT License
99 stars 49 forks source link

Fast Matrix Exponentiation #95

Closed nilshah98 closed 5 years ago

nilshah98 commented 5 years ago

Do the checklist before filing the issue:

NOTE: Provide a clear and concise description of the feature that needs to be added! Or if its a bug, then provide the necessary steps to reproduce it along with screenshots.

Matrix exponentiation is an integral part of competitive programming and can be used to solve many dynamic programming questions. The aim here is to make it a bit easier, by implementing Matrix Exponentiation.

Validations-:

M.matrixExpo( [ [1,2],[3,4] ] , 2 )        // [ [7,10],[15,22] ]

Validations -
M.matrixExpo( [ [1,2],[3,4] ] , -2 )       // Error not positive power
M.matrixExpo( [ [1],[3] ] , 2 )              // Error not square matrix
M.matrixExpo( [ [1,2],[3,4,5] ] , 2)      // Error not a correct matrix

Also, matrix should contain only floats and ints and no strings. Note- Need to implement fast exponentiation.

Links- Fast Matrix Expo and Why

Shubhayu-Das commented 5 years ago

I will grab this issue. P.S. : I will start working only after the issue is assigned to me

fave77 commented 5 years ago

@sateslayer you're assigned!