W3C home > Mailing lists > Public > www-math@w3.org > May 2007

Re: sparse matrix support in MathML

From: Max Berger <max@berger.name>
Date: Thu, 31 May 2007 14:44:04 +0200
Message-ID: <465EC314.6000907@berger.name>
To: Michael Weitzel <michael.weitzel@uni-siegen.de>
CC: www-math@w3.org
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">
    <mtr col="1"><cn>1</cn></mtr>
    <mtr col="2"><cn>2</cn></mtr>
    <mtr col="4"><cn>3</cn></mtr>
  </mrow><mrow row="4">
    <mtr col="4"><cn>4</cn></mtr>

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.


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

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 21:46:44 UTC