Hi Folks,
My application uses lots of matrix operations. I used the SAXON Tool Profile
(-TP) option to generate a web page that shows the performance of each of my
matrix operations. I found that my matrix addition function is taking an
appallingly large amount of time. Below is my matrix addition function. Do you
have suggestions on ways to improve its performance? /Roger
<!--
A matrix can only be added to another matrix if the two matrices
have the same dimensions. To add two matrices, just add the
corresponding entries, and place this sum in the corresponding
position in the matrix which results.
-->
<xsl:function name="matrix:addition" as="element(Matrix)">
<xsl:param name="M" as="element(Matrix)" />
<xsl:param name="N" as="element(Matrix)" />
<xsl:param name="name-of-result-matrix" as="xs:string" />
<Matrix id="{$name-of-result-matrix}">
<xsl:for-each select="1 to count($M/row)">
<xsl:variable name="i" select="." as="xs:integer"/>
<row>
<xsl:for-each select="1 to count($M/row[$i]/col)">
<xsl:variable name="j" select="." as="xs:integer"/>
<col>
<xsl:value-of select="$M/row[$i]/col[$j] +
$N/row[$i]/col[$j]"/>
</col>
</xsl:for-each>
</row>
</xsl:for-each>
</Matrix>
</xsl:function>
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--