Difference between revisions of "Procedural"

From Efficient Java Matrix Library
Jump to navigation Jump to search
Line 14: Line 14:
 
! Name !! Description
 
! Name !! Description
 
|-
 
|-
| {{DataDocLink|DenseMatrix64F}} || Dense Real Matrix
+
| {{DataDocLink|DMatrixRMaj}} || Dense Double Real Matrix
 
|-
 
|-
| {{DataDocLink|CDenseMatrix64F}} || Dense Complex Matrix
+
| {{DataDocLink|FMatrixRMaj}} || Dense Float Real Matrix
 +
|-
 +
| {{DataDocLink|ZDMatrixRMaj}} || Dense Double Complex Matrix
 +
|-
 +
| {{DataDocLink|CDMatrixRMaj}} || Dense Float Complex Matrix
 
|-
 
|-
 
| {{DocLink|org/ejml/data/FixedMatrix3x3_64F.html|FixedMatrixNxN_F64F}} || Fixed Size Dense Real Matrix
 
| {{DocLink|org/ejml/data/FixedMatrix3x3_64F.html|FixedMatrixNxN_F64F}} || Fixed Size Dense Real Matrix
Line 39: Line 43:
 
= Operations =
 
= Operations =
  
Several "Ops" classes provide functions for manipulating DenseMatrix64F and most are contained inside of the org.ejml.ops package.  The list below is provided for real matrices.  For complex matrices add a "C" in front of the name, e.g. CCommonOps.
+
Several "Ops" classes provide functions for manipulating *MatrixRMaj and most are contained inside of the org.ejml.dense.row package.  The list below is provided for real matrices.  Other matrix can be found by changing the suffix.
 +
 
 +
{| class="wikitable"
 +
! Suffix || Matrix Type
 +
|-
 +
| DDRM || Dense Double Real
 +
|-
 +
| FDRM || Dense Float Real
 +
|-
 +
| ZDRM || Dense Double Complex
 +
|-
 +
| CDRM || Dense Float Complex
 +
|}
  
; {{OpsDocLink|CommonOps}} : Provides the most common matrix operations.  
+
; {{OpsDocLink|CommonOps_DDRM}} : Provides the most common matrix operations.  
; {{OpsDocLink|EigenOps}} : Provides operations related to eigenvalues and eigenvectors.
+
; {{OpsDocLink|EigenOps_DDRM}} : Provides operations related to eigenvalues and eigenvectors.
; {{OpsDocLink|MatrixFeatures}} : Used to compute various features related to a matrix.
+
; {{OpsDocLink|MatrixFeatures_DDRM}} : Used to compute various features related to a matrix.
; {{OpsDocLink|NormOps}} : Operations for computing different matrix norms.
+
; {{OpsDocLink|NormOps_DDRM}} : Operations for computing different matrix norms.
; {{OpsDocLink|SingularOps}} : Operations related to singular value decompositions.
+
; {{OpsDocLink|SingularOps_DDRM}} : Operations related to singular value decompositions.
; {{OpsDocLink|SpecializedOps}} : Grab bag for operations which do not fit in anywhere else.
+
; {{OpsDocLink|SpecializedOps_DDRM}} : Grab bag for operations which do not fit in anywhere else.
; {{OpsDocLink|RandomMatrices}} : Used to create different types of random matrices.
+
; {{OpsDocLink|RandomMatrices_DDRM}} : Used to create different types of random matrices.
  
 
For fixed sized matrices FixedOpsN is provided, where N = 2 to 6.  FixedOpsN is similar in functionality to CommonOps.
 
For fixed sized matrices FixedOpsN is provided, where N = 2 to 6.  FixedOpsN is similar in functionality to CommonOps.

Revision as of 21:44, 17 May 2017

The procedural interface in EJML provides access to all of its capabilities and provides much more control over which algorithms are used and when memory is created. The downside to this increased control is the added difficulty in programming, kinda resembles writing in assembly. Code can be made very efficient, but managing all the temporary data structures can be tedious.

The procedural API processes DenseMatrix matrix types. A complete list of these data types is listed below. These classes themselves only provide very basic operators for accessing elements within a matrix and well as its size and shape. The complete set of functions for manipulating DenseMatrix are available in various Ops classes, described below.

Internally all dense matrix classes store the matrix in a single array using a row-major format. Fixed sized matrices and vectors unroll the matrix, where each element is a matrix parameter. This can allow for much faster access and array overhead. However if fixed sized matrices get too large then performance starts to drop due to what I suppose is CPU caching issues.

While it has a sharper learning curve and takes more time to learn it is the most powerful API.

DenseMatrix Types

Name Description
DMatrixRMaj Dense Double Real Matrix
FMatrixRMaj Dense Float Real Matrix
ZDMatrixRMaj Dense Double Complex Matrix
CDMatrixRMaj Dense Float Complex Matrix
FixedMatrixNxN_F64F Fixed Size Dense Real Matrix
FixedMatrixN_F64F Fixed Size Dense Real Vector

Accessors

  • get( row , col )
  • set( row , col , value )
    • Returns or sets the value of an element at the specified row and column.
  • unsafe_get( row , col )
  • unsafe_set( row , col , value )
    • Faster version of get() or set() that does not perform bounds checking.
  • get( index )
  • set( index )
    • Returns or sets the value of an element at the specified index. Useful for vectors and element-wise operations.
  • iterator( boolean rowMajor, int minRow, int minCol, int maxRow, int maxCol )
    • An iterator that iterates through the sub-matrix by row or by column.

Operations

Several "Ops" classes provide functions for manipulating *MatrixRMaj and most are contained inside of the org.ejml.dense.row package. The list below is provided for real matrices. Other matrix can be found by changing the suffix.

Suffix Matrix Type
DDRM Dense Double Real
FDRM Dense Float Real
ZDRM Dense Double Complex
CDRM Dense Float Complex
{{{2}}}
Provides the most common matrix operations.
{{{2}}}
Provides operations related to eigenvalues and eigenvectors.
{{{2}}}
Used to compute various features related to a matrix.
{{{2}}}
Operations for computing different matrix norms.
{{{2}}}
Operations related to singular value decompositions.
{{{2}}}
Grab bag for operations which do not fit in anywhere else.
{{{2}}}
Used to create different types of random matrices.

For fixed sized matrices FixedOpsN is provided, where N = 2 to 6. FixedOpsN is similar in functionality to CommonOps.