Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #6255

Re: Designing a suite of algorithms in C++

Path csiph.com!aioe.org!.POSTED!not-for-mail
From Kaz Kylheku <330-706-9395@kylheku.com>
Newsgroups comp.programming
Subject Re: Designing a suite of algorithms in C++
Date Mon, 1 Feb 2016 23:24:53 +0000 (UTC)
Organization Aioe.org NNTP Server
Lines 23
Message-ID <20160201151941.461@kylheku.com> (permalink)
References <2df6fc12-e6c9-4f5b-bdb7-21e35a57edbb@googlegroups.com>
NNTP-Posting-Host OGJi3KNpFOhM58UHZwXj0w.user.gioia.aioe.org
X-Complaints-To abuse@aioe.org
User-Agent slrn/pre1.0.0-18 (Linux)
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.programming:6255

Show key headers only | View raw


On 2016-02-01, Paul <pepstein5@gmail.com> wrote:
> class Algorithm{ 
>
> public: 
> Algorithm(some parameters); 
> virtual void findSolution() = 0; 
> virtual ~Algorithm()
> {}
> }; 

This interface only supports algorithms that either find a solution, for
any combination of parameters, or else do not terminate.

Your findSolution function has no way to indicate "I have stopped
searching, and found no solution".

If the function returns, since it has no return value, and the
interface has no useful member functions to inspect any state,
we can assume that the solution was found. So if the solution cannot
be found, the function doesn't return, right?

Not to mention that, quite often, when algorithms find a solution,
we want to know *what* that solution is, not only *that* it exists.

Back to comp.programming | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Designing a suite of algorithms in C++ Paul <pepstein5@gmail.com> - 2016-02-01 03:38 -0800
  Re: Designing a suite of algorithms in C++ Mark Carroll <mtbc@bcs.org> - 2016-02-01 12:04 +0000
    Re: Designing a suite of algorithms in C++ Paul <pepstein5@gmail.com> - 2016-02-01 05:52 -0800
      Re: Designing a suite of algorithms in C++ Mark Carroll <mtbc@bcs.org> - 2016-02-01 15:10 +0000
  Re: Designing a suite of algorithms in C++ Paul N <gw7rib@aol.com> - 2016-02-01 14:15 -0800
  Re: Designing a suite of algorithms in C++ BartC <bc@freeuk.com> - 2016-02-01 23:00 +0000
  Re: Designing a suite of algorithms in C++ Kaz Kylheku <330-706-9395@kylheku.com> - 2016-02-01 23:24 +0000

csiph-web