xref: /csrg-svn/old/lib2648/mat.c (revision 11478)
1*11478Sralph /*	mat.c	4.1	83/03/09	*/
2*11478Sralph /*
3*11478Sralph  * mat: retrieve the value in m[r, c].
4*11478Sralph  * rows and cols are the size of the matrix in all these routines.
5*11478Sralph  */
6*11478Sralph 
7*11478Sralph #include "bit.h"
8*11478Sralph 
9*11478Sralph int
10*11478Sralph mat(m, rows, cols, r, c)
11*11478Sralph register bitmat m;
12*11478Sralph register int c;
13*11478Sralph int rows, cols, r;
14*11478Sralph {
15*11478Sralph 	register int thisbyte;
16*11478Sralph 
17*11478Sralph 	thisbyte = m[r*((cols+7)>>3) + (c>>3)] & 0xff;
18*11478Sralph 	thisbyte &= 0x80 >> (c&7);
19*11478Sralph 	return (thisbyte != 0);
20*11478Sralph }
21