Fix example for STL vectors

This commit is contained in:
Simon Marchetto 2013-06-03 15:21:46 +02:00
commit a61d829676
6 changed files with 84 additions and 90 deletions

View file

@ -1,18 +1,16 @@
/* File : example.cpp */
/* File : example.hxx */
#include <vector>
namespace nlopt {
class opt {
public:
void set_lower_bound(const std::vector<double> &v) {
double sum = 0;
for (int i = 0; i < v.size(); i++) {
sum += v[i];
}
//return sum;
}
};
}
std::vector<double> create_dvector(const int size, const double value);
std::vector<int> create_ivector(const int size, const int value);
double sum_dvector(const std::vector<double> dvector);
int sum_ivector(const std::vector<int> ivector);
void concat_dvector(std::vector<double>& dvector, const std::vector<double> other_dvector);
void concat_ivector(std::vector<int>& ivector, const std::vector<int> other_ivector);