SMACC2
Loading...
Searching...
No Matches
cl_rgb::anonymous_namespace{colour.cpp} Namespace Reference

Functions

void assign (const std::vector< std::vector< double > > &cost, size_t name, double sum, std::vector< int > &current, std::vector< bool > &used, double &bestSum, std::vector< int > &best)
 

Function Documentation

◆ assign()

void cl_rgb::anonymous_namespace{colour.cpp}::assign ( const std::vector< std::vector< double > > & cost,
size_t name,
double sum,
std::vector< int > & current,
std::vector< bool > & used,
double & bestSum,
std::vector< int > & best )

Definition at line 81 of file colour.cpp.

84{
85 if (sum >= bestSum)
86 {
87 return;
88 }
89 if (name == cost.size())
90 {
91 bestSum = sum;
92 best = current;
93 return;
94 }
95 for (size_t i = 0; i < used.size(); ++i)
96 {
97 if (!used[i])
98 {
99 used[i] = true;
100 current[name] = static_cast<int>(i);
101 assign(cost, name + 1, sum + cost[name][i], current, used, bestSum, best);
102 used[i] = false;
103 }
104 }
105}

References assign().

Referenced by assign().

Here is the call graph for this function:
Here is the caller graph for this function: