48 for ( iVar = 0; iVar < p->
nRows - p->
nFfs; iVar++ )
54 else if ( (p->
pMatrix[iCol1][iVar] == 1 && p->
pMatrix[iCol2][iVar] == 0) ||
74 int i, k, WeightBest = -100000, WeightCur, RetValue = -1;
75 for ( i = 1; i < p->
nCols-1; i++ )
76 for ( k = i+1; k < p->
nCols-1; k++ )
86 if ( WeightBest < WeightCur )
88 WeightBest = WeightCur;
89 RetValue = (i << 16) | k;
113 for ( i = 0; i < p->
nCols; i++ )
114 for ( k = 0; k < p->
nCols; k++ )
117 for ( i = 1; i < p->
nCols-1; i++ )
118 for ( k = i+1; k < p->
nCols-1; k++ )
136 int iVar, CountComm = 0, CountDiff = 0;
137 for ( iVar = 0; iVar < p->
nRows - p->
nFfs; iVar++ )
139 if ( p->
pMatrix[iCol1][iVar] == 1 && p->
pMatrix[iCol2][iVar] == 1 )
141 else if ( p->
pMatrix[iCol1][iVar] == 1 || p->
pMatrix[iCol2][iVar] == 1 )
150 return -1.0 * CountDiff / ( CountComm + CountDiff );
166 float WeightBest = -100000, WeightCur;
167 int i, k, RetValue = -1;
168 for ( i = 1; i < p->
nCols-1; i++ )
169 for ( k = i+1; k < p->
nCols-1; k++ )
176 if ( WeightBest < WeightCur )
178 WeightBest = WeightCur;
179 RetValue = (i << 16) | k;
202 for ( i = 0; i < p->
nCols; i++ )
203 for ( k = 0; k < p->
nCols; k++ )
206 for ( i = 1; i < p->
nCols-1; i++ )
207 for ( k = i+1; k < p->
nCols-1; k++ )
227 assert( iGrp1 >= 1 && iGrp1 < p->nCols - 1 );
228 assert( iGrp2 >= 1 && iGrp2 < p->nCols - 1 );
231 for ( iVar = 0; iVar < p->
nRows; iVar++ )
233 if ( p->
pMatrix[iGrp1][iVar] == 1 && p->
pMatrix[iGrp2][iVar] == 1 )
235 if ( p->
pMatrix[iGrp1][iVar] == 0 && p->
pMatrix[iGrp2][iVar] == 1 )
240 if ( p->
pMatrix[iGrp2][iVar] == 1 )
266 printf(
"Combining %d and %d\n", iCol1, iCol2 );
267 for ( iVar = 0; iVar < p->
nRows; iVar++ )
269 if ( p->
pMatrix[iCol1][iVar] == 0 && p->
pMatrix[iCol2][iVar] == 0 )
271 printf(
"%3d : %c%c\n", iVar,
272 p->
pMatrix[iCol1][iVar]?
'*':
' ',
273 p->
pMatrix[iCol2][iVar]?
'*':
' ' );
296 for ( i = 0; i < p->
nCols; i++ )
334 while ( RetValue > 0 );
342 while ( RetValue > 0 );
void Llb_MtrCombineSelectedColumns(Llb_Mtr_t *p, int iGrp1, int iGrp2)
void Llb_MtrVerifyMatrix(Llb_Mtr_t *p)
void Llb_ManClusterOne(Llb_Mtr_t *p, int iCol1, int iCol2)
float Llb_ManComputeCommonAttr(Llb_Mtr_t *p, int iCol1, int iCol2)
float ** Llb_ManComputeQuant(Llb_Mtr_t *p)
float ** Llb_ManComputeAttr(Llb_Mtr_t *p)
ABC_NAMESPACE_IMPL_START int Llb_ManComputeCommonQuant(Llb_Mtr_t *p, int iCol1, int iCol2)
DECLARATIONS ///.
void Llb_ManClusterCompress(Llb_Mtr_t *p)
int Llb_ManComputeBestAttr(Llb_Mtr_t *p)
Llb_Grp_t * Llb_ManGroupsCombine(Llb_Grp_t *p1, Llb_Grp_t *p2)
void Llb_ManCluster(Llb_Mtr_t *p)
#define ABC_NAMESPACE_IMPL_END
int Llb_ManComputeBestQuant(Llb_Mtr_t *p)
#define ABC_NAMESPACE_IMPL_START