Linear Algebra and the C Language/a0hf


Install and compile this file in your working directory.

/* ------------------------------------ */
/*  Save as :      c00a.c               */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */    
void fun(int rc)
{
double **U   = r_mR(i_mR(R1,rc),9);
double **V   = r_mR(i_mR(rc,C1),9);	
double **A   =      i_mR(rc,rc);

  c_s_mR(U[R1][C1], V,R1,C1);
  
  clrscrn();
  
  rToeplitz_mR(U,V,A);
  
  printf(" A: Toeplitz matrix");
  p_mR(A, S4,P0,C10);

  f_mR(U);
  f_mR(V);   
  f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
  
  do
        fun(R6);

  while(stop_w());       

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Screen output example:

                                                                                       
 A: Toeplitz matrix
  -1   +4   +1   +4   +5   +6 
  -5   -1   +4   +1   +4   +5 
  +7   -5   -1   +4   +1   +4 
  +4   +7   -5   -1   +4   +1 
  +6   +4   +7   -5   -1   +4 
  +5   +6   +4   +7   -5   -1 


 Press   return to continue
 Press X return to stop