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

Matricies, Lists, and Vectors Syntax #34

Open
65001 opened this issue Aug 1, 2020 · 1 comment
Open

Matricies, Lists, and Vectors Syntax #34

65001 opened this issue Aug 1, 2020 · 1 comment

Comments

@65001
Copy link
Owner

65001 commented Aug 1, 2020

I want to be able to support matrices and matrix operations in AbMath. To do this we have to use one of several conventional ways to represent matrices on calculators.

To do this we need to make a breaking change on what constitutes left and right brackets and use aliasing to map them to lists and end parenthesis as appropriate.
In this context we will alias { to a new function named list and will alias } to ). This should allow us to use a the traditional matrix form of {{a,b},{c,d}} with this expanding out to list( list(a,b), list(c,d)).

A list is another name for a vector in this context. A vector of length n shall be treated as a matrix of size n x 1

We would need several rules in order for this to make sense when displayed to the user.

  1. A list with a single element shall just return that element. IE 3{3} will always return 9

  2. A list of lists shall be a matrix and for appropriate operators the matrix variants shall take precedence. We shall also need to include scalar and matrix variants of operators and all other functions and operators as logical shall be applied on all the elements of the data.

  3. A list, vector, or matrix inside in all general math functions shall be treated as a list.

  4. In certain functions such as total, avg, max, and min the list shall decompose and allow access to the underlying data contained therein. IE total({4,3,2}) - > total(4,3,2).

  5. For all other functions the list shall cause the function to be applied on all the elements of the data. ln({e,pi,2}) -> {ln(e),ln(pi),ln(2)} or ln( {{a,b},{c,d}}) -> { {ln(a), ln(b)}, {ln(c),ln(d)} }

All functions and operators shall be classified as requiring decomposition, distribution, or having special variants for matrix support.

@65001
Copy link
Owner Author

65001 commented Aug 5, 2020

The following operators shall have special matrix operators +, -, *, ^, /, and a yet to be implemented operator ` which will be the transpose operator (either Hermitian or regular).

Reference

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

No branches or pull requests

1 participant