Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links.
You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the project site itself.

` M_Constr`, ` M_Destr`,
` M_SetName`, ` M_GetName`,
` M_GetRowDim`, ` M_GetClmDim`, ` M_GetElOrder`,
` M_SetLen`, ` M_GetLen`,
` M_SetEntry`, ` M_GetPos`, ` M_GetVal`, ` M_AddVal`,
` M__SetEntry`, ` M__GetPos`, ` M__GetVal`, ` M__AddVal`,
` M_GetEl`,
` M_SortEl`,
` M_Lock`, ` M_Unlock`
-- type ` Matrix` for general rectangular sparse matrices

#include <laspack/matrix.h> typedef double Real; typedef enum { Rowws, Clmws } ElOrderType; typedef enum { Normal, Tempor } InstanceType; void M_Constr(Matrix *M, char *Name, size_t RowDim, size_t ClmDim, ElOrderType ElOrder, InstanceType Instance, Boolean OwnData); void M_Destr(Matrix *M); void M_SetName(Matrix *M, char *Name); char *M_GetName(Matrix *M); size_t M_GetRowDim(Matrix *M); size_t M_GetClmDim(Matrix *M); ElOrderType M_GetElOrder(Matrix *M); void M_SetLen(Matrix *M, size_t RoC, size_t Len); size_t M_GetLen(Matrix *M, size_t RoC); void M_SetEntry(Matrix *M, size_t RoC, size_t Entry, size_t Pos, Real Val); Real M_GetPos(Matrix *M, size_t RoC, size_t Entry); size_t M_GetEVal(Matrix *M, size_t RoC, size_t Entry); void M_AddVal(Matrix *M, size_t RoC, size_t Entry, Real Val); void M__SetEntry(Matrix *M, size_t RoC, size_t Entry, size_t Pos, Real Val); Real M__GetPos(Matrix *M, size_t RoC, size_t Entry); size_t M__GetVal(Matrix *M, size_t RoC, size_t Entry); void M__AddVal(Matrix *M, size_t RoC, size_t Entry, Real Val); Real M_GetEl(Matrix *M, size_t Row, size_t Clm); void M_SortEl(Matrix *M); void M_Lock(Matrix *M); void M_Unlock(Matrix *M);

` matrix.h ... ` header file

` matrix.c ... ` source file

The matrix

| 1 2 1 0 0 0 0 | | 0 0 1 2 1 0 0 | | 0 0 0 0 1 2 1 |

which may be used e.g. for weighted restriction of grid functions from a seven point to a three point grid, could be generated by the following code fragment:

Matrix R; size_t Row; ... M_Constr(&R, "R", 3, 7, Rowws, Normal, True); for (Row = 1; Row <= 3; Row++) { M_SetLen(&R, Row, 3); M_SetEntry(&R, Row, 0, 2 * Row - 1, 0.5); M_SetEntry(&R, Row, 1, 2 * Row, 1.0); M_SetEntry(&R, Row, 2, 2 * Row + 1, 0.5); } ... M_Destr(&R);

Tomas Skalicky (skalicky@msmfs1.mw.tu-dresden.de)