public interface ArrayKernel extends Service
Array
s.Modifier and Type | Field and Description |
---|---|
static int |
C_TO_R_ABS
Complex to real conversion by complex magnitudes.
|
static int |
C_TO_R_IM
Complex to real conversion by imaginary part.
|
static int |
C_TO_R_RE
Complex to real conversion by real part.
|
static int |
CA_PROD
Complex accumulator product.
|
static int |
CA_SUM
Complex accumulator sum.
|
static int |
CE_ADD
Complex elementwise addition.
|
static int |
CE_DIV
Complex elementwise division.
|
static int |
CE_MUL
Complex elementwise multiplication.
|
static int |
CE_SUB
Complex elementwise subtraction.
|
static int |
CU_ADD
Complex unary addition.
|
static int |
CU_CONJ
Complex unary conjugation.
|
static int |
CU_COS
Complex unary cosine.
|
static int |
CU_EXP
Complex unary exponentiation.
|
static int |
CU_FILL
Complex unary fill.
|
static int |
CU_MUL
Complex unary multiplication.
|
static int |
CU_RND
Complex unary randomization.
|
static int |
CU_SHUFFLE
Complex unary shuffle.
|
static int |
CU_SIN
Complex unary sine.
|
static int |
I_TO_R
Integer to real conversion by up-casting.
|
static int |
IE_ADD
Integer elementwise addition.
|
static int |
IE_MAX
Integer elementwise maximum.
|
static int |
IE_MIN
Integer elementwise minimum.
|
static int |
IE_MUL
Integer elementwise multiplication.
|
static int |
IE_SUB
Integer elementwise subtraction.
|
static int |
IU_ADD
Integer unary addition.
|
static int |
IU_FILL
Integer unary fill.
|
static int |
IU_MUL
Integer unary multiplication.
|
static int |
IU_SHUFFLE
Integer unary shuffle.
|
static int |
R_TO_C_IM
Real to complex conversion by imaginary part.
|
static int |
R_TO_C_RE
Real to complex conversion by real part.
|
static int |
RA_ENT
Real accumulator entropy.
|
static int |
RA_MAX
Real accumulator maximum.
|
static int |
RA_MIN
Real accumulator minimum.
|
static int |
RA_PROD
Real accumulator product.
|
static int |
RA_SUM
Real accumulator sum.
|
static int |
RA_VAR
Real accumulator variance.
|
static int |
RD_PROD
Real dimension product.
|
static int |
RD_SUM
Real dimension sum.
|
static int |
RE_ADD
Real elementwise addition.
|
static int |
RE_DIV
Real elementwise division.
|
static int |
RE_MAX
Real elementwise maximum.
|
static int |
RE_MIN
Real elementwise minimum.
|
static int |
RE_MUL
Real elementwise multiplication.
|
static int |
RE_SUB
Real elementwise subtraction.
|
static int |
RI_GZERO
Real index find greater-than-zeros.
|
static int |
RI_LZERO
Real index find less-than-zeros.
|
static int |
RI_MAX
Real index maximum.
|
static int |
RI_MIN
Real index minimum.
|
static int |
RI_SORT
Real index sort.
|
static int |
RI_ZERO
Real index find zeros.
|
static int |
RR_MAX
Real reduce maximum.
|
static int |
RR_MIN
Real reduce minimum.
|
static int |
RR_PROD
Real reduce product.
|
static int |
RR_SUM
Real reduce sum.
|
static int |
RR_VAR
Real reduce variance.
|
static int |
RU_ABS
Real unary absolute value.
|
static int |
RU_ADD
Real unary addition.
|
static int |
RU_ATAN
Real unary arctangent.
|
static int |
RU_COS
Real unary cosine.
|
static int |
RU_EXP
Real unary exponentiation.
|
static int |
RU_FILL
Real unary fill.
|
static int |
RU_INV
Real unary inverse.
|
static int |
RU_LOG
Real unary natural logarithm.
|
static int |
RU_MUL
Real unary multiplication.
|
static int |
RU_POW
Real unary power.
|
static int |
RU_RND
Real unary randomization.
|
static int |
RU_SHUFFLE
Real unary shuffle.
|
static int |
RU_SIN
Real unary sine.
|
static int |
RU_SQR
Real unary square.
|
static int |
RU_SQRT
Real unary square root.
|
Modifier and Type | Method and Description |
---|---|
double[] |
caOp(int type,
double[] srcV)
Performs a complex accumulator operation.
|
void |
convert(int type,
Object srcV,
boolean isSrcComplex,
Object dstV,
boolean isDstComplex)
Performs a conversion operation.
|
void |
cuOp(int type,
double aRe,
double aIm,
double[] srcV)
Applies a complex unary operation.
|
void |
derandomize()
Seeds the underlying source of randomness with a constant.
|
void |
diag(double[] srcV,
double[] dstV,
int size,
boolean complex)
Gets the diagonal of a
Matrix . |
void |
eigs(double[] srcV,
double[] vecV,
double[] valV,
int size)
Computes the eigenvectors and eigenvalues of a
Matrix . |
void |
eOp(int type,
Object lhsV,
Object rhsV,
Object dstV,
boolean complex)
Applies a binary operation.
|
int[] |
find(int[] srcV,
int[] srcD,
int[] srcS,
int[] logical)
Extracts the valid indices along a dimension anchored at the given logical index.
|
<V> SparseArrayState<V> |
insertSparse(V oldV,
int[] oldD,
int[] oldS,
int[] oldDo,
int[] oldI,
V newV,
int[] newI)
Inserts elements into a sparse array.
|
void |
invert(double[] srcV,
double[] dstV,
int size)
Computes the inverse of a
Matrix . |
void |
iuOp(int type,
int a,
int[] srcV)
Applies an integer unary operation.
|
void |
map(int[] bounds,
Object srcV,
int[] srcD,
int[] srcS,
Object dstV,
int[] dstD,
int[] dstS)
Performs a mapping operation.
|
void |
mul(double[] lhsV,
double[] rhsV,
int lr,
int rc,
double[] dstV,
boolean complex)
Multiplies two
Matrix s. |
void |
randomize()
Seeds the underlying source of randomness with the current time.
|
double |
raOp(int type,
double[] srcV)
Performs a real accumulator operation.
|
void |
rdOp(int type,
double[] srcV,
int[] srcD,
int[] srcS,
double[] dstV,
int... opDims)
Performs a real dimension operation.
|
void |
riOp(int type,
double[] srcV,
int[] srcD,
int[] srcS,
int[] dstV,
int dim)
Performs a real index operation.
|
void |
rrOp(int type,
double[] srcV,
int[] srcD,
int[] srcS,
double[] dstV,
int[] dstD,
int[] dstS,
int... opDims)
Performs a real reduce operation.
|
void |
ruOp(int type,
double a,
double[] srcV)
Applies a real unary operation.
|
void |
slice(int[] slices,
Object srcV,
int[] srcD,
int[] srcS,
Object dstV,
int[] dstD,
int[] dstS)
Performs a slicing operation.
|
<V> SparseArrayState<V> |
sliceSparse(int[] slices,
V srcV,
int[] srcD,
int[] srcS,
int[] srcDo,
int[] srcI,
int[] srcIo,
int[] srcIi,
V dstV,
int[] dstD,
int[] dstS,
int[] dstDo,
int[] dstI,
int[] dstIo,
int[] dstIi)
Slices one sparse array into another.
|
void |
svd(double[] srcV,
int srcStrideRow,
int srcStrideCol,
double[] uV,
double[] sV,
double[] vV,
int nRows,
int nCols)
Computes the singular value decomposition of a
Matrix . |
static final int RR_SUM
static final int RR_PROD
static final int RR_MAX
static final int RR_MIN
static final int RR_VAR
static final int RI_MAX
static final int RI_MIN
static final int RI_ZERO
static final int RI_GZERO
static final int RI_LZERO
static final int RI_SORT
static final int RD_SUM
static final int RD_PROD
static final int RA_SUM
static final int RA_PROD
static final int RA_VAR
static final int RA_MAX
static final int RA_MIN
static final int RA_ENT
static final int CA_SUM
static final int CA_PROD
static final int RU_ADD
static final int RU_MUL
static final int RU_ABS
static final int RU_POW
static final int RU_EXP
static final int RU_RND
static final int RU_LOG
static final int RU_SQRT
static final int RU_SQR
static final int RU_INV
static final int RU_COS
static final int RU_SIN
static final int RU_ATAN
static final int RU_FILL
static final int RU_SHUFFLE
static final int CU_ADD
static final int CU_MUL
static final int CU_EXP
static final int CU_RND
static final int CU_CONJ
static final int CU_COS
static final int CU_SIN
static final int CU_FILL
static final int CU_SHUFFLE
static final int IU_ADD
static final int IU_MUL
static final int IU_FILL
static final int IU_SHUFFLE
static final int RE_ADD
static final int RE_SUB
static final int RE_MUL
static final int RE_DIV
static final int RE_MAX
static final int RE_MIN
static final int IE_ADD
static final int IE_SUB
static final int IE_MUL
static final int IE_MAX
static final int IE_MIN
static final int CE_ADD
static final int CE_SUB
static final int CE_MUL
static final int CE_DIV
static final int C_TO_R_ABS
static final int C_TO_R_RE
static final int C_TO_R_IM
static final int R_TO_C_RE
static final int R_TO_C_IM
static final int I_TO_R
void randomize()
void derandomize()
void map(int[] bounds, Object srcV, int[] srcD, int[] srcS, Object dstV, int[] dstD, int[] dstS)
bounds
- the mapping bounds.srcV
- the source values.srcD
- the source dimensions.srcS
- the source strides.dstV
- the destination values.dstD
- the destination dimensions.dstS
- the destination strides.void slice(int[] slices, Object srcV, int[] srcD, int[] srcS, Object dstV, int[] dstD, int[] dstS)
slices
- the slicing specification.srcV
- the source values.srcD
- the source dimensions.srcS
- the source strides.dstV
- the destination values.dstD
- the destination dimensions.dstS
- the destination strides.void rrOp(int type, double[] srcV, int[] srcD, int[] srcS, double[] dstV, int[] dstD, int[] dstS, int... opDims)
type
- the operation type.srcV
- the source values.srcD
- the source dimensions.srcS
- the source strides.dstV
- the destination values.dstD
- the destination dimensions.dstS
- the destination strides.opDims
- the dimensions of interest.void riOp(int type, double[] srcV, int[] srcD, int[] srcS, int[] dstV, int dim)
type
- the operation type.srcV
- the source values.srcD
- the source dimensions.srcS
- the source strides.dstV
- the destination values.dim
- the dimension of interest.void rdOp(int type, double[] srcV, int[] srcD, int[] srcS, double[] dstV, int... opDims)
type
- the operation type.srcV
- the source values.srcD
- the source dimensions.srcS
- the source strides.dstV
- the destination values.opDims
- the dimensions of interest.double raOp(int type, double[] srcV)
type
- the operation type.srcV
- the array.double[] caOp(int type, double[] srcV)
type
- the operation type.srcV
- the array.void ruOp(int type, double a, double[] srcV)
type
- the operation type.a
- the argument, if any.srcV
- the array.void cuOp(int type, double aRe, double aIm, double[] srcV)
type
- the operation type.aRe
- the real part of the argument, if any.aIm
- the imaginary part of the argument, if any.srcV
- the array.void iuOp(int type, int a, int[] srcV)
type
- the operation type.a
- the argument, if any.srcV
- the array.void eOp(int type, Object lhsV, Object rhsV, Object dstV, boolean complex)
type
- the operation type.lhsV
- the left hand side values.rhsV
- the right hand side values.dstV
- the destination values.complex
- whether the operation is complex-valued.void convert(int type, Object srcV, boolean isSrcComplex, Object dstV, boolean isDstComplex)
type
- the operation type.srcV
- the source values.isSrcComplex
- whether the source is complex-valued.dstV
- the destination values.isDstComplex
- whether the destination is complex-valued.void mul(double[] lhsV, double[] rhsV, int lr, int rc, double[] dstV, boolean complex)
Matrix
s. They are assumed to have storage order Array.IndexingOrder.FAR
.lhsV
- the left hand side values.rhsV
- the right hand side values.lr
- the row count of the result.rc
- the column count of the result.dstV
- the destination values.complex
- whether the operation is complex-valued.void diag(double[] srcV, double[] dstV, int size, boolean complex)
Matrix
.srcV
- source values.dstV
- destination values.size
- the matrix size.complex
- whether the operation is complex-valued.void svd(double[] srcV, int srcStrideRow, int srcStrideCol, double[] uV, double[] sV, double[] vV, int nRows, int nCols)
Matrix
.srcV
- the source values.srcStrideRow
- the source row stride.srcStrideCol
- the source column stride.uV
- the input vectors.sV
- the gain controls.vV
- the output vectors.nRows
- the number of rows.nCols
- the number of columns.void eigs(double[] srcV, double[] vecV, double[] valV, int size)
Matrix
.srcV
- the source values.vecV
- the eigenvectors.valV
- the eigenvalues.size
- the matrix size.void invert(double[] srcV, double[] dstV, int size)
Matrix
.srcV
- the source values.dstV
- the destination values.size
- the matrix size.int[] find(int[] srcV, int[] srcD, int[] srcS, int[] logical)
srcV
- the source values.srcD
- the source dimensions.srcS
- the source strides.logical
- the logical index.<V> SparseArrayState<V> insertSparse(V oldV, int[] oldD, int[] oldS, int[] oldDo, int[] oldI, V newV, int[] newI)
V
- the storage array type.oldV
- the old values.oldD
- the old dimensions.oldS
- the old strides.oldDo
- the old dimension offsets.oldI
- the old physical indices. Invariant: Sorted in ascending order, and does not contain duplicates.newV
- the new values.newI
- the new physical indices, which need not be sorted in ascending order.SparseArrayState
.<V> SparseArrayState<V> sliceSparse(int[] slices, V srcV, int[] srcD, int[] srcS, int[] srcDo, int[] srcI, int[] srcIo, int[] srcIi, V dstV, int[] dstD, int[] dstS, int[] dstDo, int[] dstI, int[] dstIo, int[] dstIi)
V
- the storage array type.slices
- the slicing specification.srcV
- the source values.srcD
- the source dimensions.srcS
- the source strides.srcDo
- the source dimension offsets.srcI
- the source physical indices. Invariant: Sorted in ascending order, and does not contain duplicates.srcIo
- the source indirection offsets.srcIi
- the source indirections.dstV
- the destination values.dstD
- the destination dimensions.dstS
- the destination strides.dstDo
- the destination dimension offsets.dstI
- the destination physical indices. Invariant: Sorted in ascending order, and does not contain
duplicates.dstIo
- the destination indirection offsets.dstIi
- the destination indirections.SparseArrayState
.