ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/invmat4.c
(Generate patch)

Comparing ray/src/common/invmat4.c (file contents):
Revision 2.1 by greg, Tue Apr 12 15:20:48 1994 UTC vs.
Revision 2.3 by greg, Tue Feb 25 02:47:21 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1994 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * invmat4 - computes the inverse of mat into inverse.  Returns 1
6   * if there exists an inverse, 0 otherwise.  It uses Gaussian Elimination
7   * method.
8   */
9  
10 + #include "copyright.h"
11 +
12   #include "mat4.h"
13  
14  
# Line 18 | Line 17 | static char SCCSid[] = "$SunId$ LBL";
17   #define SWAP(a,b,t) (t=a,a=b,b=t)
18  
19  
20 < invmat4(inverse,mat)
20 > int
21 > invmat4(inverse, mat)
22   MAT4  inverse, mat;
23   {
24          MAT4  m4tmp;
# Line 27 | Line 27 | MAT4  inverse, mat;
27  
28          copymat4(m4tmp, mat);
29                                          /* set inverse to identity */
30 <        for (i = 0; i < 4; i++)
31 <                for (j = 0; j < 4; j++)
32 <                        inverse[i][j] = i==j ? 1.0 : 0.0;
30 >        setident4(inverse);
31  
32          for(i = 0; i < 4; i++) {
33                  /* Look for row with largest pivot and swap rows */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines