public class ComplexDoubleMatrix extends Object
Modifier and Type | Field and Description |
---|---|
int |
columns |
double[] |
data |
int |
length |
int |
rows |
Constructor and Description |
---|
ComplexDoubleMatrix()
Creates a new ComplexDoubleMatrix of size 0 times 0.
|
ComplexDoubleMatrix(ComplexDouble[] newData) |
ComplexDoubleMatrix(double[] newData) |
ComplexDoubleMatrix(double[][] data)
Creates a new n times m ComplexDoubleMatrix from
the given n times m 2D data array.
|
ComplexDoubleMatrix(DoubleMatrix m)
Construct a complex matrix from a real matrix.
|
ComplexDoubleMatrix(DoubleMatrix real,
DoubleMatrix imag)
Construct a complex matrix from separate real and imaginary parts.
|
ComplexDoubleMatrix(int len)
Create a Matrix of length len.
|
ComplexDoubleMatrix(int newRows,
int newColumns)
Creates a new n times m ComplexDoubleMatrix.
|
ComplexDoubleMatrix(int newRows,
int newColumns,
double... newData)
Create a new matrix with newRows rows, newColumns columns
using newData> as the data.
|
ComplexDoubleMatrix(String filename)
Creates a new matrix by reading it from a file.
|
public int rows
public int columns
public int length
public double[] data
public ComplexDoubleMatrix(int newRows, int newColumns, double... newData)
public ComplexDoubleMatrix(int newRows, int newColumns)
newRows
- the number of rows (n) of the new matrix.newColumns
- the number of columns (m) of the new matrix.public ComplexDoubleMatrix()
public ComplexDoubleMatrix(int len)
len
- public ComplexDoubleMatrix(double[] newData)
public ComplexDoubleMatrix(ComplexDouble[] newData)
public ComplexDoubleMatrix(DoubleMatrix m)
public ComplexDoubleMatrix(DoubleMatrix real, DoubleMatrix imag)
public ComplexDoubleMatrix(String filename) throws IOException
filename
- the path and name of the file to read the matrix fromIOException
public ComplexDoubleMatrix(double[][] data)
new ComplexDoubleMatrix(new double[][]{{1d, 2d, 3d}, {4d, 5d, 6d}, {7d, 8d, 9d}}).print();
1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0.
data
- n times m data arraypublic static ComplexDoubleMatrix zeros(int rows, int columns)
rows
- number of rowscolumns
- number of columnspublic static ComplexDoubleMatrix zeros(int length)
public static ComplexDoubleMatrix ones(int rows, int columns)
rows
- number of rowscolumns
- number of columnspublic static ComplexDoubleMatrix ones(int length)
public static ComplexDoubleMatrix diag(ComplexDoubleMatrix x)
x
- the diagonal valuespublic static ComplexDoubleMatrix diag(ComplexDoubleMatrix x, int rows, int columns)
x
- vector to fill the diagonal withrows
- number of rows of the resulting matrixcolumns
- number of columns of the resulting matrixpublic static ComplexDoubleMatrix scalar(double s)
s
- value of the matrixpublic boolean isScalar()
public ComplexDouble scalar()
public static ComplexDoubleMatrix concatHorizontally(ComplexDoubleMatrix A, ComplexDoubleMatrix B)
public static ComplexDoubleMatrix concatVertically(ComplexDoubleMatrix A, ComplexDoubleMatrix B)
public ComplexDoubleMatrix get(int[] indices)
public ComplexDoubleMatrix get(int r, int[] indices)
public ComplexDoubleMatrix get(int[] indices, int c)
public ComplexDoubleMatrix get(int[] rindices, int[] cindices)
public ComplexDoubleMatrix get(ComplexDoubleMatrix indices)
public ComplexDoubleMatrix get(int r, ComplexDoubleMatrix indices)
public ComplexDoubleMatrix get(ComplexDoubleMatrix indices, int c)
public ComplexDoubleMatrix get(ComplexDoubleMatrix rindices, ComplexDoubleMatrix cindices)
public ComplexDoubleMatrix put(int[] indices, ComplexDoubleMatrix x)
public ComplexDoubleMatrix put(int r, int[] indices, ComplexDoubleMatrix x)
public ComplexDoubleMatrix put(int[] indices, int c, ComplexDoubleMatrix x)
public ComplexDoubleMatrix put(int[] rindices, int[] cindices, ComplexDoubleMatrix x)
public ComplexDoubleMatrix put(int[] indices, double v)
public ComplexDoubleMatrix putReal(int[] indices, double v)
public ComplexDoubleMatrix putImag(int[] indices, double v)
public ComplexDoubleMatrix put(int[] indices, ComplexDouble v)
public ComplexDoubleMatrix put(int r, int[] indices, double v)
public ComplexDoubleMatrix putReal(int r, int[] indices, double v)
public ComplexDoubleMatrix putImag(int r, int[] indices, double v)
public ComplexDoubleMatrix put(int r, int[] indices, ComplexDouble v)
public ComplexDoubleMatrix put(int[] indices, int c, double v)
public ComplexDoubleMatrix putReal(int[] indices, int c, double v)
public ComplexDoubleMatrix putImag(int[] indices, int c, double v)
public ComplexDoubleMatrix put(int[] indices, int c, ComplexDouble v)
public ComplexDoubleMatrix put(int[] rindices, int[] cindices, double v)
public ComplexDoubleMatrix putReal(int[] rindices, int[] cindices, double v)
public ComplexDoubleMatrix putImag(int[] rindices, int[] cindices, double v)
public ComplexDoubleMatrix put(int[] rindices, int[] cindices, ComplexDouble v)
public ComplexDoubleMatrix put(ComplexDoubleMatrix indices, ComplexDoubleMatrix v)
public ComplexDoubleMatrix put(int r, ComplexDoubleMatrix indices, ComplexDoubleMatrix v)
public ComplexDoubleMatrix put(ComplexDoubleMatrix indices, int c, ComplexDoubleMatrix v)
public ComplexDoubleMatrix put(ComplexDoubleMatrix rindices, ComplexDoubleMatrix cindices, ComplexDoubleMatrix v)
public ComplexDoubleMatrix put(ComplexDoubleMatrix indices, double v)
public ComplexDoubleMatrix putReal(ComplexDoubleMatrix indices, double v)
public ComplexDoubleMatrix putImag(ComplexDoubleMatrix indices, double v)
public ComplexDoubleMatrix put(ComplexDoubleMatrix indices, ComplexDouble v)
public ComplexDoubleMatrix put(int r, ComplexDoubleMatrix indices, double v)
public ComplexDoubleMatrix putReal(int r, ComplexDoubleMatrix indices, double v)
public ComplexDoubleMatrix putImag(int r, ComplexDoubleMatrix indices, double v)
public ComplexDoubleMatrix put(int r, ComplexDoubleMatrix indices, ComplexDouble v)
public ComplexDoubleMatrix put(ComplexDoubleMatrix indices, int c, double v)
public ComplexDoubleMatrix putReal(ComplexDoubleMatrix indices, int c, double v)
public ComplexDoubleMatrix putImag(ComplexDoubleMatrix indices, int c, double v)
public ComplexDoubleMatrix put(ComplexDoubleMatrix indices, int c, ComplexDouble v)
public ComplexDoubleMatrix put(ComplexDoubleMatrix rindices, ComplexDoubleMatrix cindices, double v)
public ComplexDoubleMatrix putReal(ComplexDoubleMatrix rindices, ComplexDoubleMatrix cindices, double v)
public ComplexDoubleMatrix putImag(ComplexDoubleMatrix rindices, ComplexDoubleMatrix cindices, double v)
public ComplexDoubleMatrix put(ComplexDoubleMatrix rindices, ComplexDoubleMatrix cindices, ComplexDouble v)
public int[] findIndices()
public ComplexDoubleMatrix transpose()
public ComplexDoubleMatrix hermitian()
public ComplexDoubleMatrix conji()
public ComplexDoubleMatrix conj()
public boolean equals(Object o)
public void resize(int newRows, int newColumns)
public ComplexDoubleMatrix reshape(int newRows, int newColumns)
public boolean sameSize(ComplexDoubleMatrix a)
public void assertSameSize(ComplexDoubleMatrix a)
a
- the other matrixSizeException
- if matrix sizes don't match.public boolean multipliesWith(ComplexDoubleMatrix a)
a
- right-hand-side of the multiplication.public void assertMultipliesWith(ComplexDoubleMatrix a)
public boolean sameLength(ComplexDoubleMatrix a)
public void assertSameLength(ComplexDoubleMatrix a)
public ComplexDoubleMatrix copy(ComplexDoubleMatrix a)
public ComplexDoubleMatrix dup()
public ComplexDoubleMatrix swapColumns(int i, int j)
public ComplexDoubleMatrix swapRows(int i, int j)
public ComplexDoubleMatrix put(int rowIndex, int columnIndex, double value)
public ComplexDoubleMatrix put(int rowIndex, int columnIndex, double realValue, double complexValue)
public ComplexDoubleMatrix put(int rowIndex, int columnIndex, ComplexDouble value)
public ComplexDoubleMatrix putReal(int rowIndex, int columnIndex, double value)
public ComplexDoubleMatrix putImag(int rowIndex, int columnIndex, double value)
public ComplexDouble get(int rowIndex, int columnIndex)
public ComplexDouble get(int rowIndex, int columnIndex, ComplexDouble result)
public DoubleMatrix getReal()
public int index(int rowIndex, int columnIndex)
public int indexRows(int i)
public int indexColumns(int i)
public ComplexDouble get(int i)
public ComplexDouble get(int i, ComplexDouble result)
public double getReal(int i)
public double getImag(int i)
public ComplexDoubleMatrix put(int i, double v)
public ComplexDoubleMatrix put(int i, double r, double c)
public ComplexDoubleMatrix put(int i, ComplexDouble v)
public ComplexDoubleMatrix putReal(int i, double v)
public ComplexDoubleMatrix putImag(int i, double v)
public int getRows()
public int getColumns()
public int getLength()
public boolean isEmpty()
public boolean isSquare()
public void assertSquare()
public boolean isVector()
public boolean isRowVector()
public boolean isColumnVector()
public ComplexDoubleMatrix diag()
public DoubleMatrix real()
public DoubleMatrix imag()
public void print()
public String toString()
public double[] toDoubleArray()
public ComplexDouble[] toArray()
public ComplexDouble[][] toArray2()
public boolean[] toBooleanArray()
public boolean[][] toBooleanArray2()
public ComplexDoubleMatrix addi(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix addi(ComplexDouble v, ComplexDoubleMatrix result)
public ComplexDoubleMatrix addi(double v, ComplexDoubleMatrix result)
public ComplexDoubleMatrix subi(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix subi(ComplexDouble v, ComplexDoubleMatrix result)
public ComplexDoubleMatrix subi(double v, ComplexDoubleMatrix result)
public ComplexDoubleMatrix rsubi(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix rsubi(ComplexDouble a, ComplexDoubleMatrix result)
public ComplexDoubleMatrix rsubi(double a, ComplexDoubleMatrix result)
public ComplexDoubleMatrix muli(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix muli(ComplexDouble v, ComplexDoubleMatrix result)
public ComplexDoubleMatrix muli(double v, ComplexDoubleMatrix result)
public ComplexDoubleMatrix mmuli(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix mmuli(ComplexDouble v, ComplexDoubleMatrix result)
public ComplexDoubleMatrix mmuli(double v, ComplexDoubleMatrix result)
public ComplexDoubleMatrix divi(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix divi(ComplexDouble a, ComplexDoubleMatrix result)
public ComplexDoubleMatrix divi(double a, ComplexDoubleMatrix result)
public ComplexDoubleMatrix rdivi(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix rdivi(ComplexDouble a, ComplexDoubleMatrix result)
public ComplexDoubleMatrix rdivi(double a, ComplexDoubleMatrix result)
public ComplexDoubleMatrix negi()
public ComplexDoubleMatrix neg()
public ComplexDoubleMatrix noti()
public ComplexDoubleMatrix not()
public ComplexDoubleMatrix truthi()
public ComplexDoubleMatrix truth()
public ComplexDoubleMatrix rankOneUpdate(ComplexDouble alpha, ComplexDoubleMatrix x, ComplexDoubleMatrix y)
public ComplexDoubleMatrix rankOneUpdate(double alpha, ComplexDoubleMatrix x, ComplexDoubleMatrix y)
public ComplexDoubleMatrix rankOneUpdate(double alpha, ComplexDoubleMatrix x)
public ComplexDoubleMatrix rankOneUpdate(ComplexDouble alpha, ComplexDoubleMatrix x)
public ComplexDoubleMatrix rankOneUpdate(ComplexDoubleMatrix x)
public ComplexDoubleMatrix rankOneUpdate(ComplexDoubleMatrix x, ComplexDoubleMatrix y)
public ComplexDouble sum()
public ComplexDouble mean()
public ComplexDouble dotc(ComplexDoubleMatrix other)
public ComplexDouble dotu(ComplexDoubleMatrix other)
public double norm2()
public double normmax()
public double norm1()
public ComplexDoubleMatrix columnSums()
public ComplexDoubleMatrix columnMeans()
public ComplexDoubleMatrix rowSums()
public ComplexDoubleMatrix rowMeans()
public ComplexDoubleMatrix getColumn(int c)
public void putColumn(int c, ComplexDoubleMatrix v)
public ComplexDoubleMatrix getRow(int r)
public void putRow(int r, ComplexDoubleMatrix v)
public void addRowVector(ComplexDoubleMatrix x)
public void addColumnVector(ComplexDoubleMatrix x)
public void subRowVector(ComplexDoubleMatrix x)
public void subColumnVector(ComplexDoubleMatrix x)
public void out(DataOutputStream dos) throws IOException
dos
- the data output stream to write to.IOException
public void in(DataInputStream dis) throws IOException
dis
- the data input stream to read from.IOException
public void save(String filename) throws IOException
filename
- the file to write the matrix in.IOException
- thrown on errors while writing the matrix to the filepublic void load(String filename) throws IOException
filename
- the file to read the matrix fromIOException
- thrown on errors while reading the matrixpublic ComplexDoubleMatrix addi(ComplexDoubleMatrix other)
public ComplexDoubleMatrix add(ComplexDoubleMatrix other)
public ComplexDoubleMatrix addi(ComplexDouble v)
public ComplexDoubleMatrix addi(double v)
public ComplexDoubleMatrix add(ComplexDouble v)
public ComplexDoubleMatrix add(double v)
public ComplexDoubleMatrix subi(ComplexDoubleMatrix other)
public ComplexDoubleMatrix sub(ComplexDoubleMatrix other)
public ComplexDoubleMatrix subi(ComplexDouble v)
public ComplexDoubleMatrix subi(double v)
public ComplexDoubleMatrix sub(ComplexDouble v)
public ComplexDoubleMatrix sub(double v)
public ComplexDoubleMatrix rsubi(ComplexDoubleMatrix other)
public ComplexDoubleMatrix rsub(ComplexDoubleMatrix other)
public ComplexDoubleMatrix rsubi(ComplexDouble v)
public ComplexDoubleMatrix rsubi(double v)
public ComplexDoubleMatrix rsub(ComplexDouble v)
public ComplexDoubleMatrix rsub(double v)
public ComplexDoubleMatrix divi(ComplexDoubleMatrix other)
public ComplexDoubleMatrix div(ComplexDoubleMatrix other)
public ComplexDoubleMatrix divi(ComplexDouble v)
public ComplexDoubleMatrix divi(double v)
public ComplexDoubleMatrix div(ComplexDouble v)
public ComplexDoubleMatrix div(double v)
public ComplexDoubleMatrix rdivi(ComplexDoubleMatrix other)
public ComplexDoubleMatrix rdiv(ComplexDoubleMatrix other)
public ComplexDoubleMatrix rdivi(ComplexDouble v)
public ComplexDoubleMatrix rdivi(double v)
public ComplexDoubleMatrix rdiv(ComplexDouble v)
public ComplexDoubleMatrix rdiv(double v)
public ComplexDoubleMatrix muli(ComplexDoubleMatrix other)
public ComplexDoubleMatrix mul(ComplexDoubleMatrix other)
public ComplexDoubleMatrix muli(ComplexDouble v)
public ComplexDoubleMatrix muli(double v)
public ComplexDoubleMatrix mul(ComplexDouble v)
public ComplexDoubleMatrix mul(double v)
public ComplexDoubleMatrix mmuli(ComplexDoubleMatrix other)
public ComplexDoubleMatrix mmul(ComplexDoubleMatrix other)
public ComplexDoubleMatrix mmuli(ComplexDouble v)
public ComplexDoubleMatrix mmuli(double v)
public ComplexDoubleMatrix mmul(ComplexDouble v)
public ComplexDoubleMatrix mmul(double v)
public ComplexDoubleMatrix eqi(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix eqi(ComplexDoubleMatrix other)
public ComplexDoubleMatrix eq(ComplexDoubleMatrix other)
public ComplexDoubleMatrix eqi(ComplexDouble value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix eqi(double value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix eqi(ComplexDouble value)
public ComplexDoubleMatrix eqi(double value)
public ComplexDoubleMatrix eq(ComplexDouble value)
public ComplexDoubleMatrix eq(double value)
public ComplexDoubleMatrix nei(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix nei(ComplexDoubleMatrix other)
public ComplexDoubleMatrix ne(ComplexDoubleMatrix other)
public ComplexDoubleMatrix nei(ComplexDouble value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix nei(double value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix nei(ComplexDouble value)
public ComplexDoubleMatrix nei(double value)
public ComplexDoubleMatrix ne(ComplexDouble value)
public ComplexDoubleMatrix ne(double value)
public ComplexDoubleMatrix andi(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix andi(ComplexDoubleMatrix other)
public ComplexDoubleMatrix and(ComplexDoubleMatrix other)
public ComplexDoubleMatrix andi(ComplexDouble value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix andi(double value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix andi(ComplexDouble value)
public ComplexDoubleMatrix andi(double value)
public ComplexDoubleMatrix and(ComplexDouble value)
public ComplexDoubleMatrix and(double value)
public ComplexDoubleMatrix ori(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix ori(ComplexDoubleMatrix other)
public ComplexDoubleMatrix or(ComplexDoubleMatrix other)
public ComplexDoubleMatrix ori(ComplexDouble value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix ori(double value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix ori(ComplexDouble value)
public ComplexDoubleMatrix ori(double value)
public ComplexDoubleMatrix or(ComplexDouble value)
public ComplexDoubleMatrix or(double value)
public ComplexDoubleMatrix xori(ComplexDoubleMatrix other, ComplexDoubleMatrix result)
public ComplexDoubleMatrix xori(ComplexDoubleMatrix other)
public ComplexDoubleMatrix xor(ComplexDoubleMatrix other)
public ComplexDoubleMatrix xori(ComplexDouble value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix xori(double value, ComplexDoubleMatrix result)
public ComplexDoubleMatrix xori(ComplexDouble value)
public ComplexDoubleMatrix xori(double value)
public ComplexDoubleMatrix xor(ComplexDouble value)
public ComplexDoubleMatrix xor(double value)
Copyright © 2015. All rights reserved.