Linear Algebra and the C Language/a0jc


Install and compile this file in your working directory.

/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
double  **X_c_r_reverse_order_mR(
double **U,
double **V
)
{
int c;

    for(c=C1; c<U[C_SIZE][C0]; c++)

            V[R1][csize_R(V)+C1-c] = U[R1][c];
return(V);
}
/* ------------------------------------ */
/* ------------------------------------ */
void fun(int c)
{
double **U   = r_mR(i_mR(R1,c),9);
double **V   =      i_mR(R1,c)   ;	

  clrscrn();
  printf(" U:");
  p_mR(U, S4,P0,C10);
  printf(" V: Copy U in reverse order :");
  p_mR(c_r_reverse_order_mR(U,V), S4,P0,C10);
  
  f_mR(U);
  f_mR(V);   
}
/* ------------------------------------ */
int main(void)
{
time_t t;

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

  while(stop_w());       

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Copy the row vector U in reverse order.

Screen output example:

                                                                                       
 U:
  +2   +3   +9   +8   +5 

 V: Copy U in reverse order :
  +5   +8   +9   +3   +2 


 Press   return to continue
 Press X return to stop