Table of Contents

## Name

im_matinv, im_matmul, im_mattrn - matrix operations on DOUBLEMASKs

## Synopsis

#include <vips/vips.h>

DOUBLEMASK *im_matinv( in, name )
DOUBLEMASK *in;
char *name;

DOUBLEMASK *im_matmul( in1, in2, name )
DOUBLEMASK *in1, *in2;
char *name;

DOUBLEMASK *im_matcat( in1, in2, name )
DOUBLEMASK *in1, *in2;
char *name;

DOUBLEMASK *im_mattrn( in, name )
DOUBLEMASK *in;
char *name;

## Description

These functions treat DOUBLEMASKs as matricies, performing some of the basics of matrix algebra on them. Code for im_matinv was taken from Numerical Recipies in C, thanks!

There should be more matrix functions: those implemeneted are just sufficient for the Gallery's calibration routines. im_matadd, im_matidentity should really be added.

None of these functions damage their arguments.

im_matinv() inverts DOUBLEMASK in , returning a new DOUBLEMASK, called name , which contains the inverse of in. If no inverse exists. NULL is returned and im_errorstring set to a diagnostic message.

im_matmul() multiples the matrices held in in1 and in2, returning their product in a matrix called name.

im_matcat() returns a new matrix formed by appending matrix in2 to the end of matrix in1. The two matricies must be the same width. It is useful for combining several im_measure()s into a single matrix.

im_mattrn() transposes matrix in, returning the transpose in new matrix called name.

## Return Value

The functions returns a new DOUBLEMASK on sucess, and NULL on failure.

## See Also

im_create_dmask(3) , im_measure(3) , etc.

## Copyright

National Gallery, 1992

## Author

J. Cupitt

Table of Contents

- Name
- Synopsis
- Description
- Return Value
- SeeAlso
- Copyright
- Author