Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <limits.h>
  4. typedef struct matrix *Mat; // ADT: so it gets a capital letter to start.
  5. Mat MatConstruct(void); // Allocates memory and initializes a Mat.
  6. void MatDestruct(Mat mat); // Zeros all data and frees memory.
  7. void MatPrint(Mat mat); // Prints a matrix on the console.
  8. void MatInit(Mat mat,size_t mrows,size_t ncols); // Callocs a mxn array as a double *, sets dimensions.
  9. size_t MatGetRows(Mat mat); // Gets the number of rows.
  10. size_t MatGetCols(Mat mat); // Gets the nubmer of columns.
  11. double *MatGetArr(Mat mat); // Returns a double * of size rows*columns.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement