-
Notifications
You must be signed in to change notification settings - Fork 140
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
EXACT MODE for matrix library <matrix.ts> #48
Comments
@Haise-Turquoise I LOVE this idea!!! Actually I've already had an idea about how to implement this feature. Here is my brainstorming: since we've already supported Nerdamer with compiler frontend (babel plugin operator overload for Symbolic class), x = sym('1')
y = sym('4')
z = sym('7')
print(sin(y) + (z^0.5 )) you may see that Nerdamer already helped us to support an exact mode with . For the exact mode matrix, we may initialize a matrix/vector/tensor by using: A = new exactMat( [ [ cos( sym('1') ) + sqrt(sym('7')), sqrt(sym('5'))]] ) which would be a quite straight-forward approach. But I hope we may come up with a better idea to support this feature natively by babel parser. Do you have any ideas? |
Thanks for your commenting. I do not think using In the user side, I would be glad to mention two things: In the developer side, the design of the exactmat value can be INTEGER nomi Method2: (Define type SQRTVAL by INT and BOOL) HOWEVER, the methods above, namely the type definitions of exactmat, are not concise enough or they are even misleading. I suggest you spend a long time to make a survey among the most popular open-source calculators and check how they implement the exact issue and they make the careful discussion between developers. For the readme part, I suggest you write a tutorial on how to revise the library and where to write the tests and how to run the test. Spending hours on figuring out how to do the things above would probably make people who have higher math ability than coding ability give up the contribution because the study cost of running test is too much, way much more than studying the grammar of typescript. Additionally, you can call me Haise instead of my full user name. |
Background
For calculation of the advanced linear algebra, the current data type of Hedgehog-lab(Ver0.4) cannot support the exact value calculation with square root like the image below:
Topics
Exact-calculation mode (Exact Mode) for matrix library
My suggestion is creating the exact calculation mode which ONLY allows the input of fractions of integers and output of fractions of integers (no decimals allowed for IO of Exact Mode). Adding some new data types with the support of fractions and square root would probably have a conflict with the current data type.
However, this project can use [a mode button in the IO webpage] OR use [a global mode variable in the first few lines of the code compulsorily] to avoid the confusion of the decimal calculation and the exact calculation.
example of confusion:
2/sqrt(2)
can be interpreted as 1.414... or sqrt(2) in the current and the exact mode of calculation.After implementing the Exact-calculation mode of the matrix library, the following suggested function would provide a practical use for students and academic researchers.
Suggested functions for the matrix library
-linearly independence check
-determinant calculation
-row reduced echelon form simplification
-Find the basis for range(A), Row(A), Col(A), Null(transpose(A))
-coordinates of vector under different bases
-eigenvalue calculation
-matrix diagonalization
For the calculation functions below, Exact Mode is highly suggested for practical use
-length of vector
-the standard inner product for real matrix ("**" already implemented for current version but not for exact model)
-Gram-Schmidt Procedure
-set of bases vectors to an orthogonal matrix
-general mapping
-find basis of the orthogonal complement space
-matrix orthogonal diagonalization
-matrix triangularization
-singular value decomposition
The text was updated successfully, but these errors were encountered: