Thanks Pascal's verb best deals with the data I am handling: lists of integers and floating points.
As for sparse arrays. Yes this would be ideal unfortunately J's serialization 5!:5 <'array' goes all wonky on sparse arrays. Sparse arrays are only half done in J. They cannot be boxed and serialization, deserialization is not ready for prime time. They'e nice when they can be used but with existing limitations the use cases are rare. Ultimately the arrays I produce must be reliably 5!:5 ' able. On Mon, Jun 29, 2015 at 11:22 AM, 'Pascal Jasmin' via Programming < [email protected]> wrote: > pretty much the same as the rosettacode solution, but focused on an > internal representation rather than outputting a string > > torle =: (1 ,~ 2&(~:/\)) ({. , #);.2 ] > frle =: ([: ; <@#~/"1) :.torle > > > > ----- Original Message ----- > From: Raul Miller <[email protected]> > To: Programming forum <[email protected]> > Cc: > Sent: Monday, June 29, 2015 12:04 PM > Subject: Re: [Jprogramming] integer run length compression > > Perhaps http://rosettacode.org/wiki/Run-length_encoding#J > > Thanks, > > -- > Raul > > > On Mon, Jun 29, 2015 at 11:55 AM, John Baker <[email protected]> wrote: > > I vaguely remember reading forum traffic sometime ago about a simple > > J based run length encoding verb for integers. > > > > eg: > > > > If you have list of integers with many runs of the same value. > > > > 0 0 0 0 0 0 2 4 4 4 4 2 0 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 > 0 2 > > 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > > > What's a good way to compress, and decompress, this using only J? > > > > Just thought I would ask before rolling my own. > > > > -- > > John D. Baker > > [email protected] > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- John D. Baker [email protected] ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
