PPL Assignment
IRM2015006
couple_utils.h File Reference
#include "../couples/couple.h"
#include "../boys/allboys.h"
#include "../girls/allgirls.h"
#include <algorithm>
#include "logger/logger.h"
Include dependency graph for couple_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::vector< CouplemakeCouples (std::vector< Boy * > boys, std::vector< Girl * > girls, Logger *logger)
 
std::vector< CouplemakeCouplesAlternatively (std::vector< Boy * > boys, std::vector< Girl * > girls, Logger *logger)
 
void performGifting (std::vector< Couple > *couples, std::vector< Gift > *giftlist, Logger *logger)
 
void performGifting2 (std::vector< Couple > *couples, std::vector< Gift > *giftlist, Logger *logger)
 
std::vector< CouplegetKHappiestCouples (std::vector< Couple > couples, int k)
 
std::vector< CouplegetKCompatibleCouples (std::vector< Couple > couples, int k)
 
std::vector< CouplegetKUnhappiestCouples (std::vector< Couple > couples, int k)
 
std::vector< CouplegetCouplesWithHappinessLessThan (std::vector< Couple >couples, int t)
 
void performBreakupAndPairAgain (std::vector< Couple >happyCouples, std::vector< Couple > *couples, std::vector< Boy * > *boys, std::vector< Girl * > *girls, Logger *logger)
 
void performBreakupOnHappinessAndPairAgain (std::vector< Couple > sadCouples, std::vector< Couple > *couples, std::vector< Boy * > *boys, std::vector< Girl * > *girls, int t, Logger *logger)
 

Function Documentation

std::vector<Couple> getCouplesWithHappinessLessThan ( std::vector< Couple couples,
int  t 
)

Find couples with happiness less than t Solver for question 6

Definition at line 178 of file couple_utils.h.

Here is the caller graph for this function:

std::vector<Couple> getKCompatibleCouples ( std::vector< Couple couples,
int  k 
)

Find the list of k most compatible couples from given list of couples
Returns the vector of compatible couples in descending order

Definition at line 157 of file couple_utils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector<Couple> getKHappiestCouples ( std::vector< Couple couples,
int  k 
)

Find the list of k happiest couples from given list of couples
Returns the vector of happiest couples in descending order

Definition at line 147 of file couple_utils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector<Couple> getKUnhappiestCouples ( std::vector< Couple couples,
int  k 
)

Find the list of k unhappiest couples from given list of couples
Returns the vector of happiest couples in descending order

Definition at line 167 of file couple_utils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector<Couple> makeCouples ( std::vector< Boy * >  boys,
std::vector< Girl * >  girls,
Logger logger 
)

Form couples from given list of boys and girls
Returns the vector of couples formed

Definition at line 14 of file couple_utils.h.

Here is the call graph for this function:

std::vector<Couple> makeCouplesAlternatively ( std::vector< Boy * >  boys,
std::vector< Girl * >  girls,
Logger logger 
)

Form couples from given list of boys and girls
Returns the vector of couples formed

Definition at line 58 of file couple_utils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void performBreakupAndPairAgain ( std::vector< Couple happyCouples,
std::vector< Couple > *  couples,
std::vector< Boy * > *  boys,
std::vector< Girl * > *  girls,
Logger logger 
)

Perform breakup of given couples and assign the girls new boyfriends Solver for 4

Definition at line 193 of file couple_utils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void performBreakupOnHappinessAndPairAgain ( std::vector< Couple sadCouples,
std::vector< Couple > *  couples,
std::vector< Boy * > *  boys,
std::vector< Girl * > *  girls,
int  t,
Logger logger 
)

Perform breakup of couples with happiness less that t and assign the girls new boyfriends Solver for 4

Definition at line 252 of file couple_utils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void performGifting ( std::vector< Couple > *  couples,
std::vector< Gift > *  giftlist,
Logger logger 
)

Perform gifting for all these couples

Definition at line 129 of file couple_utils.h.

void performGifting2 ( std::vector< Couple > *  couples,
std::vector< Gift > *  giftlist,
Logger logger 
)

Perform gifting for all these couples : second algorithm Solver for ques 8

Definition at line 138 of file couple_utils.h.

Here is the caller graph for this function: