| 20 |
|
double mtx[1]; /* extends struct */ |
| 21 |
|
} RMATRIX; |
| 22 |
|
|
| 23 |
< |
#define rmx_lval(rm,r,c,i) (rm)->mtx[(i)+(rm)->ncomp*((c)+(rm)->ncols*(r))] |
| 23 |
> |
#define rmx_lval(rm,r,c,i) (rm)->mtx[(i)+(rm)->ncomp*((c)+(size_t)(rm)->ncols*(r))] |
| 24 |
|
|
| 25 |
|
/* Allocate a nr x nc matrix with n components */ |
| 26 |
|
extern RMATRIX *rmx_alloc(int nr, int nc, int n); |
| 51 |
|
|
| 52 |
|
/* Multiply (concatenate) two matrices and allocate the result */ |
| 53 |
|
extern RMATRIX *rmx_multiply(const RMATRIX *m1, const RMATRIX *m2); |
| 54 |
+ |
|
| 55 |
+ |
/* Element-wise multiplication (or division) of m2 into m1 */ |
| 56 |
+ |
extern int rmx_elemult(RMATRIX *m1, const RMATRIX *m2, int divide); |
| 57 |
|
|
| 58 |
|
/* Sum second matrix into first, applying scale factor beforehand */ |
| 59 |
|
extern int rmx_sum(RMATRIX *msum, const RMATRIX *madd, const double sf[]); |