invert44.c:


/* invert33.c - program to invert 3x3 matrices.
 * © Copyright 1999, by John Halleck
 * All rights reserved.
 */
/* Version of August 16th, 1999 */

#include <stdio.h>
 /* We have to print status messages  */

#include "errors.h"
 /* We have to print final status messages */

#include "matdebug.h"
 /* The matrix debugging routines would be handy */

#include "qinv.h"
 /* And we need, of course, the routines we were testing. */


static double final[4][4], given[4][4], working[4][4];

int main() {
  int status;
  printf ("non-singular 4 by 4 matrix to invert:\n");
  scanf ("%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf",
          &given[0][0],&given[0][1],&given[0][2],&given[0][3],
          &given[1][0],&given[1][1],&given[1][2],&given[1][3],
          &given[2][0],&given[2][1],&given[2][2],&given[2][3],
          &given[3][0],&given[3][1],&given[3][2],&given[3][3]
        );
  matprint ("Inverting:", 4, 4, given);
  if ((status = invns (4, final, given, working))) {
     printf ("call failed...\n");
     printerror (status);
     return status;
  } 
  matprint ("Inverse:", 4, 4, final);

  return 0;
}

Go to ...


This page is http://www.cc.utah.edu/~nahaj/cave/survey/code/c/invert44.c.html
© Copyright 2000 by John Halleck, All Rights Reserved.
This snapshot was last modified on August 23rd, 2000
And the underlying file was last modified on May 11th, 2000