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