comparison liboctave/FEGrid.h @ 1321:64819a909ed7

[project @ 1995-08-22 05:39:43 by jwe]
author jwe
date Tue, 22 Aug 1995 05:41:48 +0000
parents 611d403c7f3d
children dc527156c38c
comparison
equal deleted inserted replaced
1320:c9aecc02c6d4 1321:64819a909ed7
36 #define Vector ColumnVector 36 #define Vector ColumnVector
37 #endif 37 #endif
38 38
39 class FEGrid 39 class FEGrid
40 { 40 {
41 private:
42
43 void error (const char* msg) const;
44 void nel_error (void) const;
45
46 void check_grid (void) const;
47
41 public: 48 public:
42 49
43 FEGrid (void); 50 FEGrid (void) {}
44 FEGrid (const Vector& elbnds); 51 FEGrid (const Vector& elbnds) { elem = elbnds; check_grid (); }
45 FEGrid (int nel, double width); 52 FEGrid (int nel, double width);
46 FEGrid (int nel, double left, double right); 53 FEGrid (int nel, double left, double right);
47 54
48 int in_bounds (double x) const;
49
50 int element (double x) const; 55 int element (double x) const;
51 56
52 double left (void) const; 57 double left (void) const { return elem.elem (0); }
53 double right (void) const; 58 double right (void) const { return elem.elem (elem.capacity () - 1); }
54 59
55 Vector element_boundaries (void) const; 60 int in_bounds (double x) const
61 { return (x >= left () && x <= right ()); }
62
63 Vector element_boundaries (void) const { return elem; }
56 64
57 friend ostream& operator << (ostream&, const FEGrid&); 65 friend ostream& operator << (ostream&, const FEGrid&);
58 66
59 protected: 67 protected:
60 68
61 Vector elem; 69 Vector elem;
62
63 private:
64
65 void error (const char* msg) const;
66 void nel_error (void) const;
67
68 void check_grid (void) const;
69 }; 70 };
70
71 inline FEGrid::FEGrid (void) {}
72
73 inline FEGrid::FEGrid (const Vector& elbnds)
74 { elem = elbnds; check_grid (); }
75
76 inline int FEGrid::in_bounds (double x) const
77 { return (x >= left () && x <= right ()); }
78
79 inline double FEGrid::left (void) const
80 { return elem.elem (0); }
81
82 inline double FEGrid::right (void) const
83 { return elem.elem (elem.capacity () - 1); }
84
85 inline Vector FEGrid::element_boundaries (void) const
86 { return elem; }
87 71
88 #endif 72 #endif
89 73
90 /* 74 /*
91 ;;; Local Variables: *** 75 ;;; Local Variables: ***