Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Pairing of Nodes
Replies: 0

 Xah Lee Posts: 171 Registered: 12/4/04
Pairing of Nodes
Posted: Nov 12, 1996 1:20 PM

This is a summary on a programing problem "pairing of nodes". Not many
people wrote. I wish they would.

Problem: Pairing of Nodes.
Given two list of the same Dimensions, how to combine the list so that
the end nodes of the new list pair the end nodes of given lists. Example
and solution:

Clear[li1, li2]

li1 = Array[f, {2,3,4}]
li2 = Array[g, {2,3,4}]

Transpose[ {li1, li2},RotateRight@ Range@ Length@ Dimensions@ {li1,
li2}]

(* ---------solutions --------------*)

(*From: fransm@win.tue.nl (Frans Martens) *)

(*rhall2@umbc.edu (hall robert)*)

li1 + li2 /. Plus -> List

Xah
xah@best.com; 74631.731@compuserve.com

http://www.best.com/~xah/SpecialPlaneCurves_dir/InversionGallery_dir/inversionGallery.html
Mountain View, CA, USA