Questions tagged [packed-arrays]
Tag for questions about packed arrays. Packed Arrays are data structures that can be seen as monolithic blocks containing a single data type, particularly Integers and Reals. Many functions operate very efficient on packed arrays. Questions may deal with packed array generation, conversion, and usage.
77
questions
2
votes
1
answer
68
views
Why are Packed Arrays limited to signed machine precision types?
Why are packed arrays limited to only a few types? Particularly, why are integer packed arrays limited to signed integers?
And is there a way to get the same efficiency you get with packed arrays in ...
4
votes
1
answer
74
views
Is there a non-allocating way to modify elements of single-reference packed arrays?
I need to repeatedly increment cuboidal chunks of a 3D image. The image is large - on the order of 1G elements.
The only way I know of doing it using built-in Image functions is:
...
0
votes
3
answers
114
views
Generalize the code to more variables
I have this code it runs and gives me the solution. How can I make it more compact and If I want it to extend(generalize) it to more variables how can I do it. I had asked a similar question here
(...
13
votes
1
answer
321
views
How to convert the ListVector into PackedArray in FunctionCompile
Cross post here
I have a compile function cf to calculate the mean for a ragged list:
...
0
votes
0
answers
70
views
Packed/Unpacked array - what object/like 0 or 1?/how to check/ [duplicate]
In Mathematica, there is a concept called packed array.
...
2
votes
1
answer
66
views
What circumstances would cause memory to inflate while packing the sublists of a ragged matrix?
I'm working with a ragged matrix of considerable size (ByteCount = 47749114088; Length = 563529128). I had seen a suggestion mentioned in other questions (here on StackExchange), that one might be ...
3
votes
0
answers
87
views
Fixing a step size with a variable causes array to be unpacked?
I would expect the following code to produce a packed 11x11x11 element array of 64 bit integers, but it doesn't:
...
6
votes
1
answer
79
views
Unexpected unpacking of wrapped PackedArray
I'm confused as to why the following leads to unpacking of a PackedArray:
...
5
votes
1
answer
62
views
Why is extracting values from an Association with 1 level slower than extracting values from a list of depth 1?
I am not looking for a solution or work-around, but an explanation.
Here are six examples of doing a trivial operation on an association and a list.
Initially, I was curious about the cost of calling ...
1
vote
0
answers
91
views
Unpacking array message in Compile and Fold
Suppose, I have a nonlinear map, like this:
...
5
votes
2
answers
153
views
Unexpected timing result of Total and Part performance of packed array
Define
a = RandomReal[1., {2, 100, 100, 100}];
then
Total[a, Infinity]; // RepeatedTiming
{0.00183727, Null}
and
...
2
votes
1
answer
41
views
Compression results in unpacking of integers but not reals
Consider the following;
Pack some integers.
In[287]:= Clear[p5i, p5ic, p5icu, p5r, p5rc, p5rcu]
In[288]:= p5i = ToPackedArray@Range@5
Out[288]= {1, 2, 3, 4, 5}
...
1
vote
0
answers
37
views
spontaneously quitting kernel, assignment and packed arrays
I am having an issue where the kernel spontaneously quits, deep in a long code that I have used for quite some time without this issue.
I've tracked it down to an assignment of the form:
a[[All, All, ...
4
votes
1
answer
63
views
Can't initialise packed array of rational numbers [closed]
If I evaluate the following code
t = Developer`ToPackedArray[{0, 2/7, -(1/7)}];
Developer`PackedArrayQ[t]
Mathematica returns ...
6
votes
1
answer
146
views
Why Does Subsets[...,{n}] not Output a Packed List, Even Though it Doesn't Unpack?
Assume list is packed.
I expect Subsets[] is a structural operation because it depends on the number of elements, not on what ...