Re: index arrays for pfMorph

New Message Reply Date view Thread view Subject view Author view

John Rohlf (jrohlf++at++tubes.asd.sgi.com)
Fri, 14 Jun 1996 10:29:57 -0700


On Jun 14, 12:32pm, Peter Chou wrote:
> Subject: index arrays for pfMorph
>
> I am confused by the man page of pfMorph about using index arrays.
> The man page said:
>
> pfMorph(3pf) IRIS Performer 2.0 libpf C Reference Pages
     pfMorph(3pf)
>
> There are 2 distinct methods of accessing the source arrays of a pfMorph
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> attribute: non-indexed and indexed. Indexing provides a means of
> efficiently applying sparse changes to the destination array. ...
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ...
> for (s=0; s<nsrcs; s++)
> {
> if (ilist == NULL || ilist[s] == NULL)
> {
> /* Source is non-indexed */
> for (i=0; i<nelts; i++)
> for (e=0; e<floatsPerElt; e++)
> dst[i][e] += weights[s] * alist[s][i][e];
> }
> else
> {
> /* Source is indexed */
> ^^^^^^
> int nindex;
>
> if (nlist == NULL)
> nindex = nelts;
> else
> nindex = nlist[s];
>
> Page
4
>
> pfMorph(3pf) IRIS Performer 2.0 libpf C Reference Pages
     pfMorph(3pf)
>
> for (i=0; i<nindex; i++)
> for (e=0; e<floatsPerElt; e++)
> dst[ilist[s][i]][e] += weights[s] * alist[s][i][e];
> ^^^^^^^^^^^ ^^^
> }
> }
> ...
>
> The descriptive part "seems" to imply that ilist[] should be prepared
> for indexing the source arrays (and the destination array too?), but
> the pseudocode says ilist[] is used only on destination array.
>
> If I follow the descriptive part, it seems that the pseudocode for
> computing the dst[] with indexed method should read
>
> dst[ilist[s][i]][e] += weights[s] * alist[s][ilist[s][i]][e];
> ^^^^^^^^^^^
> or something else. But if the pseudocode in the man page really means
> what it does, then it seems to me the index arrays are for "accessing
> the DESTINATION array" rather than "accessing the SOURCE arrays".
>
> Could someone tell me whether I should follow the descriptive part
> or the pseudocode of the man page in order to prepare the index arrays
> for pfMorph? Many thanks in advance.

The pseudo-code is correct.

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer.html
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:00 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.