方法将矩阵分成小矩阵的块 [英] Method to split a matrix into blocks of the small matrix

查看:201
本文介绍了方法将矩阵分成小矩阵的块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,想知道如果有人能提供一个理想的解决方案。

I have a problem and would like to know if anyone could offer an ideal solution.

基本上(小数据),但是,如果我有这样的一个矩阵:

Basically (small data) but, if I have a matrix like this:

     0 1 0 0
     1 1 1 0
     0 0 0 0
     1 1 0 0

我然后需要分割此矩阵成大小相同的第二矩阵的块,在这种情况下,2×2:

I then need to split this matrix into blocks that are of the same size as the second matrix, in this case 2x2:

0 1
1 1

我知道它有什么做的offsetX / Y值,而这些变化取决于(小)矩阵的大小,我只是不知道这个算来计算这样的结果。我将要传递offsetX / Y到函数(矢量),所以我可以计算出特定块的总和。

I know it has something to do with the offsetX/Y values and these change depending on the size of the (small) matrix, I just don't know the calculation to calculate such results. I'm going to be passing the offsetX/Y to a function (with the vector) so I can calculate the sum of the particular block.

有没有人有什么建议?

感谢

推荐答案

在数学上,你可以分割矩阵的曲线,例如AZ曲线或皮亚诺曲线。这样,你也将减少尺寸的复杂性。为Z曲线采用4四边形分裂飞机,像一个四叉树。

Mathematically you can split the matrix with a curve for example a z curve or a peano curve. That way you would also reduce the dimensional complexity. A z curve uses 4 quads to split a plane and resemble a quadtree.

编辑:我刚刚得知,它的Z顺序曲线,而不是ž曲线:的http:// en.wikipedia.org/wiki/Z-order_curve 。为Z曲线是三维的东西在bionformatics http://en.wikipedia.org/wiki/Z_curve ???大声笑!我不是一个生物信息学家,也没有我在维基百科,但声音对我来说没有什么意义。一个Z有序的曲线也可以覆盖一个三维区域。也许维基百科想说这个?这里是一个三维的Z顺序曲线的大图片的http:// EN .wikipedia.org /维基/文件:勒贝格-3D-step3.png 。它甚至在维基百科的文章?????

I just learned that it's z-order curve and not z curve: http://en.wikipedia.org/wiki/Z-order_curve. A z curve is something 3d in bionformatics http://en.wikipedia.org/wiki/Z_curve??? LOL! I'm not a bioinformaticians nor am I in wikipedia but that sound to me like nonsense. A z-ordered curve can also cover a 3d area. Maybe wikipedia wants to say this? Here is a big picture of a 3d z-order curve http://en.wikipedia.org/wiki/File:Lebesgue-3d-step3.png. It's even on the wikipedia article?????

这篇关于方法将矩阵分成小矩阵的块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆