src/Alg/Math/Algebra/GaussElimination.php
public function eliminate( $matrix )
	{
		$lines	= $matrix->getRowNumber();
		for( $i=0; $i<$lines-1; $i++ )
		{
			$r	= $this->findPivotRow( $matrix, $i, $i );
			if( $i != $r )
				$matrix->swapRows( $r, $i );
			for( $j=$i+1; $j<$lines; $j++ )
			{
				$f	= $matrix->getValue( $j, $i ) / $matrix->getValue( $i, $i );
				for( $k=$i; $k<$matrix->getColumnNumber(); $k++ )
				{
					$value	= $matrix->getValue( $j, $k ) - $f * $matrix->getValue( $i, $k );
					$matrix->setValue( $j, $k, $value );
				}
			}
		}
		return $matrix;
	}
public function eliminate( $matrix )
	{
		$lines	= $matrix->getRowNumber();
		for( $i=0; $i<$lines-1; $i++ )
		{
			$r	= $this->findPivotRow( $matrix, $i, $i );
			if( $i != $r )
				$matrix->swapRows( $r, $i );
			for( $j=$i+1; $j<$lines; $j++ )
			{
				$f	= $matrix->getValue( $j, $i ) / $matrix->getValue( $i, $i );
				for( $k=$i; $k<$matrix->getColumnNumber(); $k++ )
				{
					$value	= $matrix->getValue( $j, $k ) - $f * $matrix->getValue( $i, $k );
					$matrix->setValue( $j, $k, $value );
				}
			}
		}
		return $matrix;
	}
public function eliminate ( $ matrix ) { $ lines = $ matrix -> getRowNumber ( ) ; for ( $ i = 0 ; $ i < $ lines - 1 ; $ i ++ ) { $ r = $ this -> findPivotRow ( $ matrix , $ i , $ i ) ; if ( $ i != $ r ) $ matrix -> swapRows ( $ r , $ i ) ; for ( $ j = $ i + 1 ; $ j < $ lines ; $ j ++ ) { $ f = $ matrix -> getValue ( $ j , $ i ) / $ matrix -> getValue ( $ i , $ i ) ; for ( $ k = $ i ; $ k < $ matrix -> getColumnNumber ( ) ; $ k ++ ) { $ value = $ matrix -> getValue ( $ j , $ k ) - $ f * $ matrix -> getValue ( $ i , $ k ) ; $ matrix -> setValue ( $ j , $ k , $ value ) ; } } } return $ matrix ; }
Eliminates Matrix using Gauss Algorithm.
@access		public
@param		Alg_Math_Algebra_Matrix		$matrix		Matrix to eliminate
@return		Alg_Math_Algebra_Matrix
Eliminates Matrix using Gauss Algorithm .