What I know:
PackedArrayis documented (to some extent) in "Developer Utilities Package",RawArrayis just mentioned inRaster3DandImageApply,RawArraysupportsByte,SignedInteger8/16/32,Bit16,Real32,RealandComplex128as entries, whilePackedArrayonlyInteger,RealandComplex(128),PackedArraydisplays as a list butRawArrayas (somewhat of) a skeleton.
What I do not understand is why there are two of them. Why not just stick with the one that supports more entry types and display it as skeleton if and only if it is too long?
Also, how does ByteArray fit into the picture?
Edit: You can create a PackedArray using:
ap = Developer`ToPackedArray[{1, 2, 3}]
(* {1,2,3} *)
Developer`PackedArrayQ[ap]
(* True *)
Developer`PackedArrayForm[ap]
(* PackedArray[Integer, <3>] *)
(Note that there is in fact no PackedArray command, the head of the last output expression is a string.)
You can create a RawArray using:
ar = Developer`AllocateRawArray["Byte", {2, 2}]
(* RawArray[Byte, <2,2>] *)
Developer`RawArrayQ[ar]
(* True *)
Developer`RawArrayType[ar]
(* Byte *)
(ditto about RawArray).
You can create a ByteArray directly:
ab = ByteArray[{1,2,3}]
(* ByteArray[<3>] *)
ByteArrayQ[ab]
(* True *)
All the cross-tests (e.g., RawArrayQ done on ab) return False.
Comments
Post a Comment