30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

15<br />

Cycles (including C-function call and return overheads):<br />

20 + 4(numRows*numCols)<br />

MatrixTranspose<br />

Description: MatrixTransposetransposes the rows by the columns in the source<br />

matrix, and places the result indestination matrix. In effect:<br />

dstM[i][j]= srcM[j][i],<br />

0 ≤i < numRows, 0 ≤j < numCols.<br />

Include: dsp.h<br />

Prototype: extern fractional* MatrixTranspose (<br />

int numRows,<br />

int numCols,<br />

fractional* dstM,<br />

fractional* srcM<br />

);<br />

Arguments: numRows number of rows in source matrix<br />

numCols number of columns in source matrix<br />

dstM pointer to destination matrix<br />

srcM pointer to source matrix<br />

Return Value: Pointer to base address of destination matrix.<br />

Remarks: If the source matrix is square, this function can be computed in place.<br />

See Additional Remarks at the beginning of the section for comments<br />

on this mode of operation.<br />

Source File: mtrp.asm<br />

Function Profile: System resources usage:<br />

W0..W5 used, not restored<br />

DOand REPEATinstruction usage:<br />

2 level DOinstructions<br />

no REPEATinstructions<br />

Program words (24-bit instructions):<br />

14<br />

Cycles (including C-function call and return overheads):<br />

16 + numCols*(6 + (numRows-1)*3)<br />

MatrixSubtract (Continued)<br />

DSP Library<br />

2004 Microchip Technology Inc. DS51456B-page 37<br />

2.5.5 Matrix Inversion<br />

The result of inverting a non-singular, square, fractional matrix is another<br />

square matrix<br />

Prototype: phao ở ngoài * MatrixInvert (<br />

numRowsCols int,<br />

* nổi dstM,<br />

float * srcM,<br />

* nổi pivotFlag,<br />

int * swappedRows,<br />

int * swappedCols<br />

);<br />

Đối số: numRowCols số hàng và cột trong (hình vuông) nguồn<br />

ma trận<br />

dstM con trỏ đến ma trận điểm<br />

con trỏ srcM để ma trận nguồn<br />

Cần thiết để sử dụng nội bộ:<br />

pivotFlag con trỏ đến một vector numRowsCols dài<br />

swappedRows con trỏ đến một vector numRowsCols dài<br />

swappedCols con trỏ đến một vector numRowsCols dài<br />

Quay trở lại giá trị: Con trỏ trỏ tới địa chỉ cơ sở của ma trận điểm đến, hoặc<br />

NULLif nguồn ma trận<br />

là số ít.<br />

Bình luận: Mặc dù các vectơ pivotFlag, swappedRows, và<br />

swappedCols, là để dùng nội bộ thì phải giao trước<br />

gọi chức năng này.<br />

Nếu ma trận nguồn là số ít (yếu tố quyết định bằng không) ma trận không<br />

không có tính khả nghịch. Trong trường hợp này hàm trả về NULL.<br />

Chức năng này có thể được tính tại chỗ.<br />

Source File: minv.asm (lắp ráp từ C-code)<br />

Chức năng thông tin: sử dụng nguồn tài nguyên của hệ thống:<br />

W0..W7 sử dụng, không được khôi phục<br />

W8, W14 lưu, sử dụng, phục hồi<br />

DOand REPEATinstruction sử dụng:<br />

Không<br />

Từ chương trình (hướng dẫn 24-bit):<br />

Xem file "readme.txt" trong pic30_tools \ src \ DSP cho thông tin này.<br />

Chu kỳ (bao gồm cả cuộc gọi C-chức năng và trả các chi phí):<br />

Xem file "readme.txt" trong pic30_tools \ src \ DSP cho thông tin này.<br />

dsPIC<br />

®<br />

Thư viện Công cụ Ngôn ngữ<br />

DS51456B trang 38<br />

2.6 CHỨC NĂNG LỌC<br />

2004 Microchip Technology Inc

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!