#ifndef _JACOBI_H
#define _JACOBI_H

#include "sdag.h"
#include "util.h"

#include "jacobi.decl.h"

class DataMsg : public CMessage_DataMsg {
public:
  int fromLeft;
  int size;
  double b[200]; // border up to 200 elements can be sent. use varsize later.
};

class jacobi: public ArrayElement 
{
#include "jacobi.sdag.h"

private:
  int iterations;
  CellData *data;
  void sendToNeighbors(void);
  void doCalc(DataMsg *, DataMsg *);

public:
   jacobi(ArrayElementCreateMessage *m);
   jacobi(ArrayElementMigrateMessage *m);
   // void borderValues(DataMsg *m); 
};
#endif
