-
Notifications
You must be signed in to change notification settings - Fork 12
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
why matrix needs to have a numerical value? #132
Comments
Hello @telephon, Hmm... at first I'm surprised that this (quote below) works:
Looking closer at I'm not sure we could expect this to be the case across the board for all FOA and HOA matrix operations. As you know, for (most) relevant operations we have both matrix and corresponding (p-)UGen implementations. Just thinking aloud here... two interesting spaces that opening up
The latter could be nice, in that MATLAB / SciPy type functionality could be introduced. (@mtmccrea and I have been looking at writing new classes to offer this possibility.) The former could imply refactoring / reducing / replacing current (p-)UGen implementations. I think we'd want to carefully review the use cases and resulting performance. I am suspicious that there will be a variety of @mtmccrea, @dyfer, @dmartinp, @joshpar, do you have any thoughts / opinions on the matter? |
There are probably some adjustments that will have to be made if all methods should work. An example: * { arg that; // return matrix A(m,n) * B(n,r) = AB(m,r)
var result;
if ( that.isNumber, {
^this.mulNumber(that);
},{
^this.mulMatrix(that);
});
} would have to become: * { arg that; // return matrix A(m,n) * B(n,r) = AB(m,r)
var result;
if ( that.isKindOf(this), {
^this.mulMatrix(that);
},{
^this.mulNumber(that);
});
} But this is better anyhow. The optimal approach would be to write tests (which would be a good idea anyhow for a class so central), and then vary the tests, replacing numbers with their UGen and Signal counterparts. |
Without having worked with
This would be ideal, IMO. Also... I understand this was raised in the context of |
Yes. If we get it working correctly with Atk, it is a good start. But discussion should be here: supercollider-quarks/MathLib#38 |
Let's relax the constraint in the
Matrix
class (MathLib) that values must be numbers:I can write the following, and to my impression it works correctly.
Should we relax the constraint? Since sclang automatically lifts math operations to UGens, it seems overly narrow.
EDIT: I've made a ticklist for methods that work with UGens, Arrays, and Functions as matrix entries, from inspecting the code. See: supercollider-quarks/MathLib#38
The text was updated successfully, but these errors were encountered: