Program listing for file kernel/src/modelingTools/FirstOrderLinearR.hpp

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#ifndef FirstOrderLinearR_H
#define FirstOrderLinearR_H

#include "FirstOrderR.hpp"

typedef void (*FOMatPtr1)(double, unsigned int, unsigned int, double*, unsigned int, double*);


typedef void (*FOMatPtr2)(double, unsigned int, double*, unsigned int, double*);


typedef void (*FOVecPtr)(double, unsigned int, double*, unsigned int, double*);


class FirstOrderLinearR : public FirstOrderR
{

protected:

  ACCEPT_SERIALIZATION(FirstOrderLinearR);



  SP::SiconosVector _e;

public:


  FirstOrderLinearR();


  FirstOrderLinearR(const std::string& Cname, const std::string& Bname);


  FirstOrderLinearR(const std::string& Cname, const std::string& Dname, const std::string& Fname, const std::string& Ename, const std::string& Bname);


  FirstOrderLinearR(SP::SimpleMatrix C, SP::SimpleMatrix B);


  FirstOrderLinearR(SP::SimpleMatrix C, SP::SimpleMatrix D, SP::SimpleMatrix F, SP::SiconosVector e, SP::SimpleMatrix B);


  ~FirstOrderLinearR() {};




  void setComputeCFunction(const std::string& pluginPath, const std::string& functionName)
  {
    setComputeJachxFunction(pluginPath,  functionName);
  }


  void setComputeDFunction(const std::string& pluginPath, const std::string& functionName)
  {
    setComputeJachlambdaFunction(pluginPath,  functionName);
  }


  void setComputeBFunction(const std::string& pluginPath, const std::string& functionName)
  {
    setComputeJacglambdaFunction(pluginPath,  functionName);
  }

  virtual void initialize(Interaction& inter);


  virtual void checkSize(Interaction& inter);

  void computeC(double time, SiconosVector& z, SimpleMatrix& C);


  void computeD(double time, SiconosVector& z, SimpleMatrix& D);


  void computeF(double time, SiconosVector& z, SimpleMatrix& F);


  void computee(double time, SiconosVector& z, SiconosVector& e);


  void computeB(double time, SiconosVector& z, SimpleMatrix& B);


  void computeh(double time,
                BlockVector& x, SiconosVector& lambda,
                SiconosVector& z, SiconosVector& y);


  void computeg(double time, SiconosVector& lambda, SiconosVector& z, BlockVector& r);


  virtual void computeOutput(double time, Interaction& inter,  unsigned int level = 0);


  virtual void computeInput(double time, Interaction& inter, unsigned int level = 0);


  void display() const;


  inline void setePtr(SP::SiconosVector newe)
  {
    _e = newe;
  }


  inline SP::SiconosVector e() const
  {
    return _e;
  }


  virtual bool isLinear()
  {
    return true;
  }

  virtual void computeJach(double time, Interaction& inter) {};
  virtual void computeJacg(double time, Interaction& inter) {};


  ACCEPT_STD_VISITORS();

};

TYPEDEF_SPTR(FirstOrderLinearR)

#endif