Microchip PIC32AK6416GC41064 handleiding

76 pagina's
PDF beschikbaar

Handleiding

Je bekijkt pagina 24 van 76
Matrix Funcons
User Guide
© 2025 Microchip Technology Inc. and its subsidiaries
DS70005605A - 24
4. Matrix Funcons
Function Description
MatrixAdd Adds the value of each element in the source one matrix with its counterpart in the source
twomatrix andplaces the result in the destination matrix.
MatrixMultiply Performs the matrix multiplication between the source one and source two matrices and
places the result in the destination matrix.
MatrixScale Scales (multiplies) the values of all elements in the source matrix by a scale value and places
the result in the destination matrix.
MatrixSubtract Subtracts the value of each element in the source two matrix from its counterpart in the
source one matrix and places the result in the destination matrix.
MatrixTranspose Transposes the rows by the columns in the source matrix and places the result in the
destination matrix.
MatrixInvert Computes the inverse of the source matrix and places the result in the destination matrix.
4.1. Fraconal Matrix Operaons
A fractional matrix is a collection of numerical values, the matrix elements allocated contiguously
in memory, with the rst element at the lowest memory address. One word of memory is used
to store the value of each element, and this quantity must be interpreted as a fractional number
represented in the 1.31 format.
A pointer addressing the rst element of the matrix is used as a handle which provides access to
each of the matrix values. The address of the rst element is referred to as the base address (BA) of
the matrix. Because each element of the matrix is 32-bits, the base address must be aligned to two
or four, respectively.
The two-dimensional arrangement of a matrix is emulated in the memory storage area by placing
its elements organized in row major order. Thus, the rst value in memory is the rst element of
the rst row. It is followed by the rest of the elements of the rst row. Then, the elements of the
second row are stored, and so on, until all the rows are in memory. This way, the element at row r
and column c of a matrix with R rows and C columns is located from the matrix base address (BA) at:
BA + 4 * (C(r - 1) + c - 1), for 1 ≤ r ≤ R, 1 ≤ c ≤ C.
Unary and binary fractional matrix operations are implemented in this library. The operand matrix
in a unary operation is called the source matrix. In a binary operation the rst operand is referred
to as the source one matrix and the second matrix as the source two matrix. Each operation applies
some computation to one or several elements of the source matrix(ces). The operations result in a
matrix, referred to as the destination matrix.
Some operations resulting in a matrix allow computation in place. This means the results of the
operation are placed back into the source matrix (or the source one matrix for a binary operation).
In this case, the destination matrix is said to (physically) replace the source (one) matrix. If an
operation can be computed in place, it is indicated as such in the comments provided with the
function description.
For some binary operations, the two operands can be the same (physical) source matrix, which
means the operation is applied to the source matrix and itself. If this type of computation is possible
for a given operation, it is indicated as such in the comments provided with the function description.
Some operations can be self-applicable and computed in place.
All fractional matrix operations in this library take as arguments to the number of rows and the
number of columns of the operand matrix(ces). Based on the values of these arguments, the
following assumptions are made:

Bekijk gratis de handleiding van Microchip PIC32AK6416GC41064, stel vragen en lees de antwoorden op veelvoorkomende problemen, of gebruik onze assistent om sneller informatie in de handleiding te vinden of uitleg te krijgen over specifieke functies.

Productinformatie

MerkMicrochip
ModelPIC32AK6416GC41064
CategorieNiet gecategoriseerd
TaalNederlands
Grootte11302 MB