\hypertarget{bag_8cpp}{
\section{bag.cpp File Reference}
\label{bag_8cpp}\index{bag.cpp@{bag.cpp}}
}
{\tt \#include \char`\"{}bag.h\char`\"{}}\par
{\tt \#include $<$bdd.h$>$}\par
{\tt \#include $<$iostream$>$}\par
{\tt \#include $<$bitset$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
double \hyperlink{bag_8cpp_8eadf539bb12a0a7a14a3f2e3622fa3f}{getOcc} (bdd feature, bdd family)
\item 
bdd \hyperlink{bag_8cpp_40aa42d54db14cc0da32115e3e32a5d2}{setOcc} (int feature, int occ, bdd \&family)
\item 
bdd \hyperlink{bag_8cpp_64226930435fc389e056387286ccaa5f}{bagUnion} (bdd \hyperlink{families_8h_671b697a0da7ec58b60d4de750d6fa0f}{b1}, bdd b2)
\item 
bdd \hyperlink{bag_8cpp_73d038f22c3bac9ede0a83f6756886d7}{bagIntersection} (bdd \hyperlink{families_8h_671b697a0da7ec58b60d4de750d6fa0f}{b1}, bdd b2)
\item 
bool \hyperlink{bag_8cpp_1e57209d52799cf39e577ebe803fab7f}{bagIsMember} (bdd feature, bdd family)
\item 
bdd \hyperlink{bag_8cpp_7a44a205dd8b7e456efc5f3829861c15}{bagComplement} (bdd family)
\item 
void \hyperlink{bag_8cpp_d5763698dde1c175a23e54cf8bc54ce3}{bagInsert} (bdd feature, bdd \&family)
\item 
void \hyperlink{bag_8cpp_eb54ef0e81c58c6acb0c26d382079ca1}{bagRemove} (bdd feature, bdd \&family)
\item 
bool \hyperlink{bag_8cpp_917b1402e552e81485df6bbd602300f8}{bagIsEmpty} (bdd family)
\item 
void \hyperlink{bag_8cpp_27fa89fd907e30c12079e28a08afbdc5}{bagEnumerate} (bdd family)
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
bitset$<$ 3 $>$ \hyperlink{bag_8cpp_28e3028f7d7bb02072fcebb1079efd2e}{bs}
\item 
bdd \hyperlink{bag_8cpp_2e4dc98441ab4aafadc22447ee08ea1b}{temp1}
\end{CompactItemize}


\subsection{Function Documentation}
\hypertarget{bag_8cpp_7a44a205dd8b7e456efc5f3829861c15}{
\index{bag.cpp@{bag.cpp}!bagComplement@{bagComplement}}
\index{bagComplement@{bagComplement}!bag.cpp@{bag.cpp}}
\subsubsection[{bagComplement}]{\setlength{\rightskip}{0pt plus 5cm}bdd bagComplement (bdd {\em family})}}
\label{bag_8cpp_7a44a205dd8b7e456efc5f3829861c15}


This function returns the bag complement of a given bag, family. There is theoritically no bag complement, but we can se our own. One example is to define a maximum number of occurances. \hypertarget{bag_8cpp_27fa89fd907e30c12079e28a08afbdc5}{
\index{bag.cpp@{bag.cpp}!bagEnumerate@{bagEnumerate}}
\index{bagEnumerate@{bagEnumerate}!bag.cpp@{bag.cpp}}
\subsubsection[{bagEnumerate}]{\setlength{\rightskip}{0pt plus 5cm}void bagEnumerate (bdd {\em family})}}
\label{bag_8cpp_27fa89fd907e30c12079e28a08afbdc5}


This functions displays the content of a given bag, family. The format is like in this example: \{(1,3),(2,5)\}. This is element 1 of 3 occurances and element 2 of 5 occurances. \hypertarget{bag_8cpp_d5763698dde1c175a23e54cf8bc54ce3}{
\index{bag.cpp@{bag.cpp}!bagInsert@{bagInsert}}
\index{bagInsert@{bagInsert}!bag.cpp@{bag.cpp}}
\subsubsection[{bagInsert}]{\setlength{\rightskip}{0pt plus 5cm}void bagInsert (bdd {\em feature}, \/  bdd \& {\em family})}}
\label{bag_8cpp_d5763698dde1c175a23e54cf8bc54ce3}


This function inserts an element, feature, into a bag, family. \hypertarget{bag_8cpp_73d038f22c3bac9ede0a83f6756886d7}{
\index{bag.cpp@{bag.cpp}!bagIntersection@{bagIntersection}}
\index{bagIntersection@{bagIntersection}!bag.cpp@{bag.cpp}}
\subsubsection[{bagIntersection}]{\setlength{\rightskip}{0pt plus 5cm}bdd bagIntersection (bdd {\em b1}, \/  bdd {\em b2})}}
\label{bag_8cpp_73d038f22c3bac9ede0a83f6756886d7}


This function returns the bag intersection between two given bags b1,b2. The the result will contain the elements that the given original bags contain. \hypertarget{bag_8cpp_917b1402e552e81485df6bbd602300f8}{
\index{bag.cpp@{bag.cpp}!bagIsEmpty@{bagIsEmpty}}
\index{bagIsEmpty@{bagIsEmpty}!bag.cpp@{bag.cpp}}
\subsubsection[{bagIsEmpty}]{\setlength{\rightskip}{0pt plus 5cm}bool bagIsEmpty (bdd {\em family})}}
\label{bag_8cpp_917b1402e552e81485df6bbd602300f8}


This function checks if a bag, family, is empty; if so, it returns true and false otherwise. \hypertarget{bag_8cpp_1e57209d52799cf39e577ebe803fab7f}{
\index{bag.cpp@{bag.cpp}!bagIsMember@{bagIsMember}}
\index{bagIsMember@{bagIsMember}!bag.cpp@{bag.cpp}}
\subsubsection[{bagIsMember}]{\setlength{\rightskip}{0pt plus 5cm}bool bagIsMember (bdd {\em feature}, \/  bdd {\em family})}}
\label{bag_8cpp_1e57209d52799cf39e577ebe803fab7f}


This function returns true if a given element, feature, is a member of a bag, family. It returns false otherwise. \hypertarget{bag_8cpp_eb54ef0e81c58c6acb0c26d382079ca1}{
\index{bag.cpp@{bag.cpp}!bagRemove@{bagRemove}}
\index{bagRemove@{bagRemove}!bag.cpp@{bag.cpp}}
\subsubsection[{bagRemove}]{\setlength{\rightskip}{0pt plus 5cm}void bagRemove (bdd {\em feature}, \/  bdd \& {\em family})}}
\label{bag_8cpp_eb54ef0e81c58c6acb0c26d382079ca1}


This function removes an element, feature, from a bag, family. \hypertarget{bag_8cpp_64226930435fc389e056387286ccaa5f}{
\index{bag.cpp@{bag.cpp}!bagUnion@{bagUnion}}
\index{bagUnion@{bagUnion}!bag.cpp@{bag.cpp}}
\subsubsection[{bagUnion}]{\setlength{\rightskip}{0pt plus 5cm}bdd bagUnion (bdd {\em b1}, \/  bdd {\em b2})}}
\label{bag_8cpp_64226930435fc389e056387286ccaa5f}


This functions unions two bags, b1 and b2, and returns the resultant bag containing the elements in the original two bags. \hypertarget{bag_8cpp_8eadf539bb12a0a7a14a3f2e3622fa3f}{
\index{bag.cpp@{bag.cpp}!getOcc@{getOcc}}
\index{getOcc@{getOcc}!bag.cpp@{bag.cpp}}
\subsubsection[{getOcc}]{\setlength{\rightskip}{0pt plus 5cm}double getOcc (bdd {\em feature}, \/  bdd {\em family})}}
\label{bag_8cpp_8eadf539bb12a0a7a14a3f2e3622fa3f}


Given an element, and a bag, this function get the number of occurances of that element in the bag. \hypertarget{bag_8cpp_40aa42d54db14cc0da32115e3e32a5d2}{
\index{bag.cpp@{bag.cpp}!setOcc@{setOcc}}
\index{setOcc@{setOcc}!bag.cpp@{bag.cpp}}
\subsubsection[{setOcc}]{\setlength{\rightskip}{0pt plus 5cm}bdd setOcc (int {\em feature}, \/  int {\em occ}, \/  bdd \& {\em family})}}
\label{bag_8cpp_40aa42d54db14cc0da32115e3e32a5d2}


Given an element number, the number of occurances and a bag, family, this funciton sets the number of occurances of the element in the family. The function returns a bag(bdd) with the occurance changed. 

\subsection{Variable Documentation}
\hypertarget{bag_8cpp_28e3028f7d7bb02072fcebb1079efd2e}{
\index{bag.cpp@{bag.cpp}!bs@{bs}}
\index{bs@{bs}!bag.cpp@{bag.cpp}}
\subsubsection[{bs}]{\setlength{\rightskip}{0pt plus 5cm}bitset$<$3$>$ {\bf bs}}}
\label{bag_8cpp_28e3028f7d7bb02072fcebb1079efd2e}


\hypertarget{bag_8cpp_2e4dc98441ab4aafadc22447ee08ea1b}{
\index{bag.cpp@{bag.cpp}!temp1@{temp1}}
\index{temp1@{temp1}!bag.cpp@{bag.cpp}}
\subsubsection[{temp1}]{\setlength{\rightskip}{0pt plus 5cm}bdd {\bf temp1}}}
\label{bag_8cpp_2e4dc98441ab4aafadc22447ee08ea1b}


