ch.javasoft.smx.impl
Class AbstractDoubleMatrix

java.lang.Object
  extended by ch.javasoft.smx.impl.AbstractDoubleMatrix
All Implemented Interfaces:
DoubleMatrix, MatrixBase<Double>, ReadableDoubleMatrix<Double>, ReadableMatrix<Double>, WritableBigIntegerMatrix<Double>, WritableBigIntegerRationalMatrix<Double>, WritableDoubleMatrix<Double>, WritableIntMatrix<Double>, WritableIntRationalMatrix<Double>, WritableLongMatrix<Double>, WritableLongRationalMatrix<Double>, WritableMatrix<Double>, Cloneable
Direct Known Subclasses:
DefaultDoubleMatrix, DefaultDoubleVector, DynamicDoubleMatrix, SubDoubleMatrix

public abstract class AbstractDoubleMatrix
extends Object
implements DoubleMatrix

The AbstractDoubleMatrix contains methods which are typically common for DoubleMatrix implementations, or default implementations for some methods.


Constructor Summary
AbstractDoubleMatrix()
           
 
Method Summary
 void add(int row, int col, BigInteger value)
           
 void add(int row, int col, BigInteger dividend, BigInteger divisor)
           
 void add(int row, int col, double value)
           
 void add(int row, int col, int value)
           
 void add(int row, int col, int dividend, int divisor)
           
 void add(int row, int col, long value)
           
 void add(int row, int col, long dividend, long divisor)
           
 void addRowToOtherRow(int srcRow, BigInteger srcDividend, BigInteger srcDivisor, int dstRow, BigInteger dstDividend, BigInteger dstDivisor)
           
 void addRowToOtherRow(int srcRow, BigInteger srcFactor, int dstRow, BigInteger dstFactor)
           
 void addRowToOtherRow(int srcRow, double srcFactor, int dstRow, double dstFactor)
           
 void addRowToOtherRow(int srcRow, int srcFactor, int dstRow, int dstFactor)
           
 void addRowToOtherRow(int srcRow, int srcDividend, int srcDivisor, int dstRow, int dstDividend, int dstDivisor)
           
 void addRowToOtherRow(int srcRow, long srcFactor, int dstRow, long dstFactor)
           
 void addRowToOtherRow(int srcRow, long srcDividend, long srcDivisor, int dstRow, long dstDividend, long dstDivisor)
           
abstract  AbstractDoubleMatrix clone()
           
 boolean equals(DoubleMatrix other, double toleration)
           
static boolean equals(DoubleMatrix mxA, DoubleMatrix mxB, double toleration)
           
 boolean equals(Object obj)
           
 double[] getDoubleColumn(int col)
           
static double[] getDoubleColumn(ReadableDoubleMatrix mx, int col)
           
 double[][] getDoubleColumns()
           
static double[][] getDoubleColumns(ReadableDoubleMatrix mx)
           
 double[] getDoubleRow(int row)
           
static double[] getDoubleRow(ReadableDoubleMatrix mx, int row)
           
 double[][] getDoubleRows()
           
static double[][] getDoubleRows(ReadableDoubleMatrix mx)
           
 MatrixOperations<Double> getMatrixOperations()
           
 DoubleOperations getNumberOperations()
           
 Double[][] getNumberRows()
           
static Double[][] getNumberRows(ReadableDoubleMatrix mx)
           
 Double getNumberValueAt(int row, int col)
           
 int getSignumAt(int row, int col)
           
 int hashCode()
           
 void multiply(int row, int col, BigInteger factor)
           
 void multiply(int row, int col, BigInteger dividend, BigInteger divisor)
           
 void multiply(int row, int col, double factor)
           
 void multiply(int row, int col, int factor)
           
 void multiply(int row, int col, int dividend, int divisor)
           
 void multiply(int row, int col, long factor)
           
 void multiply(int row, int col, long dividend, long divisor)
           
 void multiplyRow(int row, BigInteger factor)
           
 void multiplyRow(int row, BigInteger dividend, BigInteger divisor)
           
 void multiplyRow(int row, double factor)
           
 void multiplyRow(int row, int factor)
           
 void multiplyRow(int row, int dividend, int divisor)
           
 void multiplyRow(int row, long factor)
           
 void multiplyRow(int row, long dividend, long divisor)
           
 void negate(int row, int col)
           
 void setValueAt(int row, int col, BigFraction value)
           
 void setValueAt(int row, int col, BigInteger value)
           
 void setValueAt(int row, int col, BigInteger dividend, BigInteger divisor)
           
 void setValueAt(int row, int col, Double value)
           
 void setValueAt(int row, int col, int value)
           
 void setValueAt(int row, int col, int dividend, int divisor)
           
 void setValueAt(int row, int col, long value)
           
 void setValueAt(int row, int col, long dividend, long divisor)
           
 DoubleMatrix subDoubleMatrix(int rowStart, int rowEnd, int colStart, int colEnd)
           
 void swapColumns(int colA, int colB)
           
 void toArray(double[] array)
           
static void toArray(ReadableDoubleMatrix mx, double[] array)
           
 double[] toDoubleArray()
           
 DoubleMatrix toDoubleMatrix(boolean enforceNewInstance)
           
 String toMultilineString()
           
static String toMultilineString(ReadableDoubleMatrix mx)
           
 DoubleMatrix toReadableMatrix(boolean enforceNewInstance)
           
 String toString()
           
static String toString(ReadableDoubleMatrix mx)
           
protected static String toString(ReadableDoubleMatrix mx, String prefix, String postfix, String rowPrefix, String rowPostfix, String rowSeparator, String colPrefix, String colPostfix, String colSeparator)
           
 DoubleMatrix toWritableMatrix(boolean enforceNewInstance)
           
abstract  AbstractDoubleMatrix transpose()
           
 void writeTo(OutputStream out)
           
static void writeTo(OutputStream out, ReadableDoubleMatrix mx)
           
protected static void writeTo(PrintWriter writer, ReadableDoubleMatrix mx, String prefix, String postfix, String rowPrefix, String rowPostfix, String rowSeparator, String colPrefix, String colPostfix, String colSeparator)
           
 void writeTo(Writer writer)
           
static void writeTo(Writer writer, ReadableDoubleMatrix mx)
           
 void writeToMultiline(OutputStream out)
           
static void writeToMultiline(OutputStream out, ReadableDoubleMatrix mx)
           
 void writeToMultiline(Writer writer)
           
static void writeToMultiline(Writer writer, ReadableDoubleMatrix mx)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.javasoft.smx.iface.DoubleMatrix
newInstance, newInstance
 
Methods inherited from interface ch.javasoft.smx.iface.ReadableDoubleMatrix
getDoubleValueAt
 
Methods inherited from interface ch.javasoft.smx.iface.WritableDoubleMatrix
setValueAt
 
Methods inherited from interface ch.javasoft.smx.iface.WritableMatrix
swapRows
 
Methods inherited from interface ch.javasoft.smx.iface.MatrixBase
getColumnCount, getRowCount
 

Constructor Detail

AbstractDoubleMatrix

public AbstractDoubleMatrix()
Method Detail

getNumberOperations

public DoubleOperations getNumberOperations()
Specified by:
getNumberOperations in interface MatrixBase<Double>

getMatrixOperations

public MatrixOperations<Double> getMatrixOperations()
Specified by:
getMatrixOperations in interface MatrixBase<Double>

setValueAt

public void setValueAt(int row,
                       int col,
                       long value)
Specified by:
setValueAt in interface WritableLongMatrix<Double>

setValueAt

public void setValueAt(int row,
                       int col,
                       Double value)
Specified by:
setValueAt in interface WritableMatrix<Double>

setValueAt

public void setValueAt(int row,
                       int col,
                       int value)
Specified by:
setValueAt in interface WritableIntMatrix<Double>

setValueAt

public void setValueAt(int row,
                       int col,
                       BigInteger value)
Specified by:
setValueAt in interface WritableBigIntegerMatrix<Double>

setValueAt

public void setValueAt(int row,
                       int col,
                       BigInteger dividend,
                       BigInteger divisor)
Specified by:
setValueAt in interface WritableBigIntegerRationalMatrix<Double>

setValueAt

public void setValueAt(int row,
                       int col,
                       BigFraction value)
Specified by:
setValueAt in interface WritableBigIntegerRationalMatrix<Double>

setValueAt

public void setValueAt(int row,
                       int col,
                       long dividend,
                       long divisor)
Specified by:
setValueAt in interface WritableLongRationalMatrix<Double>

setValueAt

public void setValueAt(int row,
                       int col,
                       int dividend,
                       int divisor)
Specified by:
setValueAt in interface WritableIntRationalMatrix<Double>

getNumberValueAt

public Double getNumberValueAt(int row,
                               int col)
Specified by:
getNumberValueAt in interface ReadableMatrix<Double>

getSignumAt

public int getSignumAt(int row,
                       int col)
Specified by:
getSignumAt in interface ReadableMatrix<Double>

toDoubleArray

public double[] toDoubleArray()
Specified by:
toDoubleArray in interface ReadableDoubleMatrix<Double>

toArray

public void toArray(double[] array)
Specified by:
toArray in interface ReadableDoubleMatrix<Double>

toArray

public static void toArray(ReadableDoubleMatrix mx,
                           double[] array)

toWritableMatrix

public DoubleMatrix toWritableMatrix(boolean enforceNewInstance)
Specified by:
toWritableMatrix in interface ReadableMatrix<Double>

toReadableMatrix

public DoubleMatrix toReadableMatrix(boolean enforceNewInstance)
Specified by:
toReadableMatrix in interface WritableMatrix<Double>

getDoubleColumn

public double[] getDoubleColumn(int col)
Specified by:
getDoubleColumn in interface ReadableDoubleMatrix<Double>

getDoubleColumn

public static double[] getDoubleColumn(ReadableDoubleMatrix mx,
                                       int col)

getNumberRows

public Double[][] getNumberRows()
Specified by:
getNumberRows in interface ReadableMatrix<Double>

getNumberRows

public static Double[][] getNumberRows(ReadableDoubleMatrix mx)

getDoubleRow

public double[] getDoubleRow(int row)
Specified by:
getDoubleRow in interface ReadableDoubleMatrix<Double>

getDoubleRow

public static double[] getDoubleRow(ReadableDoubleMatrix mx,
                                    int row)

getDoubleColumns

public double[][] getDoubleColumns()
Specified by:
getDoubleColumns in interface ReadableDoubleMatrix<Double>

getDoubleColumns

public static double[][] getDoubleColumns(ReadableDoubleMatrix mx)

getDoubleRows

public double[][] getDoubleRows()
Specified by:
getDoubleRows in interface ReadableDoubleMatrix<Double>

getDoubleRows

public static double[][] getDoubleRows(ReadableDoubleMatrix mx)

swapColumns

public void swapColumns(int colA,
                        int colB)
Specified by:
swapColumns in interface WritableMatrix<Double>

toString

public String toString()
Specified by:
toString in interface MatrixBase<Double>
Overrides:
toString in class Object

writeTo

public void writeTo(Writer writer)
Specified by:
writeTo in interface MatrixBase<Double>

writeTo

public void writeTo(OutputStream out)
Specified by:
writeTo in interface MatrixBase<Double>

toString

public static String toString(ReadableDoubleMatrix mx)

writeTo

public static void writeTo(Writer writer,
                           ReadableDoubleMatrix mx)

writeTo

public static void writeTo(OutputStream out,
                           ReadableDoubleMatrix mx)

toMultilineString

public String toMultilineString()
Specified by:
toMultilineString in interface MatrixBase<Double>

writeToMultiline

public void writeToMultiline(Writer writer)
Specified by:
writeToMultiline in interface MatrixBase<Double>

writeToMultiline

public void writeToMultiline(OutputStream out)
Specified by:
writeToMultiline in interface MatrixBase<Double>

toMultilineString

public static String toMultilineString(ReadableDoubleMatrix mx)

writeToMultiline

public static void writeToMultiline(Writer writer,
                                    ReadableDoubleMatrix mx)

writeToMultiline

public static void writeToMultiline(OutputStream out,
                                    ReadableDoubleMatrix mx)

toString

protected static String toString(ReadableDoubleMatrix mx,
                                 String prefix,
                                 String postfix,
                                 String rowPrefix,
                                 String rowPostfix,
                                 String rowSeparator,
                                 String colPrefix,
                                 String colPostfix,
                                 String colSeparator)

writeTo

protected static void writeTo(PrintWriter writer,
                              ReadableDoubleMatrix mx,
                              String prefix,
                              String postfix,
                              String rowPrefix,
                              String rowPostfix,
                              String rowSeparator,
                              String colPrefix,
                              String colPostfix,
                              String colSeparator)

clone

public abstract AbstractDoubleMatrix clone()
Specified by:
clone in interface DoubleMatrix
Specified by:
clone in interface MatrixBase<Double>
Specified by:
clone in interface ReadableMatrix<Double>
Specified by:
clone in interface WritableMatrix<Double>
Overrides:
clone in class Object

toDoubleMatrix

public DoubleMatrix toDoubleMatrix(boolean enforceNewInstance)
Specified by:
toDoubleMatrix in interface ReadableDoubleMatrix<Double>

addRowToOtherRow

public void addRowToOtherRow(int srcRow,
                             BigInteger srcFactor,
                             int dstRow,
                             BigInteger dstFactor)
Specified by:
addRowToOtherRow in interface WritableBigIntegerMatrix<Double>

addRowToOtherRow

public void addRowToOtherRow(int srcRow,
                             double srcFactor,
                             int dstRow,
                             double dstFactor)
Specified by:
addRowToOtherRow in interface WritableDoubleMatrix<Double>

addRowToOtherRow

public void addRowToOtherRow(int srcRow,
                             long srcFactor,
                             int dstRow,
                             long dstFactor)
Specified by:
addRowToOtherRow in interface WritableLongMatrix<Double>

addRowToOtherRow

public void addRowToOtherRow(int srcRow,
                             int srcFactor,
                             int dstRow,
                             int dstFactor)
Specified by:
addRowToOtherRow in interface WritableIntMatrix<Double>

addRowToOtherRow

public void addRowToOtherRow(int srcRow,
                             BigInteger srcDividend,
                             BigInteger srcDivisor,
                             int dstRow,
                             BigInteger dstDividend,
                             BigInteger dstDivisor)
Specified by:
addRowToOtherRow in interface WritableBigIntegerRationalMatrix<Double>

addRowToOtherRow

public void addRowToOtherRow(int srcRow,
                             long srcDividend,
                             long srcDivisor,
                             int dstRow,
                             long dstDividend,
                             long dstDivisor)
Specified by:
addRowToOtherRow in interface WritableLongRationalMatrix<Double>

addRowToOtherRow

public void addRowToOtherRow(int srcRow,
                             int srcDividend,
                             int srcDivisor,
                             int dstRow,
                             int dstDividend,
                             int dstDivisor)
Specified by:
addRowToOtherRow in interface WritableIntRationalMatrix<Double>

add

public void add(int row,
                int col,
                double value)
Specified by:
add in interface WritableDoubleMatrix<Double>

add

public void add(int row,
                int col,
                BigInteger value)
Specified by:
add in interface WritableBigIntegerMatrix<Double>

add

public void add(int row,
                int col,
                long value)
Specified by:
add in interface WritableLongMatrix<Double>

add

public void add(int row,
                int col,
                int value)
Specified by:
add in interface WritableIntMatrix<Double>

add

public void add(int row,
                int col,
                int dividend,
                int divisor)
Specified by:
add in interface WritableIntRationalMatrix<Double>

add

public void add(int row,
                int col,
                long dividend,
                long divisor)
Specified by:
add in interface WritableLongRationalMatrix<Double>

add

public void add(int row,
                int col,
                BigInteger dividend,
                BigInteger divisor)
Specified by:
add in interface WritableBigIntegerRationalMatrix<Double>

multiply

public void multiply(int row,
                     int col,
                     double factor)
Specified by:
multiply in interface WritableDoubleMatrix<Double>

multiply

public void multiply(int row,
                     int col,
                     BigInteger factor)
Specified by:
multiply in interface WritableBigIntegerMatrix<Double>

multiply

public void multiply(int row,
                     int col,
                     long factor)
Specified by:
multiply in interface WritableLongMatrix<Double>

multiply

public void multiply(int row,
                     int col,
                     int factor)
Specified by:
multiply in interface WritableIntMatrix<Double>

multiply

public void multiply(int row,
                     int col,
                     BigInteger dividend,
                     BigInteger divisor)
Specified by:
multiply in interface WritableBigIntegerRationalMatrix<Double>

multiply

public void multiply(int row,
                     int col,
                     long dividend,
                     long divisor)
Specified by:
multiply in interface WritableLongRationalMatrix<Double>

multiply

public void multiply(int row,
                     int col,
                     int dividend,
                     int divisor)
Specified by:
multiply in interface WritableIntRationalMatrix<Double>

multiplyRow

public void multiplyRow(int row,
                        BigInteger factor)
Specified by:
multiplyRow in interface WritableBigIntegerMatrix<Double>

multiplyRow

public void multiplyRow(int row,
                        long factor)
Specified by:
multiplyRow in interface WritableLongMatrix<Double>

multiplyRow

public void multiplyRow(int row,
                        int factor)
Specified by:
multiplyRow in interface WritableIntMatrix<Double>

multiplyRow

public void multiplyRow(int row,
                        BigInteger dividend,
                        BigInteger divisor)
Specified by:
multiplyRow in interface WritableBigIntegerRationalMatrix<Double>

multiplyRow

public void multiplyRow(int row,
                        long dividend,
                        long divisor)
Specified by:
multiplyRow in interface WritableLongRationalMatrix<Double>

multiplyRow

public void multiplyRow(int row,
                        int dividend,
                        int divisor)
Specified by:
multiplyRow in interface WritableIntRationalMatrix<Double>

multiplyRow

public void multiplyRow(int row,
                        double factor)
Specified by:
multiplyRow in interface WritableDoubleMatrix<Double>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

equals

public boolean equals(DoubleMatrix other,
                      double toleration)

equals

public static boolean equals(DoubleMatrix mxA,
                             DoubleMatrix mxB,
                             double toleration)

subDoubleMatrix

public DoubleMatrix subDoubleMatrix(int rowStart,
                                    int rowEnd,
                                    int colStart,
                                    int colEnd)
Specified by:
subDoubleMatrix in interface ReadableDoubleMatrix<Double>

negate

public void negate(int row,
                   int col)
Specified by:
negate in interface WritableMatrix<Double>

transpose

public abstract AbstractDoubleMatrix transpose()
Specified by:
transpose in interface DoubleMatrix
Specified by:
transpose in interface MatrixBase<Double>
Specified by:
transpose in interface ReadableMatrix<Double>
Specified by:
transpose in interface WritableMatrix<Double>