方法将矩阵分成小矩阵的块矩阵、方法

2023-09-11 06:41:19 作者:执笔画浮尘

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

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 https://m.xsw88.com/allimgs/daicuo/20230911/3167.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?????