fortran-lapack
Loading...
Searching...
No Matches
la_eye::eye Interface Reference

Construct an identity matrix of size \(m \times n\). More...

Public Member Functions

pure real(sp) function, dimension(:,:), allocatable la_eye_s (m, n, mold)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
pure real(dp) function, dimension(:,:), allocatable la_eye_d (m, n, mold)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
pure real(qp) function, dimension(:,:), allocatable la_eye_q (m, n, mold)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
pure complex(sp) function, dimension(:,:), allocatable la_eye_c (m, n, mold)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
pure complex(dp) function, dimension(:,:), allocatable la_eye_z (m, n, mold)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
pure complex(qp) function, dimension(:,:), allocatable la_eye_w (m, n, mold)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
real(sp) function, dimension(:,:), allocatable la_eye_s_errhandle (m, n, mold, err)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
real(dp) function, dimension(:,:), allocatable la_eye_d_errhandle (m, n, mold, err)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
real(qp) function, dimension(:,:), allocatable la_eye_q_errhandle (m, n, mold, err)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
complex(sp) function, dimension(:,:), allocatable la_eye_c_errhandle (m, n, mold, err)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
complex(dp) function, dimension(:,:), allocatable la_eye_z_errhandle (m, n, mold, err)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 
complex(qp) function, dimension(:,:), allocatable la_eye_w_errhandle (m, n, mold, err)
 Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.
 

Detailed Description

Construct an identity matrix of size \(m \times n\).

This function returns a diagonal identity matrix of size \(m \times n\), where all diagonal elements are set to 1 and all off-diagonal elements are set to 0. The number of rows and columns can be specified. If only one parameter is provided, a square matrix of size \(m \times m\) is returned.

Parameters
[in]mThe number of rows of the identity matrix.
[in]n(Optional) The number of columns of the identity matrix. If omitted, the matrix is square ( \(m \times m\)).
[in]mold(Optional) Data type to define the return type. Defaults to real(real64).
Returns
The identity matrix with size \(m \times n\).
Note
If the mold parameter is omitted, the default type is real(real64). If specified, the return type matches the given type.
Warning
Ensure that the matrix dimensions are valid and consistent with the type definition.

Return a square diagonal matrix with diagonal values, or extract a diagonal.

This function generates a square diagonal matrix where the diagonal elements are either equal to the specified scalar value or populated by the input array. The size of the matrix is determined by the input parameter \(n\) or the size of the input array. Given a matrix instead, the function extracts one of its diagonals as a vector.

Parameters
[in]nThe size of the square matrix (only used if a scalar is provided for the diagonal).
[in]sourceIf a scalar, this value is used to populate the diagonal of the matrix. If an array, the elements of the array are used for the diagonal. If a matrix, its \(k\)-th diagonal is returned as a vector.
[in]k(Optional) Index of the diagonal: 0 is the main diagonal, \(k>0\) the \(k\)-th superdiagonal, \(k<0\) the \(k\)-th subdiagonal.
[out]err(Optional) State return flag. If not provided, the function will stop on error.
Returns
The diagonal matrix with size \(n \times n\), where the diagonal elements are populated by \(source\), or the requested diagonal of the input matrix.
Note
If a scalar value is passed, the diagonal elements of the matrix will all be equal to \(source\). If an array is passed, its length determines the size of the matrix, and the array elements are placed along the diagonal. The err parameter is optional. If not requested, the code will stop on error. Otherwise, it returns the error state of the function.

Return the trace of a matrix.

This function sums the elements of the main diagonal of a matrix. The matrix need not be square: for a \(m \times n\) matrix, the first \(\min(m,n)\) diagonal elements are summed.

Parameters
[in]AThe input matrix of size \( [m,n] \).
Returns
The sum \( \sum_i A_{ii} \), of the same type and kind as A.

Return the outer product of two vectors.

This function computes \( u \otimes v \), the rank-2 array whose \((i,j)\) element is \( u_i v_j \).

Parameters
[in]uThe first input vector, of size \(m\).
[in]vThe second input vector, of size \(n\).
Returns
The \( m \times n \) outer product matrix.

Return the cross product of two 3-dimensional vectors.

This function computes \( a \times b \), the vector orthogonal to both input vectors.

Parameters
[in]aThe first input vector, of size 3.
[in]bThe second input vector, of size 3.
Returns
The size-3 cross product vector.

Return the Kronecker product of two matrices.

This function computes \( A \otimes B \): given \( A \) of size \( m_1 \times n_1 \) and \( B \) of size \( m_2 \times n_2 \), the result is the \( (m_1 m_2) \times (n_1 n_2) \) block matrix whose \((i,j)\) block is \( A_{ij} B \).

Parameters
[in]AThe first input matrix, of size \( [m_1,n_1] \).
[in]BThe second input matrix, of size \( [m_2,n_2] \).
Returns
The \( (m_1 m_2) \times (n_1 n_2) \) Kronecker product matrix.

Return the Hermitian transpose of a matrix.

This function returns conjg(transpose(a)) for a complex matrix and transpose(a) for a real one.

Parameters
[in]aThe input matrix of size \( [m,n] \).
Returns
The \( n \times m \) matrix \( a^H \).

Member Function/Subroutine Documentation

◆ la_eye_c()

pure complex(sp) function, dimension(:,:), allocatable la_eye::eye::la_eye_c ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
complex(sp), intent(in) mold )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
Returns
Return matrix

◆ la_eye_c_errhandle()

complex(sp) function, dimension(:,:), allocatable la_eye::eye::la_eye_c_errhandle ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
complex(sp), intent(in) mold,
type(la_state), intent(out) err )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Return matrix

◆ la_eye_d()

pure real(dp) function, dimension(:,:), allocatable la_eye::eye::la_eye_d ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
real(dp), intent(in), optional mold )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
Returns
Return matrix

◆ la_eye_d_errhandle()

real(dp) function, dimension(:,:), allocatable la_eye::eye::la_eye_d_errhandle ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
real(dp), intent(in), optional mold,
type(la_state), intent(out) err )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Return matrix

◆ la_eye_q()

pure real(qp) function, dimension(:,:), allocatable la_eye::eye::la_eye_q ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
real(qp), intent(in) mold )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
Returns
Return matrix

◆ la_eye_q_errhandle()

real(qp) function, dimension(:,:), allocatable la_eye::eye::la_eye_q_errhandle ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
real(qp), intent(in) mold,
type(la_state), intent(out) err )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Return matrix

◆ la_eye_s()

pure real(sp) function, dimension(:,:), allocatable la_eye::eye::la_eye_s ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
real(sp), intent(in) mold )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
Returns
Return matrix

◆ la_eye_s_errhandle()

real(sp) function, dimension(:,:), allocatable la_eye::eye::la_eye_s_errhandle ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
real(sp), intent(in) mold,
type(la_state), intent(out) err )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Return matrix

◆ la_eye_w()

pure complex(qp) function, dimension(:,:), allocatable la_eye::eye::la_eye_w ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
complex(qp), intent(in) mold )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
Returns
Return matrix

◆ la_eye_w_errhandle()

complex(qp) function, dimension(:,:), allocatable la_eye::eye::la_eye_w_errhandle ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
complex(qp), intent(in) mold,
type(la_state), intent(out) err )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Return matrix

◆ la_eye_z()

pure complex(dp) function, dimension(:,:), allocatable la_eye::eye::la_eye_z ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
complex(dp), intent(in) mold )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
Returns
Return matrix

◆ la_eye_z_errhandle()

complex(dp) function, dimension(:,:), allocatable la_eye::eye::la_eye_z_errhandle ( integer(ilp), intent(in) m,
integer(ilp), intent(in), optional n,
complex(dp), intent(in) mold,
type(la_state), intent(out) err )

Function to construct an identity matrix of size m x n. This function returns a diagonal identity matrix, with the diagonal elements equal to 1 and all other elements set to 0.

Parameters
[in]mNumber of rows of the identity matrix.
[in]nNumber of columns of the identity matrix (optional).
[in]moldData type, used to define the return type. Defaults to real(real64).
[out]err[optional] state return flag. On error if not requested, the code will stop
Returns
Return matrix

The documentation for this interface was generated from the following file: