home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / sci / math / symbolic / 2077 < prev    next >
Encoding:
Internet Message Format  |  1992-07-26  |  1.5 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!ucbvax!UX1.CSO.UIUC.EDU!gaylord
  2. From: gaylord@UX1.CSO.UIUC.EDU
  3. Newsgroups: sci.math.symbolic
  4. Subject: how to 'undo a Partition' ?
  5. Message-ID: <199207261235.AA13088@ux1.cso.uiuc.edu>
  6. Date: 26 Jul 92 12:35:19 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 65
  9.  
  10. i'm going crazy(ier) using partition. here's what i'm looking at:  
  11.  
  12. starting with, for example:
  13.  
  14. mat = {{0, 0, 0, 0}, {0, 4, 4, 0}, {0, 2, 0, 0}, {0, 0, 0, 0}};
  15.  
  16.  
  17. mat//MatrixForm
  18. 0   0   0   0
  19.  
  20. 0   4   4   0
  21.  
  22. 0   2   0   0
  23.  
  24. 0   0   0   0
  25.  
  26. i  perform the following partition:
  27.  
  28. submats= Partition[mat,{3,3},{1,1}];
  29. {{{{0, 0, 0}, {0, 4, 4}, {0, 2, 0}}, {{0, 0, 0}, {4, 4, 0}, {2, 0, 0}}}, 
  30.  {{{0, 4, 4}, {0, 2, 0}, {0, 0, 0}}, {{4, 4, 0}, {2, 0, 0}, {0, 0, 0}}}}
  31.  
  32. submats//MatrixForm
  33. 0 0 0   0 0 0
  34. 0 4 4   4 4 0
  35. 0 2 0   2 0 0
  36.  
  37. 0 4 4   4 4 0
  38. 0 2 0   2 0 0
  39. 0 0 0   0 0 0
  40.  
  41.  
  42. the question is, if i'm going in the opposite direction, starting with 
  43.  
  44. submats = {{{{0, 0, 0}, {0, 4, 4}, {0, 2, 0}}, {{0, 0, 0}, {4, 4, 0}, {2,
  45. 0, 0}}}, 
  46.                     {{{0, 4, 4}, {0, 2, 0}, {0, 0, 0}}, {{4, 4, 0}, {2, 0,
  47. 0}, {0, 0, 0}}}} 
  48.  
  49. how do i get 
  50.  
  51.  {{0, 0, 0, 0}, {0, 4, 4, 0}, {0, 2, 0, 0}, {0, 0, 0, 0}}
  52.  
  53. i need the general soluution
  54.  
  55. the general problem is this: 
  56.  
  57. what is XXX in
  58.  
  59. list = XXX[Partition[list,...]]
  60.  
  61. ie., how do you 'undo a Partition' ?
  62.  
  63. this would be useful if you had a list and wanted to modify the elements of
  64. the list based on the sublists that you create from the list. sort of like 
  65.  
  66. newlist =  Unpartition[Map[Test, Partition[list,...] ] ]
  67.  
  68. thanks for any suggestions.
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.