Skip to main content

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.

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 ...
OneDeuxTriSeiGo's user avatar
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: ...
Kuba hasn't forgotten Monica's user avatar
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 (...
Learner's user avatar
  • 219
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: ...
yode's user avatar
  • 26.9k
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. ...
imida k's user avatar
  • 4,315
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 ...
Todd Allen's user avatar
  • 2,124
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: ...
Bruce Bartlett's user avatar
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: ...
TimRias's user avatar
  • 3,180
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 ...
Craig Carter's user avatar
  • 4,625
1 vote
0 answers
91 views

Unpacking array message in Compile and Fold

Suppose, I have a nonlinear map, like this: ...
macros's user avatar
  • 99
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 ...
matheorem's user avatar
  • 17.2k
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} ...
RobertNathaniel's user avatar
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, ...
Jansen's user avatar
  • 1,223
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 ...
Gert's user avatar
  • 1,620
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 ...
Just Some Old Man's user avatar

15 30 50 per page
1
2 3 4 5 6