I'm trying to compile the puzzle 8 given in this link
http://www.cs.rpi.edu/~beevek/research/astar_bgl04.pdf
using astar_search_no_init()
but I get this error "error C2106: '=' : left operand must be l-value"
I'm using VS2010. Can someone please help me
Here is my entire code
#include<boost/graph/adjacency_list.hpp>
#include<boost/graph/astar_search.hpp>
#include<iostream>
#include<vector>
#include<list>
using namespace std;
using namespace boost;
class puzzle_state_t: public vector<int>
{
public:
int m_row,m_col; // row and columns
puzzle_state_t(){}
puzzle_state_t(int r,int c): vector<int>(r*c),m_row(r),m_col(c){}
//another ctor with some iterator
template<typename IteratorType>
puzzle_state_t(int r,int c,IteratorType beg,IteratorType en):
vector<int>(beg,en)m_row(r),m_col(c){}
//find the cell in the vector
// rows are numbered 0,1,2
// cols are numbered 0,1,2
inline int cell(int r, int c) const
{
return r*m_col+c; //gives the index of vector
}
//get value of a cell
inline int get(int r, int c) const
{
int index= cell(r,c);
return operator[] (index);// returns value
}
//move between two cells
inline void move(int i,int j)
{
int tmp=operator[] (j);
operator[](j)=operator[](i);
operator[](i)=tmp;
}
//find coordinates of an offset
inline void coords(int i, int &r, int &c) const
{
r=i/m_col;
c=i%m_col;
}
friend ostream& operator <<(ostream &out, const puzzle_state_t &p)
{
for(int i = 0; i < p.m_row; ++i)
{
for(int j = 0; j < p.m_col; ++j)
{
if(p.get(i, j) > 0)
cout << p.get(i, j)<<"\t" ;
else
cout << "-"<<"\t";
}
cout << endl;
}
return out;
}
};
//1. find out the cell with zero
void generate_children(const puzzle_state_t &p, list
On Wed, 20 Jul 2011, anilpanicker wrote:
I'm trying to compile the puzzle 8 given in this link
http://www.cs.rpi.edu/~beevek/research/astar_bgl04.pdf
using astar_search_no_init()
but I get this error "error C2106: '=' : left operand must be l-value" I'm using VS2010. Can someone please help me
What is the full error message you get, including the instantiation stack? Which version of Boost are you using? -- Jeremiah Willcock
I use boost 1.46.1
The full error code is too long, so I did not put it. It looks like color
map needs to know the number of vertices (so expecting a vector):
The full error message is here
------ Build started: Project: implicit_astar, Configuration: Debug Win32
------
1> implicit_astar_test1.cpp
1>c:\program files
(x86)\boost\boost_1_46_1\boost\property_map\property_map.hpp(361): error
C2106: '=' : left operand must be l-value
1> c:\program files
(x86)\boost\boost_1_46_1\boost\graph\breadth_first_search.hpp(72) : see
reference to function template instantiation 'void
boost::put
On Wed, 20 Jul 2011, anilpanicker wrote:
I'm trying to compile the puzzle 8 given in this link
http://www.cs.rpi.edu/~beevek/**research/astar_bgl04.pdfhttp://www.cs.rpi.edu/~beevek/research/astar_bgl04.pdf
using astar_search_no_init()
but I get this error "error C2106: '=' : left operand must be l-value" I'm using VS2010. Can someone please help me
What is the full error message you get, including the instantiation stack? Which version of Boost are you using?
-- Jeremiah Willcock ______________________________**_________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/**mailman/listinfo.cgi/boost-**usershttp://lists.boost.org/mailman/listinfo.cgi/boost-users
On Wed, 20 Jul 2011, Anil Ramapanicker wrote:
I use boost 1.46.1 The full error code is too long, so I did not put it. It looks like color map needs to know the number of vertices (so expecting a vector):
I tried to compile your code, and it has many problems. Is this the first error message you get out of it? Is there a newer version of the code for me to try? -- Jeremiah Willcock
participants (3)
-
Anil Ramapanicker
-
anilpanicker
-
Jeremiah Willcock