08.05.2011, 23:30 | #1 (permalink) |
Новичок
Регистрация: 08.05.2011
Сообщений: 1
Сказал(а) спасибо: 0
Поблагодарили 0 раз(а) в 0 сообщениях
Репутация: 10
|
Помогите решить задачу. Матрица
unit matrices; interface Uses SysUtils; type Matrix = record M, N : integer; { M - число строк, N - столбцов } Data : array of array of extended; end; {$IFNDEF XP_CMATRIX} {$DEFINE XP_MATRIX} TMap = array of integer; {$ENDIF} Vector = array of extended; Procedure SetSize(var A:Matrix; M,N:integer); overload; {задание размера матрицы} Procedure Zero(var A:Matrix); overload; {заполнение матрицы нулями } Procedure E(var A:Matrix); overload; { единичная матрица } Function Transpose(const A:Matrix):Matrix; overload; { транспонирование матрицы } Function Add(const A,B:Matrix):Matrix; overload; { сложение матриц } Function Sub(const A,B:Matrix):Matrix; overload; { вычитанние матриц } Function Mul(const A,B:Matrix):Matrix; overload; { умножение матриц } Function AddValue(const A:Matrix; Value:extended):Matrix; overload; { сложение матрицы с числом } Function MulValue(const A:Matrix; Value:extended):Matrix; overload; { домножение матрицы на число } Function Negate(const A:Matrix):Matrix; overload; { измненение знака элеметнов матрицы} Procedure DeleteRow(var A:Matrix; Row:integer); overload; Procedure DeleteCol(var A:Matrix; Col:integer); overload; Procedure DeleteCross(var A:Matrix; Row:integer); overload; Procedure InsertRow(var A:Matrix; Row:integer); overload; Procedure InsertCol(var A:Matrix; Col:integer); overload; Function MapMatrix(const A:Matrix; const Map:TMap):Matrix; overload; Function UnmapMatrix(const A:Matrix; const Map:TMap):Matrix; overload; Function MapVector(const A:Matrix; const Map:TMap):Matrix; overload; Function UnmapVector(const A:Matrix; const Map:TMap):Matrix; overload; Function SubMatrix(const A:Matrix; const MapX,MapY:TMap):Matrix; overload; Function RangeMatrix(const A:Matrix; StartX,EndX,StartY,EndY:integer):Matrix; overload; Function Vectorize(const A:Matrix):Vector; overload; Function Unvectorize(const V:Vector):Matrix; overload; Function Inverse(const A:Matrix):Matrix; overload; Function Trace(const A:Matrix):extended; overload; Procedure JoinBottom(var A:Matrix; const B:Matrix); overload; Procedure JoinRight(var A:Matrix; const B:Matrix); overload; Procedure JoinDiag(var A:Matrix; const B:Matrix); overload; implementation Procedure SetSize(var A:Matrix; M,N:integer); var i : integer; Begin A.M:=M; A.N:=N; SetLength(A.Data,M); for i:=0 to M-1 do begin SetLength(A.Data[i],N); end; End; |
08.05.2011, 23:30 | |
Helpmaster
Member
Регистрация: 08.03.2016
Сообщений: 0
|
Содержание данных топиков схоже с вашим Помогите решить задачу Помогите решить задачу) |
Ads | |
Member
Регистрация: 31.10.2006
Сообщений: 40200
Записей в дневнике: 0
Сказал(а) спасибо: 0
Поблагодарили 0 раз(а) в 0 сообщениях
Репутация: 55070
|
|
|