Hello BP
I think that to save memory, it is necessary to create empty matrices, do you think it is necessary?
if so, the function field could be nop to create an empty matrix
makemat(nop,3,2)
RETURNS
[[ , ],
[ , ],
[ , ]]
with a no empty function
makemat((a,b)-> "("+string(a)+","+string(b)+")",3,2)
RETURNS
[["(0,0)","(0,1)"],
["(1,0)","(1,1)"],
["(2,0)","(2,1)"]]
creating empty matrices makemat(nop, rows, cols)
Modérateur : xcasadmin
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: creating empty matrices makemat(nop, rows, cols)
I can't see how you would save memory with empty matrices.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: creating empty matrices makemat(nop, rows, cols)
hp50
{{},{}}
BYTES
15
{{0},{0}}
BYTES
20
{{},{}}
BYTES
15
{{0},{0}}
BYTES
20
Re: creating empty matrices makemat(nop, rows, cols)
On modern hardware, you will never need to optimize for a few bits. Memory becomes a problem if you have large matrices (nxn with n=a few thousands). And inside giac vectors with size from 0 to 3 do not allocate memory, they take the same space.