index arrays for pfMorph

New Message Reply Date view Thread view Subject view Author view

Peter Chou (peter++at++galaxy.cambridge.com)
Fri, 14 Jun 1996 12:32:19 -0400


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.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Peter T. C. Chou
  Cambridge Research Associates, Inc. office: (703)790-0505 ext 7206
  1430 Spring Hill Road, Suite 200 FAX: (703)790-0370
  McLean, VA 22102 E-MAIL: peter++at++cambridge.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
=======================================================================
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.