All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
Public Types | Public Member Functions | List of all members
paal::local_search::n_queens_solution_adapter< NQueensPositionsVector > Struct Template Reference

Adapts vector representing n queen problem to class able to efficiently compute gain of given move. More...

#include <n_queens_solution.hpp>

Public Types

typedef
boost::counting_iterator< int > 
QueensIterator
 

Public Member Functions

 n_queens_solution_adapter (NQueensPositionsVector &pos)
 constructor More...
 
QueensIterator begin () const
 begin of the queens positions' collection More...
 
QueensIterator end () const
 end of the queens positions' collection More...
 
void swap_queens (int xLeft, int xRight)
 swaps two queens positions More...
 
int get_num_attacing (int x, int y) const
 get number of queens attacing (x,y) position More...
 
int get_y (int x) const
 return y for xth queen More...
 
int obj_fun () const
 computes total number of conflicts on the board More...
 

Detailed Description

template<typename NQueensPositionsVector>
struct paal::local_search::n_queens_solution_adapter< NQueensPositionsVector >

Adapts vector representing n queen problem to class able to efficiently compute gain of given move.

Template Parameters
NQueensPositionsVector

Definition at line 35 of file n_queens_solution.hpp.

Constructor & Destructor Documentation

template<typename NQueensPositionsVector>
paal::local_search::n_queens_solution_adapter< NQueensPositionsVector >::n_queens_solution_adapter ( NQueensPositionsVector &  pos)
inline

constructor

Parameters
pos

Definition at line 43 of file n_queens_solution.hpp.

Member Function Documentation

template<typename NQueensPositionsVector>
QueensIterator paal::local_search::n_queens_solution_adapter< NQueensPositionsVector >::begin ( ) const
inline

begin of the queens positions' collection

Returns

Definition at line 58 of file n_queens_solution.hpp.

template<typename NQueensPositionsVector>
QueensIterator paal::local_search::n_queens_solution_adapter< NQueensPositionsVector >::end ( ) const
inline

end of the queens positions' collection

Returns

Definition at line 65 of file n_queens_solution.hpp.

template<typename NQueensPositionsVector>
int paal::local_search::n_queens_solution_adapter< NQueensPositionsVector >::get_num_attacing ( int  x,
int  y 
) const
inline

get number of queens attacing (x,y) position

Parameters
x
y
Returns

Definition at line 89 of file n_queens_solution.hpp.

template<typename NQueensPositionsVector>
int paal::local_search::n_queens_solution_adapter< NQueensPositionsVector >::get_y ( int  x) const
inline

return y for xth queen

Parameters
x
Returns

Definition at line 100 of file n_queens_solution.hpp.

template<typename NQueensPositionsVector>
int paal::local_search::n_queens_solution_adapter< NQueensPositionsVector >::obj_fun ( ) const
inline

computes total number of conflicts on the board

Returns

Definition at line 107 of file n_queens_solution.hpp.

template<typename NQueensPositionsVector>
void paal::local_search::n_queens_solution_adapter< NQueensPositionsVector >::swap_queens ( int  xLeft,
int  xRight 
)
inline

swaps two queens positions

Parameters
xLeft
xRight

Definition at line 75 of file n_queens_solution.hpp.


The documentation for this struct was generated from the following file: