[gecode-users] Help -- about Gecode::Space::operator new

Christian Schulte cschulte at kth.se
Thu Aug 27 13:19:36 CEST 2009


Hi, if you can’t give us the code we can’t help.

 

Actually, this is the C++ new operator (just defined for this class). So
there will be a bug somewhere in your program, almost 100% sure.

 

Christian

 

--

Christian Schulte, www.ict.kth.se/~cschulte/

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Kayler Yao
Sent: Thursday, August 27, 2009 9:51 AM
To: Javier Andrés Mena Zapata
Cc: users at gecode.org
Subject: Re: [gecode-users] Help -- about Gecode::Space::operator new

 

hi,

    There has only that error 

"projectdlg.cpp(198) : error C2660: 'Gecode::Space::operator new' : function
does not take 3 arguments"

    the error line is

" GenSolModel * m = new GenSolModel (temp);"

    Yeah,it may be so. i have to use another way ---"GenSolModel a(temp);
GenSolModel *m =&a;" to instead of it. Luckily, it can run OK. For the
reason of time, i will hang it for a while . I will find this bug and
uncover it to the sun in my free time. Thanks for your reply.

 

Kayler

2009/8/27 Javier Andrés Mena Zapata <javimena at gmail.com>

Hi,

Maybe you could send the COMPLETE error message, and copy EXACTLY the lines
that the which the compiler reports the error.  It may be a compiler bug or
something similar.

Best regards,

2009/8/26 Kayler Yao <risoay at gmail.com>

hi,

    The type of temp is Int. For the project is so large , i can't copy the
whole codes here.But when  i use another method  like code lines below , it
can run OK!

"               



 GenSolModel a(temp);

 GenSolModel *m =&a;

 

 DFS<GenSolModel> e(m);

 m = NULL;

 while(GenSolModel *s = e.next())
 {
  s->print();
  delete s;

  sum++;
 }
            



"

   This way to creat an object of the class GenSolModel is a feasible way.
But why the "New "way can't run OK. I doubt it may be the conflict error
between "C++ new" and "'Gecode::Space::operator new",but  why it can run ok
in other project, Maybe the answer is hidden in my project. It also a puzzle
to me. 

    Who have faced the similar question ? Wish to your reply.

    If everyone can give me a suggest , i will appreciate your help.

 

Kayler

 

2009/8/27 Christian Schulte <cschulte at kth.se> 

 

Hi, I think I need to see the full code to help. There must be something how
you call new (maybe the type of temp) that is the problem.

 

Christian

 

--

Christian Schulte, www.ict.kth.se/~cschulte/
<http://www.ict.kth.se/%7Ecschulte/> 

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Kayler Yao
Sent: Wednesday, August 26, 2009 4:04 PM
To: users at gecode.org
Subject: [gecode-users] Help -- about Gecode::Space::operator new

 

hi,

    I had a trouble in my project when i wrote a class  inheriting from
Class Space and run it with DFS. The error is

 

"error C2660: 'Gecode::Space::operator new' : function does not take 3
arguments"-------------------------happened in 

 

"

 GenSolModel * m = new GenSolModel
(temp);------------------------------------error line
 

 DFS<GenSolModel > e(m);

 delete m; 

 while (GenSolModel * s = e.next())
 {
  s->print(); 
  delete s; 
 }

"

       I have spent much time to find the reason but with no results. I had
written anther question class to test ,and it could run OK. I think that the
constructor of

this class didn't conflict with the class Space , but why came out this
error. Who can give me a thought to help me to find the answer?

    Look forward to your reply! 

 

note:

1.VS2008 + Gecode 3.1.0

2.

class GenSolModel: public Gecode::Space
{
protected:
   IntVarArray succ;

public:

   GenSolModel(int  data);

   GenSolModel(bool share, GenSolModel& s);

 ~GenSolModel();

 virtual Space *copy(bool share);

 void  print(void);

};

Kayler

 

_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users




-- 
Javier Andrés Mena Zapata
Cali - Colombia

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090827/5b8f5055/attachment.htm>


More information about the gecode-users mailing list