CycloBranch
cBricksDatabase.h File Reference

The database of building blocks. More...

#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include "core/utilities.h"
#include "core/cBrick.h"
#include "core/cSummaryFormula.h"

Go to the source code of this file.

Classes

class  cBricksDatabase
 The class representing a database of building blocks (bricks). More...
 

Functions

bool compareBrickMasses (const cBrick &a, const cBrick &b)
 Compare masses of two bricks. More...
 
void getNameOfCompositionFromIntVector (string &composition, vector< int > &combarray)
 Convert vector of ids of bricks into a string. More...
 
string & getReversedNameOfCompositionFromStringVector (string &composition, vector< string > &stringcomposition)
 Convert vector of ids of bricks into a string having reversed ids of bricks. More...
 
void generateBricksPermutations (vector< string > &bricks, vector< string > &currentpermutation, vector< string > &permutations)
 Generate permutations of bricks. More...
 

Detailed Description

The database of building blocks.

Function Documentation

◆ compareBrickMasses()

bool compareBrickMasses ( const cBrick a,
const cBrick b 
)

Compare masses of two bricks.

Parameters
afirst brick
bsecond brick
Return values
booltrue if the mass of a is less than the mass of b

◆ generateBricksPermutations()

void generateBricksPermutations ( vector< string > &  bricks,
vector< string > &  currentpermutation,
vector< string > &  permutations 
)

Generate permutations of bricks.

Parameters
bricksreference to an input vector of strings (ids of bricks)
currentpermutationreference to an empty vector of strings (auxiliary parameter)
permutationsreference to an empty output vector of strings where the result will be stored

◆ getNameOfCompositionFromIntVector()

void getNameOfCompositionFromIntVector ( string &  composition,
vector< int > &  combarray 
)

Convert vector of ids of bricks into a string.

Parameters
compositionreference to a string where ids of bricks separated by '-' will be stored
combarrayreference to an input integer vector of ids of bricks

◆ getReversedNameOfCompositionFromStringVector()

string & getReversedNameOfCompositionFromStringVector ( string &  composition,
vector< string > &  stringcomposition 
)

Convert vector of ids of bricks into a string having reversed ids of bricks.

Parameters
compositionreference to a string where ids of bricks separated by '-' will be stored
stringcompositionreference to an input string vector of ids of bricks
Return values
stringreference to a string where ids of bricks separated by '-' will be stored