ch.javasoft.smx.ops
Class GaussPivoting.BiLenProductLorEandMoreRowZeros

java.lang.Object
  extended by ch.javasoft.smx.ops.GaussPivoting.BiLenProductLorEandMoreRowZeros
All Implemented Interfaces:
GaussPivoting<ReadableBigIntegerRationalMatrix<BigFraction>>
Enclosing interface:
GaussPivoting<M extends ReadableMatrix<?>>

public static class GaussPivoting.BiLenProductLorEandMoreRowZeros
extends Object
implements GaussPivoting<ReadableBigIntegerRationalMatrix<BigFraction>>

This pivoting strategy for (B)ig (I)nteger rational matrices uses the product of the bit lengths of numerator and denominator. Note that the length is an estimate for the logarithm of the big integer numbers. A pivot element is chosen if the product is (L)ess than the value of a previous candidate. If it is equal, the number of zeros of the row determines the choice of the pivot element.

pivot, if bitlen(numerator)*bitlen(denominator) < previous OR bitlen(numerator)*bitlen(denominator) == previous AND #rowzeros > previous


Nested Class Summary
 
Nested classes/interfaces inherited from interface ch.javasoft.smx.ops.GaussPivoting
GaussPivoting.BiLenProductL, GaussPivoting.BiLenProductLE, GaussPivoting.BiLenProductLorEandMoreRowZeros, GaussPivoting.BiLenSumLorEandMoreRowZeros, GaussPivoting.BiMaxLenLorEandMoreRowZeros
 
Constructor Summary
GaussPivoting.BiLenProductLorEandMoreRowZeros(int pivot)
           
 
Method Summary
 boolean checkCandidateCol(ReadableBigIntegerRationalMatrix<BigFraction> matrix, int pivot, int row, int col, int zerCnt)
          Check metrix value, e.g.
 int checkCandidateRow(ReadableBigIntegerRationalMatrix<BigFraction> matrix, int pivot, int row)
          Check a whole row, e.g.
 int getPivotCol()
          Returns the column index of the pivot row
 int getPivotRow()
          Returns the row index of the pivot row
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaussPivoting.BiLenProductLorEandMoreRowZeros

public GaussPivoting.BiLenProductLorEandMoreRowZeros(int pivot)
Method Detail

checkCandidateRow

public int checkCandidateRow(ReadableBigIntegerRationalMatrix<BigFraction> matrix,
                             int pivot,
                             int row)
Description copied from interface: GaussPivoting
Check a whole row, e.g. to count the number of zeros for the row, since checkCandidateCol(..) is only called for non-zero values. The returned value is then passed to checkCandidateCol(..).

Specified by:
checkCandidateRow in interface GaussPivoting<ReadableBigIntegerRationalMatrix<BigFraction>>
Parameters:
matrix - the matrix to check
pivot - the pivot index, 0 for the first pivot
row - the row to check
Returns:
a value which is then passed to subsequent calls to checkCandidateCol(..)

checkCandidateCol

public boolean checkCandidateCol(ReadableBigIntegerRationalMatrix<BigFraction> matrix,
                                 int pivot,
                                 int row,
                                 int col,
                                 int zerCnt)
Description copied from interface: GaussPivoting
Check metrix value, e.g. to find smallest or largest pivot elements. Note that this method is only called for non-zero values. Returns true if the search should be continued, and false if the pivot is already found and searching can be aborted.

Specified by:
checkCandidateCol in interface GaussPivoting<ReadableBigIntegerRationalMatrix<BigFraction>>
Parameters:
matrix - the matrix to check
pivot - the pivot index, 0 for the first pivot
row - the row index of the value to check
col - the column index of the value to check
zerCnt - the result which was previously returned by checkCandidateRow(..)
Returns:
true if the pivot search should be continued, and false if the pivot is already identified and searching can be aborted

getPivotCol

public int getPivotCol()
Description copied from interface: GaussPivoting
Returns the column index of the pivot row

Specified by:
getPivotCol in interface GaussPivoting<ReadableBigIntegerRationalMatrix<BigFraction>>

getPivotRow

public int getPivotRow()
Description copied from interface: GaussPivoting
Returns the row index of the pivot row

Specified by:
getPivotRow in interface GaussPivoting<ReadableBigIntegerRationalMatrix<BigFraction>>