Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:50 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Array manipulation PicoMIte

Author Message
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 633
Posted: 09:09pm 24 Jul 2022
Copy link to clipboard 
Print this post

Hi, does anyone know if it's possible to add or multiply one single dimension array by a second single dimension array with a single command, similar to the MATH function.
So for example add each of the array elements 0 1 2 3 4...etc to elements 0 1 2 3 4...etc of another array & put the results in to elements 0 1 2 3 4...etc of a third array (or one of the input arrays), similar for multiply. As far as I can see the MATH_M_MULT only works on 2D arrays for example,
This is purely for speed, I realise I can do a For loop, but the MATH functions are much more optimised.
Thanks Kevin.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5090
Posted: 12:14am 25 Jul 2022
Copy link to clipboard 
Print this post

Hi Bleeb,

The math functions are in picomite, even MATH FFT

See manual

Volhout
Edited 2022-07-25 10:16 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1234
Posted: 06:36am 25 Jul 2022
Copy link to clipboard 
Print this post

by calling a Sub or a Function you can move a complete array into another array

Dim aa(20,20)
For f=1 To 20
For n=1 To 20
aa(f,n)=Int(Rnd*255)
Next n
Next f
show aa()

Sub show bb()
For f=1 To 20
For n=1 To 20
Print bb(f,n);",";
Next n
Print
Next f
End Sub

'no comment
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 633
Posted: 07:52am 25 Jul 2022
Copy link to clipboard 
Print this post

HI, Yes, as I said I've been all through the MATH functions, they don't seem to work on 1D arrays, that was why I am asking if anyone knows of anything else; Similarly, as I stated I know I can do this using For loops, but built in functions are always going to be much quicker.
I am adding and multiplying several 192 element 1D arrays, which are then being used to draw on the screen using the Polygon command, so they need to be 1D and they need to be fast.
Regards, Kevin.
Edited 2022-07-25 20:15 by Bleep
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025