user1450005
user1450005

Reputation: 53

Error: Expected constructor, destructor, type conversion before '<' token

the code is

#include <ctime>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <iterator>
#include <queue>
#include <algorithm>
#include <string>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <new>
#include <algorithm>
#include <functional>
#include <vector>

using namespace std;

using std::vector;

    #include <boost/numeric/ublas/matrix.hpp>
    #include <boost/numeric/ublas/io.hpp>
    #include <boost/numeric/ublas/operation.hpp>
#include <boost/numeric/ublas/vector.hpp>

    using namespace boost::numeric::ublas;

    boost::numeric::ublas::matrix<double> A_MATRIX(A_MATRIX_ROWS,A_MATRIX_COLUMNS);
    boost::numeric::ublas::matrix<double> Y_MATRIX(A_MATRIX_ROWS,1);


    vector <double> GPSR_BB(boost::numeric::ublas::matrix<double> &f_Y_MATRIX,boost::numeric::ublas::matrix<double> &f_A_MATRIX,int f_tau,int f_tolA){

vector<double> objective(2);

//sth inside function

return objective;

    }

    int main(){
        vector<double> objectives(maxiter+2);
        objectives=GPSR_BB(Y_MATRIX,A_MATRIX,tau,tolA);
        return 0;
    }

in line

vector <double> GPSR_BB(boost::numeric::ublas::matrix<double> &f_Y_MATRIX,boost::numeric::ublas::matrix<double> &f_A_MATRIX,int f_tau,int f_tolA){

I receive error

error: expected constructor, destructor, or type conversion before ‘<’ token function

I guess, the problem is because of matrix data type, from boost library, which I have to pass to function, I don't think there is another way I can do for my specific problem.

Any help is greatly appreciated. Thank you

Upvotes: 1

Views: 796

Answers (2)

nurettin
nurettin

Reputation: 11736

boost::numeric::ublas has vector as well as namespace std. Try removing using namespace std and using the appropriate namespace to refer to the correct type.

Upvotes: 1

jdc
jdc

Reputation: 339

Try without a space between vector and <double>

vector<double> GPSR_BB

Upvotes: 0

Related Questions