i'm new to C++ trying to learn parallel programming (coming from Basic), got stuck fairly early on.
class Particle{
private:
double p_x, p_y, v_x, v_y, mass
public:
Particle(double px, double py, double vx, double vy, double m) : p_x(px), p_y(px), v_x(vx), v_y(vx), mass(m) {};
vector<int> pos () {p_x, p_y}; //doesn't work, expects ';'
vector<int> vel () {v_x, v_y}; //doesn't work, expects ';'
};
I'm trying to create a class with properties pos and vel, both vectors. HNothing worked with what i'm trying to do - initializing vectors i guess.
Can anyone tell me how to make that work? Or if not that something like this:
class Particle{
private:
double p_x, p_y, v_x, v_y, mass
public:
Particle(double px, double py, double vx, double vy, double m) : p_x(px), p_y(px), v_x(vx), v_y(vx), mass(m) {};
void SetPos(int x, int y) //pseudo code based on Basic
void GetPos() as Vector //pseudo code based on Basic
};
Thanks in advance for your time, this has been a brick wall for me for a while. I've looked trough many other threads like this one around here but I don't know enough to adapt any of it to my needs i guess. To complicate things I'm using VS2012 Cuda 6.0 project which sometimes even acts differently than the standard C++ project. Reverted to 6.0 because chrono refused to work in 6.5. Would use the standard project but I don't know how (if possible) to integrate Cuda into it.