How to visually divide matrix into blocks

Discuss the formula editor
Post Reply
subdivider
Posts: 2
Joined: Mon Jun 08, 2009 4:10 pm

How to visually divide matrix into blocks

Post 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?
OOo 3.1.X on MS Windows Vista
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: How to visually divide matrix into blocks

Post by acknak »

Sorry, I don't see how it could be done. OOo Math has vertical ("mline") but not horizontal lines.
AOO4/LO5 • Linux • Fedora 23
subdivider
Posts: 2
Joined: Mon Jun 08, 2009 4:10 pm

Re: How to visually divide matrix into blocks

Post 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?
OOo 3.1.X on MS Windows Vista
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: How to visually divide matrix into blocks

Post by acknak »

No guru here, just too much time on my hands ;-)

[Tutorial] Reporting bugs or suggestions
AOO4/LO5 • Linux • Fedora 23
Dave
Posts: 1011
Joined: Sun Dec 23, 2007 6:53 pm

Re: How to visually divide matrix into blocks

Post 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.
randallbsmith
Posts: 7
Joined: Sat Mar 06, 2010 1:04 am

Re: How to visually divide matrix into blocks

Post 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.
Open Office 3.2.0 build 9483 with Mac OS 10.6.1
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: How to visually divide matrix into blocks

Post 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.
AOO4/LO5 • Linux • Fedora 23
User avatar
keme
Volunteer
Posts: 3699
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: How to visually divide matrix into blocks

Post 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
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
Post Reply