ch.javasoft.smx.impl
Class DefaultDoubleVector

java.lang.Object
  extended by ch.javasoft.smx.impl.AbstractDoubleMatrix
      extended by ch.javasoft.smx.impl.DefaultDoubleVector
All Implemented Interfaces:
DoubleMatrix, DoubleVector, MatrixBase<Double>, ReadableDoubleMatrix<Double>, ReadableMatrix<Double>, ReadableVector<Double>, VectorBase<Double>, WritableBigIntegerMatrix<Double>, WritableBigIntegerRationalMatrix<Double>, WritableDoubleMatrix<Double>, WritableIntMatrix<Double>, WritableIntRationalMatrix<Double>, WritableLongMatrix<Double>, WritableLongRationalMatrix<Double>, WritableMatrix<Double>, WritableVector<Double>, Cloneable

public class DefaultDoubleVector
extends AbstractDoubleMatrix
implements DoubleVector


Constructor Summary
DefaultDoubleVector(double[] values, boolean columnVector)
          Constructor without cloning the values
DefaultDoubleVector(Double[] values, boolean columnVector)
          Constructor, values are cloned
DefaultDoubleVector(int size, boolean columnVector)
           
 
Method Summary
 DefaultDoubleVector clone()
           
 int getColumnCount()
           
 double getDoubleValueAt(int index)
           
 double getDoubleValueAt(int row, int col)
           
protected  int getIndexForMatrixAccess(int row, int col)
           
 Double getNumberValueAt(int index)
           
 int getRowCount()
           
 int getSize()
           
 boolean isColumnVector()
           
 boolean isRowVector()
           
 DoubleMatrix newInstance(Double[][] data, boolean rowsInDim1)
           
 DoubleMatrix newInstance(int rows, int cols)
           
 void setValueAt(int index, double value)
           
 void setValueAt(int index, Double value)
           
 void setValueAt(int row, int col, double value)
           
 void swapColumns(int colA, int colB)
           
 void swapRows(int rowA, int rowB)
           
 void swapValues(int indexA, int indexB)
           
 DefaultDoubleVector toReadableMatrix(boolean enforceNewInstance)
           
 DefaultDoubleVector toReadableVector(boolean enforceNewInstance)
           
 DefaultDoubleVector toWritableMatrix(boolean enforceNewInstance)
           
 DefaultDoubleVector toWritableVector(boolean enforceNewInstance)
           
 DefaultDoubleVector transpose()
           
 
Methods inherited from class ch.javasoft.smx.impl.AbstractDoubleMatrix
add, add, add, add, add, add, add, addRowToOtherRow, addRowToOtherRow, addRowToOtherRow, addRowToOtherRow, addRowToOtherRow, addRowToOtherRow, addRowToOtherRow, equals, equals, equals, getDoubleColumn, getDoubleColumn, getDoubleColumns, getDoubleColumns, getDoubleRow, getDoubleRow, getDoubleRows, getDoubleRows, getMatrixOperations, getNumberOperations, getNumberRows, getNumberRows, getNumberValueAt, getSignumAt, hashCode, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiplyRow, multiplyRow, multiplyRow, multiplyRow, multiplyRow, multiplyRow, multiplyRow, negate, setValueAt, setValueAt, setValueAt, setValueAt, setValueAt, setValueAt, setValueAt, setValueAt, subDoubleMatrix, toArray, toArray, toDoubleArray, toDoubleMatrix, toMultilineString, toMultilineString, toString, toString, toString, writeTo, writeTo, writeTo, writeTo, writeTo, writeToMultiline, writeToMultiline, writeToMultiline, writeToMultiline
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.javasoft.smx.iface.ReadableDoubleMatrix
getDoubleColumn, getDoubleColumns, getDoubleRow, getDoubleRows, subDoubleMatrix, toArray, toDoubleArray, toDoubleMatrix
 
Methods inherited from interface ch.javasoft.smx.iface.ReadableMatrix
getNumberRows, getNumberValueAt, getSignumAt
 
Methods inherited from interface ch.javasoft.smx.iface.WritableDoubleMatrix
add, addRowToOtherRow, multiply, multiplyRow
 
Methods inherited from interface ch.javasoft.smx.iface.WritableBigIntegerRationalMatrix
add, addRowToOtherRow, multiply, multiplyRow, setValueAt, setValueAt
 
Methods inherited from interface ch.javasoft.smx.iface.WritableLongRationalMatrix
add, addRowToOtherRow, multiply, multiplyRow, setValueAt
 
Methods inherited from interface ch.javasoft.smx.iface.WritableIntRationalMatrix
add, addRowToOtherRow, multiply, multiplyRow, setValueAt
 
Methods inherited from interface ch.javasoft.smx.iface.WritableBigIntegerMatrix
add, addRowToOtherRow, multiply, multiplyRow, setValueAt
 
Methods inherited from interface ch.javasoft.smx.iface.WritableLongMatrix
add, addRowToOtherRow, multiply, multiplyRow, setValueAt
 
Methods inherited from interface ch.javasoft.smx.iface.WritableIntMatrix
add, addRowToOtherRow, multiply, multiplyRow, setValueAt
 
Methods inherited from interface ch.javasoft.smx.iface.WritableMatrix
negate, setValueAt
 
Methods inherited from interface ch.javasoft.smx.iface.MatrixBase
getMatrixOperations, getNumberOperations, toMultilineString, toString, writeTo, writeTo, writeToMultiline, writeToMultiline
 
Methods inherited from interface ch.javasoft.smx.iface.VectorBase
toString, writeTo, writeTo
 

Constructor Detail

DefaultDoubleVector

public DefaultDoubleVector(int size,
                           boolean columnVector)

DefaultDoubleVector

public DefaultDoubleVector(double[] values,
                           boolean columnVector)
Constructor without cloning the values


DefaultDoubleVector

public DefaultDoubleVector(Double[] values,
                           boolean columnVector)
Constructor, values are cloned

Method Detail

isColumnVector

public boolean isColumnVector()
Specified by:
isColumnVector in interface VectorBase<Double>

isRowVector

public boolean isRowVector()
Specified by:
isRowVector in interface VectorBase<Double>

clone

public DefaultDoubleVector 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 VectorBase<Double>
Specified by:
clone in interface WritableMatrix<Double>
Specified by:
clone in class AbstractDoubleMatrix

toReadableVector

public DefaultDoubleVector toReadableVector(boolean enforceNewInstance)
Specified by:
toReadableVector in interface WritableVector<Double>

toWritableVector

public DefaultDoubleVector toWritableVector(boolean enforceNewInstance)
Specified by:
toWritableVector in interface ReadableVector<Double>

toReadableMatrix

public DefaultDoubleVector toReadableMatrix(boolean enforceNewInstance)
Specified by:
toReadableMatrix in interface WritableMatrix<Double>
Overrides:
toReadableMatrix in class AbstractDoubleMatrix

toWritableMatrix

public DefaultDoubleVector toWritableMatrix(boolean enforceNewInstance)
Specified by:
toWritableMatrix in interface ReadableMatrix<Double>
Overrides:
toWritableMatrix in class AbstractDoubleMatrix

newInstance

public DoubleMatrix newInstance(int rows,
                                int cols)
Specified by:
newInstance in interface DoubleMatrix
Specified by:
newInstance in interface DoubleVector
Specified by:
newInstance in interface MatrixBase<Double>
Specified by:
newInstance in interface ReadableMatrix<Double>
Specified by:
newInstance in interface WritableMatrix<Double>

newInstance

public DoubleMatrix newInstance(Double[][] data,
                                boolean rowsInDim1)
Specified by:
newInstance in interface DoubleMatrix
Specified by:
newInstance in interface DoubleVector
Specified by:
newInstance in interface MatrixBase<Double>
Specified by:
newInstance in interface ReadableMatrix<Double>
Specified by:
newInstance in interface WritableMatrix<Double>

transpose

public DefaultDoubleVector transpose()
Specified by:
transpose in interface DoubleMatrix
Specified by:
transpose in interface DoubleVector
Specified by:
transpose in interface MatrixBase<Double>
Specified by:
transpose in interface ReadableMatrix<Double>
Specified by:
transpose in interface ReadableVector<Double>
Specified by:
transpose in interface WritableMatrix<Double>
Specified by:
transpose in interface WritableVector<Double>
Specified by:
transpose in class AbstractDoubleMatrix

getDoubleValueAt

public double getDoubleValueAt(int index)
Specified by:
getDoubleValueAt in interface DoubleVector

getSize

public int getSize()
Specified by:
getSize in interface VectorBase<Double>

getIndexForMatrixAccess

protected int getIndexForMatrixAccess(int row,
                                      int col)

getDoubleValueAt

public double getDoubleValueAt(int row,
                               int col)
Specified by:
getDoubleValueAt in interface ReadableDoubleMatrix<Double>

getNumberValueAt

public Double getNumberValueAt(int index)
Specified by:
getNumberValueAt in interface ReadableVector<Double>

setValueAt

public void setValueAt(int index,
                       Double value)
Specified by:
setValueAt in interface WritableVector<Double>

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface MatrixBase<Double>

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface MatrixBase<Double>

setValueAt

public void setValueAt(int index,
                       double value)
Specified by:
setValueAt in interface DoubleVector

setValueAt

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

swapValues

public void swapValues(int indexA,
                       int indexB)
Specified by:
swapValues in interface WritableVector<Double>

swapRows

public void swapRows(int rowA,
                     int rowB)
Specified by:
swapRows in interface WritableMatrix<Double>

swapColumns

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