On Wednesday, June 11, 2014 5:21:10 AM UTC-5, luserdroog wrote:
> On Monday, June 9, 2014 1:28:22 AM UTC-5, luserdroog wrote:
>
> > , and the further notion of converting multiple indices into a single index
> > on the ravel,
This appears to be much more crucial than just a "notion",
but yet another generalized, unifying concept. Converting
a vector of indices into a single index on the ravel is
our old friend base-decode with a weighting-vector,
motherfuckin' "Horner's Rule", yall!
And the reverse task of converting an index on the ravel
to a new indexing vector, from a new "interpretation" of
the implicit *linear* ordering, is the old trick duo mod
and integer-divide (or floor(div())), in a loop or an
iteration or a recursive decomposition or something.
Unless there's a simpler, cooler way I don't know about,
you have to do it over and over again to peel-off each
digit. This is the same technique I wrote about over on
code-golf describing ASCII85.
http://codegolf.stackexchange.com/a/8849/2381
The same way you print integers in assembly class (+0x30,
of course). "Digital" arithmetic, Holmes.
>>I've implemented a new jotdot for inca2.
> >
> >
https://github.com/luser-dr00g/inca/blob/318dc7677c6b8c7c5e63d9b0d2aba33d2058706a/inca2.c#L302
> >
> >
>
> Inner product appears to have a similar definition that's more
> complicated to implement. R←Af.gB, for array A of rank 3 and array B of rank 4,
>
> R[H;I;J;K] ←→ f / A[H;I;] g B[;J;K]
>
> This way requires taking slices of the arrays. The slices of A are always
> on the first dimension, so that's easy, but the other one ... ?? Still working
> on that.
>
> But it simplifies to the same case if we shuffle off the complexity to
> the transpose function. Then just transpose B appropriately and take the
> easy row slices.
>
> But there are at least two other ways I've run across, one using enclose
> each and axis.
>
> f/¨ (⊂[⍴⍴A]A)∘.g⊂[1]B
>
> And one using just axis slices.
>
> z[i;j]←→f/x[i;] g y[;j]
>
> And then Roger Hui's "row-at-a-time" version.
>
> z[i;]←→f⌿x[i;] g[0] y
>
> So, it's looks like the choice is: axis operator/function syntax
> or crazy transposes. Ack!
>
> Thanks for listening.
Still haven't written this stuff. But I think this dawning significance
of the linear combination/digits epiphany will yield results given the
appropriate nurture. Theretofore I have just polished off two 70's data
structures books. (What ever happened to SNOBOL?) And I'm now going
through "APL: The Language and its Usage", circa 1975.
I'm thinking a lot about how to add the char type concisely.
Should it "overflow" into an int when subjected to arithmetic?
Or it that normally a domain error?
--
in defiance of Carl Sagan's edict, I only read
Kant while stoned.