frustration

хелп

Jun 4th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. //classes.h//
  2.  
  3. class Geometry
  4. {
  5. private:
  6. vector < vector < double > > lambda_bb;
  7. public:
  8. void AllocateMemory(int Mx, int My);
  9. };
  10.  
  11. class Polar : public Geometry
  12. {
  13. public:
  14. void PolarMemory(int Mx, int My);
  15. void UpdateVolume(int Mx,int My);
  16. Polar(int Mx, int My) {
  17. }
  18. void (int x, int y);
  19. private:
  20. vector < vector < double > > volume;
  21. };
  22.  
  23. //classes.cpp//
  24. #include "classes.h"
  25.  
  26. void Geometry::AllocateMemory(int x, int y) {
  27. lambda_bb.assign(x+2, vector<double>(y+2, 0));
  28. };
  29.  
  30. void Polar::PolarMemory(int Mx, int My){
  31. lambda_bb.assign(x+2, vector<double>(y+2, 0));
  32. };
  33.  
  34. void Polar::UpdateVolume(int Mx,int My) {
  35. int delta_h = 1;
  36. for (int i = 1; i < Mx + 1; ++i) {
  37. for (int j = 1; j < My + 1; ++j) {
  38. volume[i][j] = 0.5*My*(i *i - (i - 1) * (i - 1))*delta_h;
  39. }
  40. }
  41. }
  42.  
  43. //main.cpp//
  44. #include "classes.h"
  45.  
  46. if (key == "polar") {
  47. Polar::Geometry polar;
  48. polar.SetNumberOfLayers(Mx, My);//ошибка
  49.  
  50. }
Add Comment
Please, Sign In to add comment