_LoadMatrix
Loads a 4x4 matrix into the extended floating-point register bank.
float* _LoadMatrix(
float* matrix
);
Parameters
- matrix
[in] Pointer to an array of float values arranged such that the indices of the array are the [row][column] values of the 4x4 matrix.
Return Values
Pointer to the 4x4 matrix that has been loaded.
Remarks
The following example shows how to use _LoadMatrix.
#include <stdio.h>
#include <shintr.h>
void main()
{
int i,j;
float result[4][4];
// #########################################################
float m1[4][4] = {1.0,1.0,1.0,1.0,
2.0,2.0,2.0,2.0,
3.0,3.0,3.0,3.0,
4.0,4.0,4.0,4.0};
// #########################################################
float m2[4][4] = {2.0,2.0,2.0,2.0,
2.0,2.0,2.0,2.0,
2.0,2.0,2.0,2.0,
2.0,2.0,2.0,2.0};
// #########################################################
_LoadMatrix(m1); //Load m1 matrix into XD bank regs
_XDMultMatrix(m2); //[m1]x[m2] Saved result into XD bank regs
_SaveMatrix(result); //Load XD bank regs into result buffer
// Print out result
printf("Result of [m1]x[m2] = \n");
for (i = 0; i < 4; i++)
{
printf("| ");
for (j =0; j < 4; j++)
printf("%8.4f ", result[i][j]);
printf(" |\n");
}
}
This example results in the following output.
Result of [m1]x[m2] =
| 8.0000 8.0000 8.0000 8.0000 |
| 16.0000 16.0000 16.0000 16.0000 |
| 24.0000 24.0000 24.0000 24.0000 |
| 32.0000 32.0000 32.0000 32.0000 |
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: shintr.h.
See Also
_SaveMatrix | Microprocessor-specific Intrinsic Functions
Last updated on Thursday, April 08, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.