General Maths Matrix Calculation (V1.0.1)
General Maths Matrix Calculation (V1.0.1)
Hello everyone,
Ok this is it ! A General Maths Matrix Calculation library in progress.
Edit : v0.9.9
Download link : http://pages.videotron.com/gsaumure/fil ... Matrix.zip
Edit 2 : V1.0.0
Ok I have updated the library to V1.0.0 and the html help files are on the way. My initial plan is to include advanced Splines and Surfaces to the Matrix library but they are to complicated but the more important thing I need to create some more little lib to program them. So they will be on a separate lib but still dependent to the Matrix Lib.
Edit 3 : V1.0.1
Ok this is the V1.0.1, I have added few commands, made few change and corrected a memory leak problem. But the most important thing, the html help files are ready for their first run (Please note that the English is my secondary language, so it's possible for you to find some mistakes, feel free to suggest correction !)
Have fun !
Best regards.
Guimauve
Ok this is it ! A General Maths Matrix Calculation library in progress.
Edit : v0.9.9
Download link : http://pages.videotron.com/gsaumure/fil ... Matrix.zip
Edit 2 : V1.0.0
Ok I have updated the library to V1.0.0 and the html help files are on the way. My initial plan is to include advanced Splines and Surfaces to the Matrix library but they are to complicated but the more important thing I need to create some more little lib to program them. So they will be on a separate lib but still dependent to the Matrix Lib.
Edit 3 : V1.0.1
Ok this is the V1.0.1, I have added few commands, made few change and corrected a memory leak problem. But the most important thing, the html help files are ready for their first run (Please note that the English is my secondary language, so it's possible for you to find some mistakes, feel free to suggest correction !)
Have fun !
Best regards.
Guimauve
Last edited by Guimauve on Tue Jan 17, 2012 7:04 pm, edited 17 times in total.
Re: General Maths Matrix Calculation
Can it be that the code has some errors?
Example:
It is good that you checked in SetMatrixElement () (if you've corrected it ^ ^) if there is a valid field.
But you do not have in your own functions.
There you can get a simplified "MySetMatrixElement" use, without check, which is then faster.
Btw:
Why you use a memory for matrix fields instead of an array like this:
Example:
Otherwise well, but you can still optimize the speed.Procedure SetMatrixElement(*MatrixA.Matrix, P_Line.l, P_Row.l, P_Element.d)
If Line01 <= GetMatrixLine(*MatrixA) - 1 And Line02 <= GetMatrixLine(*MatrixA) - 1 And Line01 >= 0 And Line02 >= 0
Offset1D(Offset1D, GetMatrixLine(*MatrixA), P_Line, P_Row)
PokeD(ReachMatrixElement(*MatrixA, Offset1D), P_Element)
EndIf
EndProcedure
It is good that you checked in SetMatrixElement () (if you've corrected it ^ ^) if there is a valid field.
But you do not have in your own functions.
There you can get a simplified "MySetMatrixElement" use, without check, which is then faster.
Btw:
Why you use a memory for matrix fields instead of an array like this:
Code: Select all
Structure Matrix
LastX.i
LastY.i
Array Field.d(0)
EndStructure
Procedure NewMatrix(*Matrix.Matrix, Width.i, Height.i) ;
Dim *Matrix\Field(Height*Width-1)
*Matrix\LastX = Width-1
*Matrix\LastY = Height-1
EndProcedure
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: General Maths Matrix Calculation
Corrected ! See the first post.STARGÅTE wrote:Can it be that the code has some errors?
Example:Procedure SetMatrixElement(*MatrixA.Matrix, P_Line.l, P_Row.l, P_Element.d)
If Line01 <= GetMatrixLine(*MatrixA) - 1 And Line02 <= GetMatrixLine(*MatrixA) - 1 And Line01 >= 0 And Line02 >= 0
Offset1D(Offset1D, GetMatrixLine(*MatrixA), P_Line, P_Row)
PokeD(ReachMatrixElement(*MatrixA, Offset1D), P_Element)
EndIf
EndProcedure
Because I prefer to manage the memory my self.STARGÅTE wrote: Btw:
Why you use a memory for matrix fields instead of an array like this:Code: Select all
Structure Matrix LastX.i LastY.i Array Field.d(0) EndStructure Procedure NewMatrix(*Matrix.Matrix, Width.i, Height.i) ; Dim *Matrix\Field(Height*Width-1) *Matrix\LastX = Width-1 *Matrix\LastY = Height-1 EndProcedure
Best regards.
Guimauve
Last edited by Guimauve on Fri Aug 05, 2011 5:25 am, edited 1 time in total.
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: General Maths Matrix Calculation
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: General Maths Matrix Calculation
Yes this library can be used for games but to solve many maths problem not related to game as well.IdeasVacuum wrote:.....would be better to post it here:
http://www.purebasic.fr/english/viewtop ... 16&t=45701
Best regards.
Guimauve
Re: General Maths Matrix Calculation
that's some pretty useful function here !
I need them to complete the one for vector I made. Math apps are always hardest to code than game ;'(
That could be of great help in a finite element code.
I need them to complete the one for vector I made. Math apps are always hardest to code than game ;'(
That could be of great help in a finite element code.
_________________________________________________
My Website : CeriseCode (Warning : perpetual changes & not completed )
My Website : CeriseCode (Warning : perpetual changes & not completed )
Re: General Maths Matrix Calculation (V0.9.5)
Hello,
Due to forum limitation (60 000 characters max) I have to split the library and the demonstration code in two files.
Just save the lib and Demo code in the same folder.
Edit : See the download link in the first post for the most up to date version.
Best regards
Guimauve
Due to forum limitation (60 000 characters max) I have to split the library and the demonstration code in two files.
Just save the lib and Demo code in the same folder.
Edit : See the download link in the first post for the most up to date version.
Best regards
Guimauve
Last edited by Guimauve on Fri Aug 19, 2011 12:17 am, edited 1 time in total.
Re: General Maths Matrix Calculation (V0.9.7)
Edit : See the download link in the first post for the most up to date version.
Best regards.
Guimauve
Best regards.
Guimauve
Last edited by Guimauve on Fri Aug 19, 2011 12:22 am, edited 2 times in total.
Re: General Maths Matrix Calculation (V0.9.7)
Edit : See the download link in the first post for the most up to date version.
Best regards.
Guimauve
Best regards.
Guimauve
Last edited by Guimauve on Fri Aug 19, 2011 12:18 am, edited 2 times in total.
Re: General Maths Matrix Calculation (V0.9.7)
Edit : See the download link in the first post for the most up to date version.
Best regards.
Guimauve
Best regards.
Guimauve
Last edited by Guimauve on Fri Aug 19, 2011 12:22 am, edited 2 times in total.
Re: General Maths Matrix Calculation (V0.9.7)
Edit : See the download link in the first post for the most up to date version.
Best regards.
Guimauve
Best regards.
Guimauve
Last edited by Guimauve on Fri Aug 19, 2011 12:19 am, edited 1 time in total.
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: General Maths Matrix Calculation (V0.9.8)
...lovely job Guimauve, thanks for sharing. I need a new mouse now, worn-out the scroll wheel!
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: General Maths Matrix Calculation (V0.9.8)
thanks again Guimauve ^^
@IdeasVacuum : you could use this : http://www.purebasic.fr/french/viewtopic.php?f=8&t=9608 to avoid breaking your mouse
@IdeasVacuum : you could use this : http://www.purebasic.fr/french/viewtopic.php?f=8&t=9608 to avoid breaking your mouse
_________________________________________________
My Website : CeriseCode (Warning : perpetual changes & not completed )
My Website : CeriseCode (Warning : perpetual changes & not completed )
Re: General Maths Matrix Calculation (V1.0.1)
A little update, see the first post.
Best regards.
Guimauve
Best regards.
Guimauve
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: General Maths Matrix Calculation (V1.0.1)
...almost a year later and I have just used the MMC Help for the first time!
Have to say that it is extremely well presented, fantastic job.
Have to say that it is extremely well presented, fantastic job.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.