Package org.flag4j.core
Interface ComplexMatrixMixin<T>
- Type Parameters:
T
- Matrix type.
- All Known Implementing Classes:
CMatrix
,CooCMatrix
,CsrCMatrix
public interface ComplexMatrixMixin<T>
This interface specifies methods which any complex matrix should implement.
-
Method Summary
Modifier and TypeMethodDescriptionconj()
Computes the complex conjugate of a tensor.default T
conjT()
Computes the complex conjugate transpose of a tensor.H()
Computes the complex conjugate transpose (Hermitian transpose) of a tensor.boolean
Checks if a matrix is anti-Hermitian.boolean
Checks if this tensor contains at least one complex entry.boolean
Checks if a matrix is Hermitian.boolean
isReal()
Checks if this tensor has only real valued entries.boolean
Checks if this matrix is unitary.Sets a column of this matrix at the given index to the specified values.setCol
(CooCVector values, int colIndex) Sets a column of this matrix at the given index to the specified values.Sets a column of this matrix at the given index to the specified values.Sets a row of this matrix at the given index to the specified values.setRow
(CooCVector values, int rowIndex) Sets a row of this matrix at the given index to the specified values.Sets a row of this matrix at the given index to the specified values.setSlice
(CooCMatrix values, int rowStart, int colStart) Sets a slice of this matrix to the specified values.
-
Method Details
-
conjT
-
H
-
isHermitian
boolean isHermitian()Checks if a matrix is Hermitian. That is, if the matrix is equal to its conjugate transpose.- Returns:
- True if this matrix is Hermitian. Otherwise, returns false.
-
isAntiHermitian
boolean isAntiHermitian()Checks if a matrix is anti-Hermitian. That is, if the matrix is equal to the negative of its conjugate transpose.- Returns:
- True if this matrix is anti-symmetric. Otherwise, returns false.
-
isUnitary
boolean isUnitary()Checks if this matrix is unitary. That is, if the inverse of this matrix is equal to its conjugate transpose.- Returns:
- True if this matrix it is unitary. Otherwise, returns false.
-
isReal
boolean isReal()Checks if this tensor has only real valued entries.- Returns:
- True if this tensor contains NO complex entries. Otherwise, returns false.
-
isComplex
boolean isComplex()Checks if this tensor contains at least one complex entry.- Returns:
- True if this tensor contains at least one complex entry. Otherwise, returns false.
-
conj
-
setCol
Sets a column of this matrix at the given index to the specified values.- Parameters:
values
- New values for the column.colIndex
- The index of the column which is to be set.- Returns:
- A reference to this matrix.
- Throws:
IllegalArgumentException
- If the values array has a different length than the number of rows of this matrix.IndexOutOfBoundsException
- IfcolIndex
is not within the matrix.
-
setRow
Sets a row of this matrix at the given index to the specified values.- Parameters:
values
- New values for the row.rowIndex
- The index of the column which is to be set.- Returns:
- A reference to this matrix.
- Throws:
IllegalArgumentException
- If the values array has a different length than the number of columns of this matrix.IndexOutOfBoundsException
- IfrowIndex
is not within the matrix.
-
setCol
Sets a column of this matrix at the given index to the specified values.- Parameters:
values
- New values for the column.colIndex
- The index of the column which is to be set.- Returns:
- A reference to this matrix.
- Throws:
IllegalArgumentException
- If the values vector has a different length than the number of rows of this matrix.IndexOutOfBoundsException
- IfcolIndex
is not within the matrix.
-
setCol
Sets a column of this matrix at the given index to the specified values.- Parameters:
values
- New values for the column.colIndex
- The index of the columns which is to be set.- Returns:
- A reference to this matrix.
- Throws:
IllegalArgumentException
- If the values vector has a different length than the number of rows of this matrix.IndexOutOfBoundsException
- IfcolIndex
is not within the matrix.
-
setRow
Sets a row of this matrix at the given index to the specified values.- Parameters:
values
- New values for the row.rowIndex
- The index of the row which is to be set.- Returns:
- A reference to this matrix.
- Throws:
IllegalArgumentException
- If thevalues
vector has a different length than the number of columns of this matrix.IndexOutOfBoundsException
- IfrowIndex
is not within the matrix.
-
setRow
Sets a row of this matrix at the given index to the specified values.- Parameters:
values
- New values for the row.rowIndex
- The index of the row which is to be set.- Returns:
- A reference to this matrix.
- Throws:
IllegalArgumentException
- If thevalues
vector has a different length than the number of columns of this matrix.IndexOutOfBoundsException
- IfrowIndex
is not within the matrix.
-
setSlice
Sets a slice of this matrix to the specified values. The rowStart and colStart parameters specify the upper left index location of the slice to set.- Parameters:
values
- New values for the specified slice.rowStart
- Starting row index for the slice (inclusive).colStart
- Starting column index for the slice (inclusive).- Returns:
- A reference to this matrix.
- Throws:
IndexOutOfBoundsException
- IfrowStart
orcolStart
are not within the matrix.IllegalArgumentException
- If the values slice, with upper left corner at the specified location, does not fit completely within this matrix.
-