Fri Jul 26 20:02:35 2024
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2016-11-01

LEARN

2024-07-26 | 2024-06-26 | 2024-05-26 | 2024-04-26 | 2024-03-26 | 2024-02-26 | 2024-01-26 | 2023-12-26 | 2023-11-26 | 2023-10-26 | 2023-09-26 | 2023-08-26 | 2023-07-26 | 2023-06-26 | 2023-05-26 | 2023-04-26 | 2023-03-26 | 2023-02-26 | 2023-01-26 | 2022-12-26 | 2022-11-26 | 2022-10-26 | 2022-09-26 | 2022-08-26 | 2022-07-26 | 2022-06-26 | 2022-05-26 | 2022-04-26 | 2022-03-26 | 2022-02-26 | 2022-01-26 | 2021-12-26 | 2021-11-26 | 2021-10-26 | 2021-09-26 | 2021-08-26 | 2021-07-26 | 2021-06-26 | 2021-05-26 | 2021-04-26 | 2021-03-26 | 2021-02-26 | 2021-01-26 | 2020-12-26 | 2020-11-26 | 2020-10-26 | 2020-09-26 | 2020-08-26 | 2020-07-26 | 2020-06-26 | 2020-05-26 | 2020-04-26 | 2020-03-26 | 2020-02-26 | 2020-01-26 | 2019-12-26 | 2019-11-26 | 2019-10-26 | 2019-09-26 | 2019-08-26 | 2019-07-26 | 2019-06-26 | 2019-05-26 | 2019-04-26 | 2019-03-26 | 2019-02-26 | 2019-01-26 | 2018-12-26 | 2018-11-26 | 2018-10-26 | 2018-09-26 | 2018-08-26 | 2018-07-26 | 2018-06-26 | 2018-05-26 | 2018-04-26 | 2018-03-26 | 2018-02-26 | 2018-01-26 | 2017-12-26 | 2017-11-26 | 2017-10-26 | 2017-09-26 | 2017-08-26 | 2017-07-26 | 2017-06-26 | 2017-05-26 | 2017-04-26 | 2017-03-26 | 2017-02-26 | 2017-01-26 | 2016-12-26 | 2016-11-26 | 2016-10-26 | 2016-09-26 | 2016-08-26 | 2016-07-26 | 2016-06-26 | 2016-05-26 | 2016-04-26 | 2016-03-26 | 2016-02-26 | 2016-01-26 | 2015-12-26 | 2015-11-26 | 2015-10-26 | 2015-09-26 | 2015-08-26 | 2015-07-26 | 2015-06-26 | 2015-05-26 | 2015-04-26 | 2015-03-26 | 2015-02-26 | 2015-01-26 | 2014-12-26 | 2014-11-26 | 2014-10-26

Key: Value:

Key: Value:

MESSAGE
DATE 2016-11-16
FROM Ruben Safir
SUBJECT Re: [Learn] Fwd: lost arguments
From learn-bounces-at-nylxs.com Wed Nov 16 03:30:59 2016
Return-Path:
X-Original-To: archive-at-mrbrklyn.com
Delivered-To: archive-at-mrbrklyn.com
Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82])
by mrbrklyn.com (Postfix) with ESMTP id 0BD4F161312;
Wed, 16 Nov 2016 03:30:59 -0500 (EST)
X-Original-To: learn-at-nylxs.com
Delivered-To: learn-at-nylxs.com
Received: from [10.0.0.62] (flatbush.mrbrklyn.com [10.0.0.62])
by mrbrklyn.com (Postfix) with ESMTP id 803E6160E77
for ; Wed, 16 Nov 2016 03:30:55 -0500 (EST)
To: learn-at-nylxs.com
References:
<8a84215c-3cd2-4a1f-832b-dd80f888e205-at-googlegroups.com>


From: Ruben Safir
Message-ID: <8c31dfa6-200a-977a-6d9e-7087f44eb696-at-mrbrklyn.com>
Date: Wed, 16 Nov 2016 03:30:55 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To:
Subject: Re: [Learn] Fwd: lost arguments
X-BeenThere: learn-at-nylxs.com
X-Mailman-Version: 2.1.17
Precedence: list
List-Id:
List-Unsubscribe: ,

List-Archive:
List-Post:
List-Help:
List-Subscribe: ,

Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
Errors-To: learn-bounces-at-nylxs.com
Sender: "Learn"


Check this out


std::reference_wrapper

C++

Utilities library

Function objects

std::reference_wrapper

Defined in header
=

template< class T >
class reference_wrapper;
(since C++11)
=


std::reference_wrapper is a class template that wraps a reference in a
copyable, assignable object. It is frequently used as a mechanism to
store references inside standard containers (like std::vector) which
cannot normally hold references.

Specifically, std::reference_wrapper is a CopyConstructible and
CopyAssignable wrapper around a reference to object or reference to
function of type T. Instances of std::reference_wrapper are objects
(they can be copied or stored in containers) but they are implicitly
convertible to T&, so that they can be used as arguments with the
functions that take the underlying type by reference.

Helper functions std::ref and std::cref are often used to generate
std::reference_wrapper objects.

std::reference_wrapper is also used to pass objects to std::bind or to
the constructor of std::thread by reference.

std::reference_wrapper is guaranteed to be TriviallyCopyable.
(since C++17)
Member types
type definition
type T
result_type(deprecated in C++17) The return type of T if T is a
function. Otherwise, not defined
argument_type(deprecated in C++17) 1) if T is a function or pointer to
function that takes one argument of type A1, then argument_type is A1.

2) if T is a pointer to member function of class T0 that takes no
arguments, then argument_type is T0*, possibly cv-qualified
3) if T is a class type with a member type T::argument_type, then
argument_type is an alias of that
first_argument_type(deprecated in C++17) 1) if T is a function or
pointer to function that takes two arguments of type s A1 and A2, then
first_argument_type is A1.

2) if T is a pointer to member function of class T0 that takes one
argument, then first_argument_type is T0*, possibly cv-qualified
3) if T is a class type with a member type T::first_argument_type, then
first_argument_type is an alias of that
second_argument_type(deprecated in C++17) 1) if T is a function or
pointer to function that takes two arguments of type s A1 and A2, then
second_argument_type is A2.

2) if T is a pointer to member function of class T0 that takes one
argument A1, then second_argument_type is A1, possibly cv-qualified
3) if T is a class type with a member type T::second_argument_type, then
second_argument_type is an alias of that
Member functions
(constructor)
stores a reference in a new std::reference_wrapper object
(public member function)
operator=3D
rebinds a std::reference_wrapper
(public member function)
getoperator T&
accesses the stored reference
(public member function)
operator()
calls the stored function
(public member function)
Possible implementation

template
class reference_wrapper {
public:
// types
typedef T type;

// construct/copy/destroy
reference_wrapper(T& ref) noexcept : _ptr(std::addressof(ref)) {}
reference_wrapper(T&&) =3D delete;
reference_wrapper(const reference_wrapper&) noexcept =3D default;

// assignment
reference_wrapper& operator=3D(const reference_wrapper& x) noexcept =3D
default;

// access
operator T& () const noexcept { return *_ptr; }
T& get() const noexcept { return *_ptr; }

template< class... ArgTypes >
typename std::result_of::type
operator() ( ArgTypes&&... args ) const {
return std::invoke(get(), std::forward(args)...);
}

private:
T* _ptr;
};

Example

Demonstrates the use of reference_wrapper as a container of references,
which makes it possible to access the same container using multiple indexes
Run this code

#include
#include
#include
#include
#include
#include
#include

int main()
{
std::list l(10);
std::iota(l.begin(), l.end(), -4);

std::vector> v(l.begin(), l.end());
// can't use shuffle on a list (requires random access), but can use
it on a vector
std::shuffle(v.begin(), v.end(), std::mt19937{std::random_device{}()});

std::cout << "Contents of the list: ";
for (int n : l) std::cout << n << ' '; std::cout << '\n';

std::cout << "Contents of the list, as seen through a shuffled
vector: ";
for (int i : v) std::cout << i << ' '; std::cout << '\n';

std::cout << "Doubling the values in the initial list...\n";
for (int& i : l) {
i *=3D 2;
}

std::cout << "Contents of the list, as seen through a shuffled
vector: ";
for (int i : v) std::cout << i << ' '; std::cout << '\n';
}

Possible output:

Contents of the list: -4 -3 -2 -1 0 1 2 3 4 5
Contents of the list, as seen through a shuffled vector: -1 2 -2 1 5 0 3
-3 -4 4
Doubling the values in the initial list...
Contents of the list, as seen through a shuffled vector: -2 4 -4 2 10 0
6 -6 -8 8

See also
refcref
(C++11)(C++11)
creates a std::reference_wrapper with a type deduced from its argument
(function template)
bind
(C++11)
binds one or more arguments to a function object
(function template)

On 11/09/2016 10:48 AM, ruben safir wrote:
> /*
> * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> *
> * Filename: nodes.h
> *
> * Description: description of phylogentic nodes as per =

> * Fitch and Sannkoff as describd by Felenstein
> *
> * Version: 1.0
> * Created: Nov 4 21:15:49 EDT 2016
> * Revision: none
> * Compiler: gcc
> *
> * Author: Ruben Safir,
> * Company: LIU Thesis =

> *
> * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> */
> #ifndef NODES_H
> #define NODES_H
> #include
> #include
> #include
> namespace tree {
> =

> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
> * Class NODE - =

> * Description - This is a node in the tree that must undergo parsimony e=
valuation
> * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
> */
> template
> class NODE{
> public:
> //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3DLIFECYCLE=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> /* Constructor */
> NODE( std::string xt, const unk &x , NODE *xcl=3D 0, NODE *x=
cr =3D 0, NODE *xp =3D 0 );
> //NODE( std::string xt, unk &x , NODE *xcl=3D 0, NODE *xcr =
=3D 0, NODE *xp =3D 0 );
> ~NODE();
> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D AC=
CESSORS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> //no need for inline when you are defineing functions within the class de=
finition
> std::string trait()const{
> return _trait;
> } =

> unk states()const{
> return _states;
> };
> NODE * cl()const{
> return _cl;
> };
> NODE * cr()const{
> return _cr;
> };
> NODE * p()const{
> return _p;
> };
> void states(const unk &x){
> _states =3D x;
> }
> void trait(std::string xt){
> _trait =3D xt; //With genetics this is a A C G T although it is just =
a label
> }
> void cl(NODE *xcl){ //This is the left child node in the tree
> _cl =3D xcl;
> }
> void cr(NODE *xcr){//This is the right node child node in the tree
> _cr =3D xcr;
> }
> void p(NODE *xp){//This is the parent node in the tree
> _p =3D xp;
> }
> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D MU=
TATORS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D OP=
ERATORS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> //void display(); =

> template
> friend std::ostream& operator<<(std::ostream& os, const T&);
> =

> template
> friend std::ostream& operator<<(std::ostream& os, const NODE &);
> =

> protected:
> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DA=
TA MEMBERS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> =

> =

> private:
> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DA=
TA MEMBERS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> std::string _trait;
> unk _states;
> NODE * _cl, * _cr, * _p;
> =

> =

> }; /* ----- end of template class NODE ----- */
> =

> template
> std::ostream& operator<<(std::ostream& os, const NODE& vec){
> =

> for( auto& y : vec.state() )
> os << y << std::endl;
> return os;
> }
> =

> template
> NODE::NODE( std::string xt, const unk &x, NODE *xcl , NODE=
*xcr, NODE *xp ){
> states(x);
> trait(xt);
> cl(xcl);
> cr(xcr);
> p(xp);
> std::cout << trait() << " node " << "has the following states =3D> " << =
std::endl;
> }
> =

> //template
> //NODE::NODE( std::string xt, unk &x, NODE *xcl , NODE *xc=
r, NODE *xp ){
> // states(x);
> // trait(xt);
> // cl(xcl);
> // cr(xcr);
> // p(xp);
> // std::cout << trait() << " node " << "has the following states =3D> " <=
< std::endl;
> //}
> =

> =

> template
> tree::NODE::~NODE(){
> }
> =

> /*
> * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> * Class: State
> * Description: This describes a possible individual state or charactor=
istic =

> * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> */
> template
> class state
> {
> public:
> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D LIFECY=
CLE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> /* constructor */
> //r is the minimum cost of a single state when compared to the child no=
des
> explicit state(std::string const xa, cost xr) =

> :_nam{xa}, _r{xr}
> {
> std::cout << "Building a state pair" << std::endl;
> std::cout << "nam =3D> " << nam() << "\tcost=3D> " << r() << std::end=
l;
> };
> =

> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ACCESS=
ORS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> std::string nam(){return _nam;};
> cost r(){return _r;};
> void r(cost b ){_r =3D b;}; =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D MUTATO=
RS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D OPERAT=
ORS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DATA M=
EMBERS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> protected:
> =

> private:
> std::string _nam;
> cost _r;
> =

> }; /* ----- end of class State ----- */
> =

> /*
> * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> * Class: Pstates
> * Description: vector of all possible states
> * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> */
> template
> class Pstates
> {
> public:
> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D LIFECY=
CLE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> /* constructor */
> Pstates (std::vector< state > x)
> : _vstate{x}
> {
> for( auto& y : _vstate)
> std::cout << y << std::endl;
> };
> =

> // Pstates()
> // : _vstate{0}
> // {};
> =

> ~Pstates (){}; /* destructor */
> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ACCESS=
ORS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> const std::vector< state >& vstate(){
> return _vstate;
> }
> void vstate(std::vector< state > in ){
> _vstate =3D in;
> }
> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D MUTATO=
RS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D OPERAT=
ORS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> =

> const Pstates& operator =3D ( const Pstates &other ); /* assignment ope=
rator */
> =

> =

> =

> =

> /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DATA M=
EMBERS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
> protected:
> =

> private:
> std::vector< state > _vstate;
> =

> }; /* ----- end of class Pstates ----- */
> =

> /* Overload ostream function */
> template
> std::ostream& operator << ( std::ostream &output, state &p ) =

> { =

> output << "nam =3D> " << p.nam() << "\tcost=3D> " << p.r() << std::en=
dl;
> return output; =

> }
> =

> /*
> =

> =

> template
> inline unk NODE::value(){ if(this !=3D NULL) return _value; else ret=
urn NULL; };
> =

> template
> inline void NODE::value(unk val){
> _value =3D val;
> };
> =

> */
> =

> =

> /*
> template
> class LIST{
> public:
> LIST() : _at_front(0), _at_end(0), _size(0) {}
> inline int size();
> inline void insert(NODE *, unk);
> inline void insert(unk);
> inline void front(unk);
> inline void up_size();
> inline void down_size();
> void display(ostream &os =3D cout);
> void remove_front();
> void remove_all();
> void remove_item(unk);
> void remove_item(NODE *);
> NODE * find(unk);
> NODE * find_all(unk, NODE * last =3D NULL );
> =

> ~LIST();
> =

> private:
> NODE *_at_front;
> NODE *_at_end;
> int _size;
> LIST(const LIST&);
> LIST& operator=3D( const LIST&);
> };
> */
> =

> /*
> template
> void LIST::display(ostream &os){
> NODE * tmp =3D _at_front;
> =

> if (tmp =3D=3D 0){
> os << "No List" << endl;
> return;
> }
> =

> =

> //unk i =3D0;
> while(tmp !=3D _at_end){
> //cout << "Entering While Loop: "<< ++i << endl;
> os << tmp->value() << ":";
> tmp =3D tmp->next();
> }
> =

> os << tmp->value() << endl;
> =

> }
> */
> } /*---End of Namespace TREE---*/
> #endif
> =

> =

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~~
> =

> #include
> #include
> #include "nodes.h"
> using namespace std;
> =

> int main(int argv, char ** argc)
> {
> tree::state a{"A", 65500};
> tree::state c{"C", 0};
> tree::state g{"G", 65500};
> tree::state t{"T", 65500};
> =

> vector< tree::state > posible_states =3D {a,c,g,t};
> =

> tree::Pstates node_status{posible_states};
> tree::NODE cr1{"T01", 3};
> tree::NODE cl1{"T00",2};
> // tree::NODE root{"T0",1};
> =

> // tree::NODE > cr1{"T01", 3};
> // tree::NODE > cl1{"T00",2};
> tree::NODE > root{"T0",node_status};
> return 0;
> }
> =

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> when this compiles and reaches the last construction it loses parameters
> =

> =

> || g++ -Wall -ggdb -c nodes.cpp
> || g++ -Wall -ggdb -o fitch.o -c fitch.cpp =

> || nodes.h: In instantiation of =91tree::NODE::NODE(std::__cxx11::st=
ring, const unk&, tree::NODE*, tree::NODE*, tree::NODE*) [wi=
th unk =3D tree::Pstates; std::__cxx11::string =3D std::__cxx11::basic=
_string]=92:
> fitch.cpp|22 col 55| required from here
> nodes.h|105 col 96| error: no matching function for call to =91tree::Psta=
tes::Pstates()=92
> || NODE::NODE( std::string xt, const unk &x, NODE *xcl , NODE<=
unk> *xcr, NODE *xp ){
> || =
^
> nodes.h|180 col 3| note: candidate: tree::Pstates::Pstates(std::vec=
tor >) [with cost =3D int]
> || Pstates (std::vector< state > x)
> || ^~~~~~~
> nodes.h|180 col 3| note: candidate expects 1 argument, 0 provided
> nodes.h|174 col 7| note: candidate: tree::Pstates::Pstates(const tre=
e::Pstates&)
> || class Pstates
> || ^~~~~~~
> nodes.h|174 col 7| note: candidate expects 1 argument, 0 provided
> make: *** [makefile|10| fitch.o] Error 1
> =

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> =

> specifically right here...
> fitch.cpp|22 col 55| required from here
> nodes.h|105 col 96| error: no matching function for call to =91tree::Psta=
tes::Pstates()=92
> || NODE::NODE( std::string xt, const unk &x, NODE *xcl , NODE<=
unk> *xcr, NODE *xp ){
> =

> =

> template
> NODE::NODE( std::string xt, const unk &x, NODE *xcl , NODE=
*xcr, NODE *xp ){
> states(x);
> trait(xt);
> cl(xcl);
> cr(xcr);
> p(xp);
> std::cout << trait() << " node " << "has the following states =3D> " << =
std::endl;
> }
> =

> it is not supposed to call Pstates::Pstates()
> =

> I'm specifically sending the argument by reference. It is not supposed t=
o be constructing a thing.
> =

> =

> =

> _______________________________________________
> Learn mailing list
> Learn-at-nylxs.com
> http://lists.mrbrklyn.com/mailman/listinfo/learn
> =



-- =

So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013
_______________________________________________
Learn mailing list
Learn-at-nylxs.com
http://lists.mrbrklyn.com/mailman/listinfo/learn

  1. 2016-11-01 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] how is it indexing in cuda
  2. 2016-11-01 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] not adequately speced of explained
  3. 2016-11-01 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] how is it indexing in cuda
  4. 2016-11-01 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] not adequately speced of explained
  5. 2016-11-02 Christopher League <league-at-contrapunctus.net> Re: [Learn] Fitch Algorithm - C++
  6. 2016-11-02 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fitch Algorithm - C++
  7. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] how is it indexing in cuda
  8. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fitch Algorithm - C++
  9. 2016-11-02 IEEE Computer Society <csconnection-at-computer.org> Subject: [Learn] Hear Google's John Martinis Take on Quantum Computing at
  10. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] opencl
  11. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] scheduled for tommorw
  12. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] threads tutorial
  13. 2016-11-03 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fitch Algorithm - C++
  14. 2016-11-03 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fitch Algorithm - C++
  15. 2016-11-03 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fitch Algorithm - C++
  16. 2016-11-03 Christopher League <league-at-contrapunctus.net> Re: [Learn] huffman code
  17. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] huffman code
  18. 2016-11-03 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] huffman code
  19. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fitch algorithm from the beginning
  20. 2016-11-03 From: <mrbrklyn-at-panix.com> Subject: [Learn] huffman code
  21. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Phenology meeting
  22. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] relevant hackathon
  23. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] relevant hackathon
  24. 2016-11-04 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] huffman code
  25. 2016-11-04 Christopher League <league-at-contrapunctus.net> Subject: [Learn] Fitch/Sankoff
  26. 2016-11-05 Christopher League <league-at-contrapunctus.net> Re: [Learn] Fwd: templates within templates
  27. 2016-11-05 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: const T vs T const
  28. 2016-11-05 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Template Library files and Header linking troubles
  29. 2016-11-05 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: templates within templates
  30. 2016-11-06 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fwd: templates within templates
  31. 2016-11-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Fwd: templates within templates
  32. 2016-11-06 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fwd: templates within templates
  33. 2016-11-06 Christopher League <league-at-contrapunctus.net> Re: [Learn] Fwd: templates within templates
  34. 2016-11-06 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fwd: templates within templates
  35. 2016-11-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Fwd: templates within templates
  36. 2016-11-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Fwd: templates within templates
  37. 2016-11-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] GNU Parallel 20161022 ('Matthew') released [stable]
  38. 2016-11-07 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] templates and ostream for future reference
  39. 2016-11-08 Christopher League <league-at-contrapunctus.net> Re: [Learn] C++ signature ambiguity
  40. 2016-11-08 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] C++ signature ambiguity
  41. 2016-11-08 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] C++ signature ambiguity
  42. 2016-11-08 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Invitation: Phylogeny meeting -at- Weekly from 10:15 to
  43. 2016-11-08 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] Fwd: [nylug-talk] RSVP open: Wed Nov 16,
  44. 2016-11-09 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort parallel hw
  45. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] merge sort parallel hw
  46. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] merge sort parallel hw
  47. 2016-11-09 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort parallel hw
  48. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] mergesort tutorial
  49. 2016-11-09 Christopher League <league-at-contrapunctus.net> Re: [Learn] mergesort tutorial
  50. 2016-11-09 Christopher League <league-at-contrapunctus.net> Re: [Learn] namespace and external files confusion
  51. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] namespace and external files confusion
  52. 2016-11-09 From: "Carlos R. Mafra" <crmafra-at-gmail.com> Re: [Learn] Question about a small change
  53. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] =?utf-8?q?C++_call_of_overloaded_=E2=80=98track=28int*=26?=
  54. 2016-11-09 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: lost arguments
  55. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: [dinosaur] Dating origins of dinosaurs,
  56. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] merge sort parallel hw
  57. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] mergesort tutorial
  58. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] namespace and external files confusion
  59. 2016-11-10 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort parallel hw
  60. 2016-11-10 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] merge sort parallel hw
  61. 2016-11-10 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] merge sort parallel hw
  62. 2016-11-10 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] merge sort parallel hw
  63. 2016-11-10 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] [Hangout-NYLXS] mergesort tutorial
  64. 2016-11-10 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] Fwd: [Hangout-NYLXS] ease your mind- everything in the
  65. 2016-11-10 Ruben Safir <ruben.safir-at-my.liu.edu> Subject: [Learn] Fwd: [Hangout-NYLXS] R Programming Workshop
  66. 2016-11-10 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Paleocast phenogenetic tree building
  67. 2016-11-11 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort parallel hw
  68. 2016-11-12 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] HW of mergesort in parallel
  69. 2016-11-13 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] merge sort in parallel assignment
  70. 2016-11-14 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort in parallel assignment
  71. 2016-11-14 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] merge sort in parallel assignment
  72. 2016-11-14 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] merge sort parallel hw
  73. 2016-11-14 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] CUDA and video
  74. 2016-11-14 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] PNG Graphic formats and CRCs
  75. 2016-11-15 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: PNG coding
  76. 2016-11-15 ruben safir <ruben.safir-at-my.liu.edu> Subject: [Learn] Fwd: PNG Coding
  77. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Fwd: lost arguments
  78. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] relevant hackathon
  79. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] C++ Workshop Announcement
  80. 2016-11-16 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] Fwd: Re: ref use
  81. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] ref use
  82. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] why use a reference wrapper int his example
  83. 2016-11-17 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] [Hangout-NYLXS] at K&R now
  84. 2016-11-17 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: [Hangout-NYLXS] Fwd: PNG Coding
  85. 2016-11-18 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] C++ workshop and usenet responses
  86. 2016-11-19 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: ref use
  87. 2016-11-20 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] when is the constructor called for an object
  88. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: creating a binary tree
  89. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: hidden static
  90. 2016-11-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: ISBI 2017 Call for Abstracts and Non-Author
  91. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: PNG coding
  92. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: the new {} syntax
  93. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: when is the constructor called for an object
  94. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: when is the constructor called for an object
  95. 2016-11-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: [dinosaur] Eoconfuciusornis feather keratin and
  96. 2016-11-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] look what I found
  97. 2016-11-22 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Cuccuency book
  98. 2016-11-22 ruben safir <ruben.safir-at-my.liu.edu> Subject: [Learn] declare a func or call an object
  99. 2016-11-22 Ruben Safir <ruben.safir-at-my.liu.edu> Subject: [Learn] Fwd: Re: Using CLIPS as a library
  100. 2016-11-23 Ruben Safir <ruben.safir-at-my.liu.edu> Subject: [Learn] Fwd: Simple C++11 Wrapper for CLIPS 6.30
  101. 2016-11-23 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Parrelel Programming HW2 with maxpath
  102. 2016-11-24 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] great research news for big data
  103. 2016-11-24 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] mapping algorithms
  104. 2016-11-24 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Todays meeting
  105. 2016-11-25 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: [dinosaur] Flightless theropod phylogenetic variation
  106. 2016-11-26 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Note to self for Thursday
  107. 2016-11-26 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fitch etc
  108. 2016-11-26 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Note to self for Thursday
  109. 2016-11-26 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] operator<<() overloading details and friend
  110. 2016-11-27 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] 130 year old feathers analysis
  111. 2016-11-27 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: ACM/SPEC ICPE 2017 - Call for Tutorial Proposals
  112. 2016-11-27 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: ACM/SPEC ICPE 2017 - Call for Workshop Proposals
  113. 2016-11-27 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: CfP 22nd Conf. Reliable Software Technologies,
  114. 2016-11-27 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Seeking contributors for psyche-c
  115. 2016-11-29 Christopher League <league-at-contrapunctus.net> Re: [Learn] Look at this exciting output by my test program
  116. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Look at this exciting output by my test program
  117. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Look at this exciting output by my test program
  118. 2016-11-29 Christopher League <league-at-contrapunctus.net> Re: [Learn] Quantum Entanglement
  119. 2016-11-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Quantum Entanglement
  120. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Here is the paper I was talking out
  121. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Look at this exciting output by my test program
  122. 2016-11-29 nylxs <mrbrklyn-at-optonline.net> Subject: [Learn] Look at this exciting output by my test program
  123. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Quantum Entanglement
  124. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] The Death of PBS
  125. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] witmer lab ohio and 3d imaging
  126. 2016-11-30 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] phylogenetic crawler

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!