Home > Mateda2.0 > otherfiles > FindListCliqAccCard.m

# FindListCliqAccCard

## PURPOSE

[ListCliqAccCard] = FindListCliqAccCard(totcliq,ListCliques,Card)

## SYNOPSIS

function[ListCliqAccCard] = FindListCliqAccCard(totcliq,ListCliques,Card)

## DESCRIPTION

     [ListCliqAccCard] = FindListCliqAccCard(totcliq,ListCliques,Card)
     FindListCliqAccCard calculates de accumulative cardinalities for all the cliques, and the dimension of the probability tables
                         All the information is saved ListCliqAccCard
     INPUTS:
     totcliq: Number of Cliques
     ListCliques: Structure containing each of the cliques
     Card: Cardinality of the variables

     Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)

## CROSS-REFERENCE INFORMATION

This function calls:

- FindAccCard [AccCard] = FindAccCard(length,Card)
- NumconvertCard [valindex] = NumconvertCard(num,length,AccCard)

This function is called by:

## SOURCE CODE

    0001 function[ListCliqAccCard] = FindListCliqAccCard(totcliq,ListCliques,Card)
    0002 % [ListCliqAccCard] = FindListCliqAccCard(totcliq,ListCliques,Card)
    0003 % FindListCliqAccCard calculates de accumulative cardinalities for all the cliques, and the dimension of the probability tables
    0004 %                     All the information is saved ListCliqAccCard
    0005 % INPUTS:
    0006 % totcliq: Number of Cliques
    0007 % ListCliques: Structure containing each of the cliques
    0008 % Card: Cardinality of the variables
    0009 %
    0010 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0011  ListCliqAccCard = zeros(size(ListCliques));
    0012      for i=1:totcliq,
    0013          sizecliq = ListCliques(i,1);
    0014          cliq = ListCliques(i,3:sizecliq+2);
    0015          AccCard = FindAccCard(sizecliq,Card(cliq));
    0016          ListCliqAccCard(i,1) =  NumconvertCard(Card(cliq)-1,sizecliq,AccCard)+1; % Size of the table for cliq1
    0017      ListCliqAccCard(i,2:sizecliq+1) =  AccCard;
    0018      end