ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rmatrix.h
(Generate patch)

Comparing ray/src/util/rmatrix.h (file contents):
Revision 2.1 by greg, Sat May 31 05:02:37 2014 UTC vs.
Revision 2.3 by greg, Fri Aug 1 23:37:24 2014 UTC

# Line 15 | Line 15 | extern "C" {
15   /* General plane-ordered component matrix */
16   typedef struct {
17          int     nrows, ncols, ncomp;
18 +        char    *info;
19          double  mtx[1];                 /* extends struct */
20   } RMATRIX;
21  
22 < #define rmx_indx(rm,r,c,i)      (((i)*(rm)->nrows+(r))*(rm)->ncols+(c))
22 > #define rmx_lval(rm,r,c,i)      (rm)->mtx[((i)*(rm)->nrows+(r))*(rm)->ncols+(c)]
23  
23 #define rmx_lval(rm,r,c,i)      (rm)->mtx[rmx_indx(rm,r,c,i)]
24
24   #define rmx_free(rm)            free(rm)
25  
26   /* Allocate a nr x nc matrix with n components */
# Line 30 | Line 29 | extern RMATRIX *rmx_alloc(int nr, int nc, int n);
29   /* Load matrix from supported file type */
30   extern RMATRIX  *rmx_load(const char *fname);
31  
32 + /* Append header information associated with matrix data */
33 + extern int      rmx_addinfo(RMATRIX *rm, const char *info);
34 +
35   /* Write matrix to file type indicated by dt */
36   extern long     rmx_write(const RMATRIX *rm, int dtype, FILE *fp);
37  
# Line 39 | Line 41 | extern RMATRIX *rmx_identity(int dim, int n);
41   /* Duplicate the given matrix */
42   extern RMATRIX  *rmx_copy(const RMATRIX *rm);
43  
44 < /* Swap rows and columns in the given matrix in situ */
45 < extern int      rmx_transpose(RMATRIX *rm);
44 > /* Allocate and assign transposed matrix */
45 > extern RMATRIX  *rmx_transpose(const RMATRIX *rm);
46  
47   /* Multiply (concatenate) two matrices and allocate the result */
48   extern RMATRIX  *rmx_multiply(const RMATRIX *m1, const RMATRIX *m2);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines