Skip to content

Commit

Permalink
Removed size function for choices
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gecode.org/srv/gecode/svn/doc/trunk@15729 64335634-5103-0410-b293-fc3d331e086d
  • Loading branch information
Christian Schulte committed May 18, 2017
1 parent 3374fb3 commit 0191802
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 32 deletions.
9 changes: 0 additions & 9 deletions b-advanced.tex.in
Expand Up @@ -260,9 +260,6 @@ protected:
PosVal(const AssignMin& b, int p, int v)
: Choice(b,1), pos(p), val(v) {}
\begin{litblock}{anonymous}
virtual size_t size(void) const {
return sizeof(*this);
}
virtual void archive(Archive& e) const {
Choice::archive(e);
e << pos << val;
Expand Down Expand Up @@ -349,9 +346,6 @@ protected:
int pos; int val;
PosVal(const NoneMin& b, int p, int v)
: Choice(b,2), pos(p), val(v) {}
virtual size_t size(void) const {
return sizeof(*this);
}
virtual void archive(Archive& e) const {
Choice::archive(e);
e << pos << val;
Expand Down Expand Up @@ -490,9 +484,6 @@ protected:
int pos; int val;
PosVal(const NoneMin& b, int p, int v)
: Choice(b,2), pos(p), val(v) {}
virtual size_t size(void) const {
return sizeof(*this);
}
virtual void archive(Archive& e) const {
Choice::archive(e);
e << pos << val;
Expand Down
19 changes: 2 additions & 17 deletions b-started.tex.in
Expand Up @@ -234,12 +234,7 @@ integer value \?n?. When the brancher's \?commit()? function is
executed, the brancher provides the view array \?x? (the part
that is specific to a space) and the choice provides the position
$i$ and the value \?n? (the parts that are space-independent).

A choice must inherit from the class \gecoderef[class]{Choice}
and needs to implement a single virtual member function \?size()?
which returns the size (of type \?size_t?) of the choice. This
function can be used by a search engine to compute the amount of
memory allocated by a choice (this can be useful for statistics).
A choice must inherit from the class \gecoderef[class]{Choice}.

\paragraph{Even more on (archives of) choices.}

Expand Down Expand Up @@ -380,8 +375,7 @@ value as integers as follows:
The constructor of \?PosVal? uses the constructor of \?Choice? for
initialization, where both the brancher \?b? and the number of
alternatives of the choice (\?2? for \?PosVal?) are passed as
arguments. The \?size()? function just returns the size of a
\?PosVal? object. The \?archive()? function calls \?Choice::archive()? and then writes the position and value to the archive.
arguments. The \?archive()? function calls \?Choice::archive()? and then writes the position and value to the archive.

The \?choice(Space& home)? member function of the brancher is called directly (by the
\?choice(Space& home)? function of a space) after the \?status()?
Expand Down Expand Up @@ -531,9 +525,6 @@ protected:
int pos; int val;
PosVal(const NoneMin& b, int p, int v)
: Choice(b,2), pos(p), val(v) {}
virtual size_t size(void) const {
return sizeof(*this);
}
virtual void archive(Archive& e) const {
Choice::archive(e);
e << pos << val;
Expand Down Expand Up @@ -630,9 +621,6 @@ protected:
int pos; int val;
PosVal(const NoneMin& b, int p, int v)
: Choice(b,2), pos(p), val(v) {}
virtual size_t size(void) const {
return sizeof(*this);
}
virtual void archive(Archive& e) const {
Choice::archive(e);
e << pos << val;
Expand Down Expand Up @@ -720,9 +708,6 @@ protected:
int pos; int val;
PosVal(const SizeMin& b, int p, int v)
: Choice(b,2), pos(p), val(v) {}
virtual size_t size(void) const {
return sizeof(*this);
}
virtual void archive(Archive& e) const {
Choice::archive(e);
e << pos << val;
Expand Down
3 changes: 0 additions & 3 deletions c-bin-packing.tex.in
Expand Up @@ -938,9 +938,6 @@ protected:
for (int k=0; k<n_same; k++)
same[k] = s[k];
}
virtual size_t size(void) const {
return sizeof(Choice) + sizeof(int) * n_same;
}
virtual ~Choice(void) {
heap.free<int>(same,n_same);
}
Expand Down
3 changes: 0 additions & 3 deletions c-knights.tex.in
Expand Up @@ -237,9 +237,6 @@ protected:
int pos; int val;
PosVal(const Warnsdorff& b, int p, int v)
: Choice(b,2), pos(p), val(v) {}
virtual size_t size(void) const {
return sizeof(Choice);
}
virtual void archive(Archive& e) const {
Choice::archive(e);
e << pos << val;
Expand Down

0 comments on commit 0191802

Please sign in to comment.