Boost logo

Ublas :

From: dvir schirman (dvir.boost_at_[hidden])
Date: 2006-05-23 06:22:21


here is the full header.
cov wasn't declared at any place.

#ifndef SIMPLE_ENV_H

#define SIMPLE_ENV_H

//#include "tdagent.H"

#include <math.h>

#include <boost/numeric/ublas/matrix.hpp>

#include <boost/numeric/ublas/vector.hpp>

#include <boost/numeric/ublas/io.hpp>

#include <boost/numeric/ublas/matrix_proxy.hpp>

#include <boost/numeric/ublas/vector_proxy.hpp>

#define PI 3.1415926535897932384626433832795

namespace ublas = boost::numeric::ublas;

using namespace boost::numeric::ublas;

class simple_env

{

public:

simple_env();

~simple_env();

void create();

float preform(float u);

float get_reward();

ublas::vector<float> cov;

ublas::vector<float> get_state();

ublas::vector<float> get_previous_state();

ublas::vector<float> get_final_state();

ublas::vector<float> get_cov();

private:

float sigmoid(float u);

float reward;

ublas::vector<float> state;

ublas::vector<float> prev_state;

ublas::vector<float> final_state;

};

#endif

On 5/23/06, Gunter Winkler <guwi17_at_[hidden]> wrote:
>
> Am Dienstag, 23. Mai 2006 12:12 schrieb dvir schirman:
> > Hi
> >
> > How can I declare a vector at the header of a class?
> > I tried to write in a header file:
> >
> > ublas::vector<float> cov(3);
> >
> > but I got the following error:
> >
> > simple_env.H:25: error: expected identifier before numeric constant
> > simple_env.H:25: error: expected `,' or `...' before numeric constant
> > simple_env.H:25: error: ISO C++ forbids declaration of `parameter'
> > with no type
>
> Did you include all ublas headers before the above declaration? Was cov
> already used at another place?
>
> Please give more information (or the full header) in order to get help.
>
> mfg
> Gunter
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
>