home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!ucbvax!UX1.CSO.UIUC.EDU!gaylord
- From: gaylord@UX1.CSO.UIUC.EDU
- Newsgroups: sci.math.symbolic
- Subject: how to 'undo a Partition' ?
- Message-ID: <199207261235.AA13088@ux1.cso.uiuc.edu>
- Date: 26 Jul 92 12:35:19 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Lines: 65
-
- i'm going crazy(ier) using partition. here's what i'm looking at:
-
- starting with, for example:
-
- mat = {{0, 0, 0, 0}, {0, 4, 4, 0}, {0, 2, 0, 0}, {0, 0, 0, 0}};
-
-
- mat//MatrixForm
- 0 0 0 0
-
- 0 4 4 0
-
- 0 2 0 0
-
- 0 0 0 0
-
- i perform the following partition:
-
- submats= Partition[mat,{3,3},{1,1}];
- {{{{0, 0, 0}, {0, 4, 4}, {0, 2, 0}}, {{0, 0, 0}, {4, 4, 0}, {2, 0, 0}}},
- {{{0, 4, 4}, {0, 2, 0}, {0, 0, 0}}, {{4, 4, 0}, {2, 0, 0}, {0, 0, 0}}}}
-
- submats//MatrixForm
- 0 0 0 0 0 0
- 0 4 4 4 4 0
- 0 2 0 2 0 0
-
- 0 4 4 4 4 0
- 0 2 0 2 0 0
- 0 0 0 0 0 0
-
-
- the question is, if i'm going in the opposite direction, starting with
-
- submats = {{{{0, 0, 0}, {0, 4, 4}, {0, 2, 0}}, {{0, 0, 0}, {4, 4, 0}, {2,
- 0, 0}}},
- {{{0, 4, 4}, {0, 2, 0}, {0, 0, 0}}, {{4, 4, 0}, {2, 0,
- 0}, {0, 0, 0}}}}
-
- how do i get
-
- {{0, 0, 0, 0}, {0, 4, 4, 0}, {0, 2, 0, 0}, {0, 0, 0, 0}}
-
- i need the general soluution
-
- the general problem is this:
-
- what is XXX in
-
- list = XXX[Partition[list,...]]
-
- ie., how do you 'undo a Partition' ?
-
- this would be useful if you had a list and wanted to modify the elements of
- the list based on the sublists that you create from the list. sort of like
-
- newlist = Unpartition[Map[Test, Partition[list,...] ] ]
-
- thanks for any suggestions.
-
-
-
-
-
-
-