411 REFERENCE · Wikibooks
Linear Algebra and the C Language/a0ed
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
__NOTOC__
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
int main(void)
{
double **A = i_mR(R3,C5);
clrscrn();
printf(" A[%d][%d]:",rsize_R(A),csize_R(A));
p_mR(A, S4,P0,C7);
stop();
f_mR(A);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
The function i_mR(Rn,Cn); generates a matrix of Rn rows and Cn columns. The function f_mR(A); is used to return memory to the operating system.
The function rsize_R(A); gives the number of rows of matrix A, the function csize_R(A); gives the number of columns of matrix A.
When a function returns a number, like the function rsize_R(A); I use the suffix _R. When a function returns a matrix , I use the suffix _mR.
Screen output example:
A[3][5]:
+0 +0 +0 +0 +0
+0 +0 +0 +0 +0
+0 +0 +0 +0 +0
Press return to continue.