Calculation of a determinant of a matrix of the any order on the first line
Download
View Source (print view)
Rating : 4.7
Views : 473
function determinant($matrica) {
$determinant=0;
if (sizeof($matrica)==1)
return $matrica[0][0];
for ($i=0; $i<sizeof($matrica); $i++) {
// We form a minor
$row_index=0;
for ($j=0; $j<sizeof($matrica); $j++) {
$column_index=0;
if($j!=0) {
for ($k=0; $k<sizeof($matrica); $k++) {
if ($k!=$i) {
$minor[$i][$row_index][$column_index]=$matrica[$j][$k];
$column_index++;
}
}
$row_index++;
}
}
// We form algebraic addition
$algebraic_addition[$i]=pow(-1, (2+$i))*determinant($minor[$i]);
$determinant+=$matrica[0][$i]*$algebraic_addition[$i];
}
return $determinant;
}
guest, enfactuation, rent a car, download, regirstration form, php_snips, fedex, call php', userstatusinonline, php_script"_class="neww"_target="_blank"_title="im_neuen, best ide, php script" class="neww" target="_b..., forum, p t test paired, php_tools, href php function, utfraw, php jobs, php script and char(124) (select cast(count(1) as varchar(8000)) char(124) from [sysobjects] where 1=1)>0 and =, commit