Home » Math » Math_Matrix » Bug #5438
transposing not square matrices
Details
| Request #5438 | transposing not square matrices |
|---|---|
| Submitted | 2005-09-17 03:11 UTC |
| From | tiedtke at gmai dot com |
| Status | Bogus |
| Package | Math_Matrix |
| PHP Version | 4.4.1 |
| OS | Win/Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-09-17 03:11 UTC] tiedtke at gmai dot com
Description:
------------
A change that would be interesting in the method transpose (line 661), is the possibility of if transposing not square matrices, with little change in the implementation of the method. Another suggestion is in the method "multiply" (line 1156), where it could receive a parameter from a scalar number to multiply for the entire matrix, it follows some examples
Test script:
---------------
Transpose a matrix non square:
function TransposeMatrix ( $m ) {
list($n_lin, $n_col) = $m->getSize();
$tmp = buildMatrix($n_col, $n_lin);
for( $i = 0 ; $i < $n_lin ; $i++)
for( $j = 0 ; $j < $n_col ; $j++)
$tmp->setElement( $j, $i, $m->getElement( $i, $j) );
return $tmp;
}
[2005-09-17 03:13 UTC] tiedtke at gmai dot com
multiply by a scalar number, sorry, i don't see the method scale, disrespect this citation