I am writing a program that needs to use kronecker products on matrices with complex numbers, and I notice that there is no kronecker / kron function like that of NumPy and MatLab?
It would be a really handy feature for me at least
This function is indeed not available in mathjs. Would be nice to have. If anyone is interested in implementing the kronecker product for mathjs please let me know.
I am up for implementing it
Thanks for your offer Adam! If you need any pointers please let me know.
Sorry, Only got around to working on this now. I see that lines should be cut off at 80 charachters,
but one of the examples is longer then that. Should I break it up into variables?
Currently its:
/**
* Calculate the Kroneckeker Product of two matrices.
*
* Syntax:
*
* math.kron(x, y)
*
* Examples:
*
* math.kron([[1, 0], [0, 1]], [[3, 7], [5, 9]]); // returns [[3, 7, 0, 0], [5, 9, 0, 0], [0, 0, 3, 7], [0, 0, 5, 9]]
*/
Good to hear back from you :).
The lines should ideally not be longer that about 80 characters (90 is still ok), else the uses of the docs on the website will have to scroll the example horizontally which is quite inconvenient (like you can see for yourself in the code you posted here on github :D ).
You could put the comment on the following line with some indentation, like:
/**
* Calculate the Kroneckeker Product of two matrices.
*
* Syntax:
*
* math.kron(x, y)
*
* Examples:
*
* math.kron([[1, 0], [0, 1]], [[3, 7], [5, 9]]);
* // returns [[3, 7, 0, 0], [5, 9, 0, 0], [0, 0, 3, 7], [0, 0, 5, 9]]
*/
Just before I close this, Can I ask when you would say 3.9.0 will go to master?
I was planning to do a release tonight :)