Re: sparse matrix support in MathML

Dear WWW-Math Community,

Michael Weitzel schrieb:
> <smatrix columns="4">
>   <smatrixrow>
>     <smatrixelem col="1"><cn>1</cn></smatrixelem>
>     <smatrixelem col="2"><cn>2</cn></smatrixelem>
>   </smatrixrow>
>   <smatrixrow>
>     <smatrixelem col="4"><cn>3</cn></smatrixelem>
>   </smatrixrow>
>   <smatrixrow>
>     <smatrixelem col="4"><cn>4</cn></smatrixelem>
>   </smatrixrow>
> </smatrix>

I really like this idea, but I would suggest some changes to make
implementation easier:

- Reuse mtable, mrow, mcolumn (otherwise functionality is duplicated).
- Introduce consistent skipping for rows / columns

For this matrix (slightly changed):

1 2 0 0
0 0 0 3
0 0 0 0
0 0 0 4

This would lead to:
<mtable columns="4" rows="4">
  <mrow>
    <mtr col="1"><cn>1</cn></mtr>
    <mtr col="2"><cn>2</cn></mtr>
  </mrow><mrow>
    <mtr col="4"><cn>3</cn></mtr>
  </mrow><mrow row="4">
    <mtr col="4"><cn>4</cn></mtr>
  </mrow>
</mtable>

Columns and rows attribute on mtable would be optional, the actual
number of rows would be max(rows attribute, given rows, largest row
attribute), same for columns.

If there is no col="" attribute, it is assume to be col(last mtr)+1.
cols must be strict monotonic increasing. (same for rows).

To be completely consistent, it may also make sense to name the col
attribute column.

Just my 2 cts.

mfG

Max Berger
e-mail: max@berger.name

-- 
OpenPG ID: E81592BC   Print: F489F8759D4132923EC4 BC7E072AB73AE81592BC
For information about me and my work please see http://max.berger.name

Received on Thursday, 31 May 2007 12:44:44 UTC