#include "datamat.h"
#include "block.h"

static char *compblkcdid ="$Id: comp_blkcd.c,v 1.2 1996/12/30 23:12:37 galway Exp $";

/*****************************************************************/
/*  

    comp_blkcd.c

    Copyright (C) 2004  Lionel A. Galway

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    For a copy of the GNU General Public License write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA




    Computes the block codes for a block and places the result in the
    block data structure.

    L. Galway 30-DEC-1996 */
/*****************************************************************/

extern int col_mode();

void comp_blkcd(d,blk)
struct datamat *d;struct block *blk;
{
	int i;
	for (i=0;i<blk->NC;i++) {
		if (blk->icol[i]==1)
			blk->blkcd[i]=col_mode(i,d,blk);
		else
			blk->blkcd[i]=0; /* Should only pay attention
					    to blkcd if icol[i]==1 */
	};
	return;
}
