eda − a C++ estimation of distribution library for orderings |
#include <eda.h> |
The eda C++ library, of which this file is a part, should be considered as being alpha testing software. EDA is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, (here), or (at your option) any later version. EDA is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with EDA; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Get a gzipped tar archive here. |
eda is an estimation of distributions algorithm library for orderings on the numbers 0,1,...,N-1 for some positive N. Code that uses this library would look something like the following. #include <eda.h> #include <util.h> class MyObjective : public Objective |
vector<int> target; |
public: |
MyObjective(vector<int> &t) :
Objective(maximize), target(t) {} |
int sum = 0; |
sum += static_cast<int>(target[*(i - 1)] <= target[*i]); |
return static_cast<score_t>(sum); |
} |
}; int main() |
vector<int> t; |
} The above code comes from the file example.cc
(here) supplied with this library,
and can be compiled with (after installing the library and
header files) |
The library consists of a number of files. |
Header files |
eda.h |
Here is the main header file to be included by code that is to be linked with this library. |
farith.h |
Here is the file that is used by the library for floating point arithmetic. Uses the gmp library to avoid numerical instabilities. |
objective.h |
Here is the entry point to the library, defines the objective function. |
parameter.h |
Here is a sub-library that allows object-oriented access to command line parameters. Might be taken out of this library in the future. |
compose2.h |
Here is the file that is used by the command-line parameter part of the library |
util.h |
Here are utilities used by the library (templates) |
CC files |
eda.cc |
farith.cc |
parameter.cc |
tsp(1) |
Staal Vinterbo <staal@dsg.harvard.edu> |
Copyright (C) 2005 Staal Vinterbo |
This library is dependent on the GNU gmp library and has only been tested with g++ 3.3.{1,3}. The linking flags should include -lgmpxx -lgmp |
Must be plenty. Please report them to the author. Thank you. |