Page 1 of 1

How to visually divide matrix into blocks

Posted: Mon Jun 08, 2009 4:22 pm
by subdivider
I want to visually divide matrix into block submatrices separated by horizontal and vertical lines. If you can't imagine what i am talking about, than for example look at Hoppe's paper about mesh simplification, here:
http://research.microsoft.com/en-us/um/ ... newqem.pdf
Is it possible with OOo?

Re: How to visually divide matrix into blocks

Posted: Mon Jun 08, 2009 5:12 pm
by acknak
Sorry, I don't see how it could be done. OOo Math has vertical ("mline") but not horizontal lines.

Re: How to visually divide matrix into blocks

Posted: Mon Jun 08, 2009 6:32 pm
by subdivider
acknak wrote:Sorry, I don't see how it could be done. OOo Math has vertical ("mline") but not horizontal lines.
Thank You for your immediate reply. By the number of your posts I guess that You are something like Guru. Please how is it (if anything) possible to include this problem to list of feature requests?

Re: How to visually divide matrix into blocks

Posted: Mon Jun 08, 2009 8:00 pm
by acknak
No guru here, just too much time on my hands ;-)

[Tutorial] Reporting bugs or suggestions

Re: How to visually divide matrix into blocks

Posted: Fri Jun 12, 2009 3:06 pm
by Dave
I don't use the math editor, but do use MathType. There, I'd first form a fraction [which has a horizontal division line], surrounded by brackets. Then in the top I'd form a single row matrix [or whatever], and a multiple row matrix in the bottom. if you can do the same in the Formula editor, then you have what you want perhaps.

David.

Re: How to visually divide matrix into blocks

Posted: Fri Oct 08, 2010 2:57 pm
by randallbsmith
The suggestion of using a fraction combined with mline sounds good, but I can't get mline to work unless it is part of a langle ... mline ... rangle triple. Specifically

{a mline b} over {c mline d}

does not appear to parse.

I tried using angle brackets with the mline, and then using color to make the angle bracket parts white, but this didn't work either.

Note that even if this did work for a simple case, in general for matrix blocks you want the column widths to be the same above and below the dividing line. I don't see how that can happen without a special command of some sort.

Re: How to visually divide matrix into blocks

Posted: Fri Oct 08, 2010 7:55 pm
by acknak
The vertical rule commands, {l,m,r}line, apparently have to appear within stretchable brackets of some kind, but you can always use the "none" brackets on both sides:
  • left none a mline b right none
    over
    left none c mline d right none
However, the result does not look much like a matrix or table, at least to my non-maths eye.

You might do better to combine a Writer table with separate Math formulas in each table cell.

Re: How to visually divide matrix into blocks

Posted: Tue Oct 12, 2010 1:41 am
by keme
Using the larger internal matrice from the expression in page 3, bottom of the first column. I split the matrice into 4 "sub-matrices".
The best I can do when following Dave's idea, using the findings of randallbsmith and acknak, are...

Reading the matrix row by row, in terms of sub-matrices:

Code: Select all

left ( 
	{left none {g_j g^T_j} mline matrix { dotsdown 0 dotsdown  # -g_j # dotsdown 0 dotsdown} right none }
	over
	{left none 
	matrix { dotsdown 0 dotsdown  ## -g_j ## dotsdown 0 dotsdown} 
	mline
	matrix 
		{ dotsdown 0 dotsdown  # 0 # dotsdown 0 dotsdown ##
		dotsaxis 0 dotsaxis # 1 # dotsaxis 0 dotsaxis ##
		dotsdown 0 dotsdown  # 0 # dotsdown 0 dotsdown } 
	right none} 
right )
Reading the matrix column by column, in terms of sub-matrices:

Code: Select all

left ( matrix 
	{{g_j g^T_j} over matrix { dotsdown 0 dotsdown  ## -g^T_j ## dotsdown 0 dotsdown}
	} mline matrix {
	matrix { dotsdown 0 dotsdown  # -g_j # dotsdown 0 dotsdown}
	over
	matrix 
		{ dotsdown 0 dotsdown  # 0 # dotsdown 0 dotsdown ##
		dotsaxis 0 dotsaxis # 1 # dotsaxis 0 dotsaxis ##
		dotsdown 0 dotsdown  # 0 # dotsdown 0 dotsdown } 
	} 
right )
Neither is perfect. The rows and columns of sub-matrices are not synchronized within the larger matrix, so any great difference in "greatest element" width/heigth will skew the matrix layout across the dividing line. This is apparent as a skewed vertical divider in the first example, and misaligned lower left element in both examples (more apparent in the last example). This might be fixed by inserting phantom elements, but I'm not sure how I would go about it. With my limited experience in working with matrices, for me the above attempts are just barely workable already. Someone else may have the time and skills to elaborate further. Me, I'd go with the table suggestion from acknak