-
Notifications
You must be signed in to change notification settings - Fork 75
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
support for set/array/vector/matrix proposal #79
Comments
I agree, this would be very useful. I should be able to implement this when I have time. |
Maybe I should take a look on kalker's codebase and try to help with some stuff. |
That would be cool. Basic vector support should be fairly simple, although the
|
I'm trying to decide how to deal with the different kinds of multiplication operations with vectors. The Wolfram language seems to do the following:
The problem with this in kalker is that Edit: Solving this by using |
I have now implemented basic support for vectors/matrices. Vectors are defined like Matrices are defined only with square brackets. New rows are defined either after a new line or a semicolon. Most operations are also possible here, but with some limitations to power operations. If a function is not made to handle matrices, the it applies the function on all the items. Matrices are indexed like this: Now it would be good to have some way of dynamically creating vectors. Maybe something like list comprehension in Python. |
Hi, sometimes it is useful to operate not only on numbers, but on sets of numbers: vectors, matrices, ordered and unordered sets.
We can define operations for vectors as so:
[1, 2, 3, 4] * 7 = [7, 14, 21, 28]
[2, 4, 8] / 2 = [1, 2, 4]
[5, 8, 11] + 4 = [9, 12, 15]
[10, 7, 4] - 4 = [6, 3, 0]
for f(x) where x is number:
f([a1, a2, ..., an]) = [f(a1), f(a2), ..., f(an)]
and also some aggregate functions would be extremely useful e.g.
a = [1/2, 1/4, 1/8]
sum(a) = 7/8
avg, product, variance, min, max e.t.c.
[a1, a2, ..., an] * [b1, b2, ..., bn] = [a1 * b1, a2 * b2, ..., an * bn]
and more vector/matrix specific functions such as vector product...
what do you think of it?
The text was updated successfully, but these errors were encountered: