KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
linalg.h File Reference

Provide linalg APIs. More...

#include "kids/Types.h"
Include dependency graph for linalg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  PROJECT_NS
 < http://warp.povusers.org/FunctionParser/fparser.html
 

Macros

#define KIDS_LINALG_BIND_EIGEN_NOT_USE_TEMPLATE
 

Functions

bool PROJECT_NS::ARRAY_ISFINITE (kids_real *A, size_t n)
 Check if all elements of a real array are finite.
 
bool PROJECT_NS::ARRAY_ISFINITE (kids_complex *A, size_t n)
 Check if all elements of a complex array are finite.
 
void PROJECT_NS::ARRAY_CLEAR (kids_int *A, size_t N)
 Set all elements of an integer array to zero.
 
void PROJECT_NS::ARRAY_CLEAR (kids_real *A, size_t N)
 Set all elements of a real array to zero.
 
void PROJECT_NS::ARRAY_CLEAR (kids_complex *A, size_t N)
 Set all elements of a complex array to zero.
 
void PROJECT_NS::ARRAY_MATMUL (kids_real *A, kids_real *B, kids_real *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B * C for real matrices.
 
void PROJECT_NS::ARRAY_MATMUL (kids_complex *A, kids_complex *B, kids_complex *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B * C for complex matrices.
 
void PROJECT_NS::ARRAY_MATMUL (kids_complex *A, kids_real *B, kids_complex *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B * C for complex and real matrices.
 
void PROJECT_NS::ARRAY_MATMUL (kids_complex *A, kids_complex *B, kids_real *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B * C for complex and real matrices.
 
void PROJECT_NS::ARRAY_MATMUL_TRANS1 (kids_real *A, kids_real *B, kids_real *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B^T * C for real matrices.
 
void PROJECT_NS::ARRAY_MATMUL_TRANS1 (kids_complex *A, kids_complex *B, kids_complex *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B^T * C for complex matrices.
 
void PROJECT_NS::ARRAY_MATMUL_TRANS1 (kids_complex *A, kids_real *B, kids_complex *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B^T * C for complex and real matrices.
 
void PROJECT_NS::ARRAY_MATMUL_TRANS1 (kids_complex *A, kids_complex *B, kids_real *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B^T * C for complex and real matrices.
 
void PROJECT_NS::ARRAY_MATMUL_TRANS2 (kids_real *A, kids_real *B, kids_real *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B * C^T for real matrices.
 
void PROJECT_NS::ARRAY_MATMUL_TRANS2 (kids_complex *A, kids_complex *B, kids_complex *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B * C^T for complex matrices.
 
void PROJECT_NS::ARRAY_MATMUL_TRANS2 (kids_complex *A, kids_real *B, kids_complex *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B * C^T for complex and real matrices.
 
void PROJECT_NS::ARRAY_MATMUL_TRANS2 (kids_complex *A, kids_complex *B, kids_real *C, size_t N1, size_t N2, size_t N3)
 Perform matrix multiplication where A = B * C^T for complex and real matrices.
 
void PROJECT_NS::ARRAY_OUTER_TRANS2 (kids_real *A, kids_real *B, kids_real *C, size_t N1, size_t N2)
 Perform outer product with transpose where A = B^T * C for real matrices.
 
void PROJECT_NS::ARRAY_OUTER_TRANS2 (kids_complex *A, kids_complex *B, kids_complex *C, size_t N1, size_t N2)
 Perform outer product with transpose where A = B^T * C for complex matrices.
 
void PROJECT_NS::ARRAY_MATMUL3_TRANS1 (kids_real *A, kids_real *B, kids_real *C, kids_real *D, size_t N1, size_t N2, size_t N0, size_t N3)
 Perform matrix multiplication where A = B^T * C * D for real matrices.
 
void PROJECT_NS::ARRAY_MATMUL3_TRANS1 (kids_complex *A, kids_complex *B, kids_complex *C, kids_complex *D, size_t N1, size_t N2, size_t N0, size_t N3)
 Perform matrix multiplication where A = B^T * C * D for complex matrices.
 
void PROJECT_NS::ARRAY_MATMUL3_TRANS1 (kids_complex *A, kids_real *B, kids_complex *C, kids_real *D, size_t N1, size_t N2, size_t N0, size_t N3)
 Perform matrix multiplication where A = B^T * C * D for complex and real matrices.
 
void PROJECT_NS::ARRAY_MATMUL3_TRANS1 (kids_complex *A, kids_complex *B, kids_real *C, kids_complex *D, size_t N1, size_t N2, size_t N0, size_t N3)
 Perform matrix multiplication where A = B^T * C * D for complex and real matrices.
 
void PROJECT_NS::ARRAY_MATMUL3_TRANS2 (kids_real *A, kids_real *B, kids_real *C, kids_real *D, size_t N1, size_t N2, size_t N0, size_t N3)
 Perform matrix multiplication where A = B * C * D^T for real matrices.
 
void PROJECT_NS::ARRAY_MATMUL3_TRANS2 (kids_complex *A, kids_complex *B, kids_complex *C, kids_complex *D, size_t N1, size_t N2, size_t N0, size_t N3)
 Perform matrix multiplication where A = B * C * D^T for complex matrices.
 
void PROJECT_NS::ARRAY_MATMUL3_TRANS2 (kids_complex *A, kids_real *B, kids_complex *C, kids_real *D, size_t N1, size_t N2, size_t N0, size_t N3)
 Perform matrix multiplication where A = B * C * D^T for complex and real matrices.
 
void PROJECT_NS::ARRAY_MATMUL3_TRANS2 (kids_complex *A, kids_complex *B, kids_real *C, kids_complex *D, size_t N1, size_t N2, size_t N0, size_t N3)
 Perform matrix multiplication where A = B * C * D^T for complex and real matrices.
 
kids_real PROJECT_NS::ARRAY_TRACE2 (kids_real *B, kids_real *C, size_t N1, size_t N2)
 Compute the trace of the matrix product B * C for real matrices.
 
kids_complex PROJECT_NS::ARRAY_TRACE2 (kids_complex *B, kids_complex *C, size_t N1, size_t N2)
 Compute the trace of the matrix product B * C for complex matrices.
 
kids_complex PROJECT_NS::ARRAY_TRACE2 (kids_complex *B, kids_real *C, size_t N1, size_t N2)
 Compute the trace of the matrix product B * C for complex and real matrices.
 
kids_complex PROJECT_NS::ARRAY_TRACE2 (kids_real *B, kids_complex *C, size_t N1, size_t N2)
 Compute the trace of the matrix product B * C for real and complex matrices.
 
kids_real PROJECT_NS::ARRAY_TRACE2_DIAG (kids_real *B, kids_real *C, size_t N1, size_t N2)
 Compute the trace of the diagonal elements of the matrix product B * C for real matrices.
 
kids_complex PROJECT_NS::ARRAY_TRACE2_DIAG (kids_complex *B, kids_complex *C, size_t N1, size_t N2)
 Compute the trace of the diagonal elements of the matrix product B * C for complex matrices.
 
kids_complex PROJECT_NS::ARRAY_TRACE2_DIAG (kids_complex *B, kids_real *C, size_t N1, size_t N2)
 Compute the trace of the diagonal elements of the matrix product B * C for complex and real matrices.
 
kids_complex PROJECT_NS::ARRAY_TRACE2_DIAG (kids_real *B, kids_complex *C, size_t N1, size_t N2)
 Compute the trace of the diagonal elements of the matrix product B * C for real and complex matrices.
 
kids_real PROJECT_NS::ARRAY_TRACE2_OFFD (kids_real *B, kids_real *C, size_t N1, size_t N2)
 Compute the trace of the off-diagonal elements of the matrix product B * C for real matrices.
 
kids_complex PROJECT_NS::ARRAY_TRACE2_OFFD (kids_complex *B, kids_complex *C, size_t N1, size_t N2)
 Compute the trace of the off-diagonal elements of the matrix product B * C for complex matrices.
 
kids_complex PROJECT_NS::ARRAY_TRACE2_OFFD (kids_complex *B, kids_real *C, size_t N1, size_t N2)
 Compute the trace of the off-diagonal elements of the matrix product B * C for complex and real matrices.
 
kids_complex PROJECT_NS::ARRAY_TRACE2_OFFD (kids_real *B, kids_complex *C, size_t N1, size_t N2)
 Compute the trace of the off-diagonal elements of the matrix product B * C for real and complex matrices.
 
kids_real PROJECT_NS::ARRAY_INNER_TRANS1 (kids_real *B, kids_real *C, size_t N1)
 Compute the inner product of the transpose of B with C for real matrices.
 
kids_complex PROJECT_NS::ARRAY_INNER_TRANS1 (kids_complex *B, kids_complex *C, size_t N1)
 Compute the inner product of the conjugate transpose of B with C for complex matrices.
 
kids_complex PROJECT_NS::ARRAY_INNER_TRANS1 (kids_complex *B, kids_real *C, size_t N1)
 Compute the inner product of the conjugate transpose of B with C for complex and real matrices.
 
kids_complex PROJECT_NS::ARRAY_INNER_TRANS1 (kids_real *B, kids_complex *C, size_t N1)
 Compute the inner product of the transpose of B with C for real and complex matrices.
 
kids_real PROJECT_NS::ARRAY_INNER_VMV_TRANS1 (kids_real *B, kids_real *C, kids_real *D, size_t N1, size_t N2)
 Compute the inner product of the transpose of the real vector B with the matrix C, element-wise multiplication with the real vector D.
 
kids_complex PROJECT_NS::ARRAY_INNER_VMV_TRANS1 (kids_complex *B, kids_complex *C, kids_complex *D, size_t N1, size_t N2)
 Compute the inner product of the conjugate transpose of the complex vector B with the complex matrix C, element-wise multiplication with the complex vector D.
 
kids_complex PROJECT_NS::ARRAY_INNER_VMV_TRANS1 (kids_complex *B, kids_real *C, kids_complex *D, size_t N1, size_t N2)
 Compute the inner product of the conjugate transpose of the complex vector B with the real matrix C, element-wise multiplication with the complex vector D.
 
kids_complex PROJECT_NS::ARRAY_INNER_VMV_TRANS1 (kids_real *B, kids_complex *C, kids_real *D, size_t N1, size_t N2)
 Compute the inner product of the transpose of the real vector B with the complex matrix C, element-wise multiplication with the real vector D.
 
void PROJECT_NS::ARRAY_EYE (kids_real *A, size_t n)
 Generate an identity matrix of size n for real numbers.
 
void PROJECT_NS::ARRAY_EYE (kids_complex *A, size_t n)
 Generate an identity matrix of size n for complex numbers.
 
void PROJECT_NS::ARRAY_MAT_DIAG (kids_real *A, kids_real *B, size_t N1)
 Copy the diagonal elements from matrix B to matrix A for real matrices.
 
void PROJECT_NS::ARRAY_MAT_DIAG (kids_complex *A, kids_complex *B, size_t N1)
 Copy the diagonal elements from matrix B to matrix A for complex matrices.
 
void PROJECT_NS::ARRAY_MAT_DIAG (kids_complex *A, kids_real *B, size_t N1)
 Copy the diagonal elements from matrix B to matrix A for complex and real matrices.
 
void PROJECT_NS::ARRAY_MAT_OFFD (kids_real *A, kids_real *B, size_t N1)
 Copy the off-diagonal elements from matrix B to matrix A for real matrices.
 
void PROJECT_NS::ARRAY_MAT_OFFD (kids_complex *A, kids_complex *B, size_t N1)
 Copy the off-diagonal elements from matrix B to matrix A for complex matrices.
 
void PROJECT_NS::ARRAY_MAT_OFFD (kids_complex *A, kids_real *B, size_t N1)
 Copy the off-diagonal elements from matrix B to matrix A for complex and real matrices.
 
void PROJECT_NS::LinearSolve (kids_real *x, kids_real *A, kids_real *b, size_t N)
 Solve a linear system Ax = b for real matrices.
 
void PROJECT_NS::EigenSolve (kids_real *E, kids_real *T, kids_real *A, size_t N)
 Solve the eigenvalue problem for real matrices.
 
void PROJECT_NS::EigenSolve (kids_real *E, kids_complex *T, kids_complex *A, size_t N)
 Solve the eigenvalue problem for (hermite) complex matrices.
 
void PROJECT_NS::EigenSolve (kids_complex *E, kids_complex *T, kids_complex *A, size_t N)
 Solve the eigenvalue problem for general complex matrices.
 
void PROJECT_NS::PseudoInverse (kids_real *A, kids_real *invA, size_t N, kids_real e=1E-5)
 Compute the pseudo-inverse of a matrix for real numbers.
 
void PROJECT_NS::MatrixInverse (kids_real *invA, kids_real *A, size_t N)
 Compute the inverse of a matrix for real numbers.
 
void PROJECT_NS::ARRAY_INV_MAT (kids_complex *invA, kids_complex *A, size_t N)
 Compute the inverse of a matrix for complex numbers.
 
void PROJECT_NS::ARRAY_EXP_MAT_GENERAL (kids_complex *expkA, kids_complex *A, kids_complex k, size_t N)
 
void PROJECT_NS::ARRAY_CORRECT_U (kids_complex *U, size_t N)
 
void PROJECT_NS::ARRAY_TRANSPOSE (kids_real *A, size_t N1, size_t N2)
 
void PROJECT_NS::ARRAY_TRANSPOSE (kids_complex *A, size_t N1, size_t N2)
 

Detailed Description

Provide linalg APIs.

unified APIs, and realization can be based on either Eigen or MKL

See also
eigen: https://eigen.tuxfamily.org/dox/ mkl : https://www.intel.com/content/www/us/en/develop/documentation/onemkl-lapack-examples/top.html
Author
Xin He
Date
2024-03
Version
1.0
revision:
Date Description
2024-04-25 split from tpl APIs, which is slow in compilation

Definition in file linalg.h.

Macro Definition Documentation

◆ KIDS_LINALG_BIND_EIGEN_NOT_USE_TEMPLATE

#define KIDS_LINALG_BIND_EIGEN_NOT_USE_TEMPLATE

Definition at line 35 of file linalg.h.