hy all, how to compute eigenvector from array bellow?
I am confused in make nested loop and temporary for compute eigenvector
please help me!!!
$data = array(
array(1,-0.52836,0),
array(-0.52836,1,-0.19845),
array(0,-0.19845,1)
);
$data2 = array(
array(1),
array(1),
array(1)
);
echo "<pre>";
//print_r($data2);
echo "</pre>";
for ($i=0;$i<count($data);$i++)
{
for ($j=0;$j<count($data[$i]);$j++)
{
$R2[$i][$j] = (($data[$i][0]*$data[0][$j])+($data[$i][1]*$data[1][$j])+($data[$i][2]*$data[2][$j]));
}
}
echo "<pre>";
print_r($R2);
echo "</pre>";
$aR = array();
for ($i=0;$i<count($R2);$i++)
{
for ($j=0;$j<count($R2[$i]);$j++)
{
if (isset($data2[$i][$j])){
$aR[] = (($R2[$i][0]*$data2[$i][$j])+($R2[$i][1]*$data2[$i][$j])+($R2[$i][2]*$data2[$i][$j]));
}
}
}
echo "<pre>";
//print_r($aR);
echo "</pre>";
$max = $aR;
$max = (max($max));
for ($i=0;$i<count($aR);$i++)
{
$iteration[] = round($max/$aR[$i],5);
}
echo "<pre>";
//print_r($iteration);
echo "</pre>";