3
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, |
|
4 2007 John W. Eaton |
3
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
3
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
3
|
21 |
|
22 */ |
|
23 |
382
|
24 #if !defined (octave_FEGrid_h) |
|
25 #define octave_FEGrid_h 1 |
|
26 |
3503
|
27 #include <iostream> |
465
|
28 |
|
29 #include "dColVector.h" |
384
|
30 |
1867
|
31 class |
|
32 FEGrid |
3
|
33 { |
|
34 public: |
|
35 |
1867
|
36 FEGrid (void) |
|
37 : elem () { } |
|
38 |
|
39 FEGrid (const ColumnVector& elbnds) |
|
40 : elem (elbnds) { check_grid (); } |
|
41 |
5275
|
42 FEGrid (octave_idx_type nel, double width); |
1867
|
43 |
5275
|
44 FEGrid (octave_idx_type nel, double left, double right); |
3
|
45 |
1867
|
46 FEGrid (const FEGrid& a) |
|
47 : elem (a.elem) { } |
|
48 |
|
49 FEGrid& operator = (const FEGrid& a) |
|
50 { |
|
51 if (this != &a) |
|
52 elem = a.elem; |
|
53 |
|
54 return *this; |
|
55 } |
|
56 |
|
57 ~FEGrid (void) { } |
|
58 |
5275
|
59 octave_idx_type element (double x) const; |
3
|
60 |
1321
|
61 double left (void) const { return elem.elem (0); } |
1867
|
62 |
1321
|
63 double right (void) const { return elem.elem (elem.capacity () - 1); } |
3
|
64 |
1528
|
65 int in_bounds (double x) const { return (x >= left () && x <= right ()); } |
1321
|
66 |
1528
|
67 ColumnVector element_boundaries (void) const { return elem; } |
3
|
68 |
3504
|
69 friend std::ostream& operator << (std::ostream&, const FEGrid&); |
3
|
70 |
|
71 protected: |
|
72 |
1528
|
73 ColumnVector elem; |
1867
|
74 |
|
75 private: |
|
76 |
|
77 void error (const char* msg) const; |
|
78 void nel_error (void) const; |
|
79 |
|
80 void check_grid (void) const; |
3
|
81 }; |
|
82 |
|
83 #endif |
|
84 |
|
85 /* |
|
86 ;;; Local Variables: *** |
|
87 ;;; mode: C++ *** |
|
88 ;;; End: *** |
|
89 */ |