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.4 by greg, Sat Aug 2 17:10:43 2014 UTC vs.
Revision 2.10 by greg, Wed Aug 14 18:20:02 2019 UTC

# Line 15 | Line 15 | extern "C" {
15   /* General plane-ordered component matrix */
16   typedef struct {
17          int     nrows, ncols, ncomp;
18 <        int     dtype;
18 >        short   dtype;
19 >        short   swapin;
20          char    *info;
21          double  mtx[1];                 /* extends struct */
22   } RMATRIX;
23  
24 < #define rmx_lval(rm,r,c,i)      (rm)->mtx[((i)*(rm)->nrows+(r))*(rm)->ncols+(c)]
24 > #define rmx_lval(rm,r,c,i)      (rm)->mtx[(i)+(rm)->ncomp*((c)+(size_t)(rm)->ncols*(r))]
25  
26   /* Allocate a nr x nc matrix with n components */
27   extern RMATRIX  *rmx_alloc(int nr, int nc, int n);
# Line 31 | Line 32 | extern void    rmx_free(RMATRIX *rm);
32   /* Resolve data type based on two input types (returns 0 for mismatch) */
33   extern int      rmx_newtype(int dtyp1, int dtyp2);
34  
35 < /* Load matrix from supported file type */
36 < extern RMATRIX  *rmx_load(const char *fname);
35 > /* Load matrix from supported file type (NULL for stdin, '!' with command) */
36 > extern RMATRIX  *rmx_load(const char *inspec);
37  
38   /* Append header information associated with matrix data */
39   extern int      rmx_addinfo(RMATRIX *rm, const char *info);
40  
41   /* Write matrix to file type indicated by dtype */
42 < extern long     rmx_write(const RMATRIX *rm, int dtype, FILE *fp);
42 > extern int      rmx_write(const RMATRIX *rm, int dtype, FILE *fp);
43  
44   /* Allocate and assign square identity matrix with n components */
45   extern RMATRIX  *rmx_identity(int dim, int n);
# Line 51 | Line 52 | extern RMATRIX *rmx_transpose(const RMATRIX *rm);
52  
53   /* Multiply (concatenate) two matrices and allocate the result */
54   extern RMATRIX  *rmx_multiply(const RMATRIX *m1, const RMATRIX *m2);
55 +
56 + /* Element-wise multiplication (or division) of m2 into m1 */
57 + extern int      rmx_elemult(RMATRIX *m1, const RMATRIX *m2, int divide);
58  
59   /* Sum second matrix into first, applying scale factor beforehand */
60   extern int      rmx_sum(RMATRIX *msum, const RMATRIX *madd, const double sf[]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines