Thanks Eros,
this is very much appreciated!
Petr
Usually thinBasic matrix filling follows column order.
Next thinBasic beta preview will have the possibility to fill matrix with row order.
Also:
- it will not be mandatory to indicate starting index during filling. If missing, 1 or 1,1 will be assumed
- it will not be mandatory to add line continuation. When indicating data, if rows ends with a comma(,) it will be automatically considered as line continuation
How: just using ( and ) before and after data.
Example:
When using () syntax, data will be entered in the matrix in row order and now column order.Dim a(MaxX, MaxY) As Double a() = ( 1, 2, 3, 4, 5, 6, 7, 8, 9 )
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Thanks Eros,
this is very much appreciated!
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Just to clarify,Eros.
array(x,y) ?
matrix(column,row) ?
The x is the minor step and the y is the major step?
Charles
in memory would be filled following COLUMN order: 1, 4, 7, 2, 5, 8, 3, 6, 9a() = 1, 2, 3, 4, 5, 6, 7, 8, 9
Column order is the standard way used by thinBasic
in memory would be filled following ROW order: 1, 2, 3, 4, 5, 6, 7, 8, 9a() = ( 1, 2, 3, 4, 5, 6, 7, 8, 9 )
So () will influence the sequence in which data is entered in memory.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Thanks Eros,
As I understand it your first ( default order) follows the PB convention whereas your second way of entering data follows the C convention.
FORTRAN MATLAB & PB: array(minor index,major index) : column major order
C and most others: array(major index,minor index) : row major order
http://en.wikipedia.org/wiki/Row-major_order
I lose hours of sleep worrying about how matrices and other arrays are organised in memory
Charles
Me too and still to come ;DOriginally Posted by Charles Pegge
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
To make things clear for newcomers to the forum, the syntax with () has been replaced with square brackets later in 2010 (such a changes are done because we are still in Beta stage).
Please see newer discussion on the topic here:
http://www.thinbasic.com/community/s...4409#post84409
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
How do you guys keep track of this stuff? Got my head spinning
Bookmarks