[Haskell-cafe] How to devide matrix into small blocks

L.Guo leaveye.guo at gmail.com
Thu Jun 14 05:24:28 EDT 2007


Hi Janis.


I think either my data format or my original question confuses you.


About the problem description.

When I send the question, I have not decide how to manage the block data.
If the rough question confuse you, I have to say sorry.


About the data.

The whole image is of type [[a]], and after being devided, it is also [[a]].

eg.

for (w,h) = (2,2)

a b c d
e f g h
i j k l
m n o p

makes

a b e f
c d g h
i j m n
k l o p

in another word, mkBlocks makes [pixels-of-lines] into [pixels-in-blocks].

This cryptical type is easy to form and to form from type [[pixels-of-lines-in-block]], and also, is close to my future purpose.


Thanks.

------------------				 
L.Guo
2007-06-14

-------------------------------------------------------------
From: Janis Voigtlaender
At: 2007-06-14 15:42:40
Subject: Re: [Haskell-cafe] How to devide matrix into small blocks

L.Guo wrote:
> I have wrote the target function like this, and tested.
> 
> mkBlocks (w,h) = map concat . concat . transpose . chop h . map (chop w)

I don't understand how this relates to your original problem
description. But then, again, I probably did not understand that one too
well.



More information about the Haskell-Cafe mailing list