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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
@node Arrays, Matrix and Vector Operations, Introduction, Top
@chapter Arrays
@cindex arrays
@menu
* Constructors and Assignment::
@end menu
@node Constructors and Assignment, , Arrays, Arrays
@section Constructors and Assignment
@deftypefn Constructor {} Array<T>::Array (void)
Create an array with no elements.
@end deftypefn
@deftypefn Constructor {} Array<T>::Array (int @var{n} [, const T &@var{val}])
Create an array with @var{n} elements. If the optional argument
@var{val} is supplied, the elements are initialized to @var{val};
otherwise, they are left uninitialized. If @var{n} is less than zero,
the current error handler is invoked (@pxref{Error Handling}).
@end deftypefn
@deftypefn Constructor {} Array<T>::Array (const Array<T> &@var{a})
Create a copy of the @var{Array<T>} object @var{a}. Memory for the
@var{Array<T>} class is managed using a reference counting scheme, so
the cost of this operation is independent of the size of the array.
@end deftypefn
@deftypefn Operator Array<T>& {Array<T>::operator =} (const Array<T> &@var{a})
Assignment operator. Memory for the @var{Array<T>} class is managed
using a reference counting scheme, so the cost of this operation is
independent of the size of the array.
@end deftypefn
@deftypefn Method int Array<T>::capacity (void) const
@deftypefnx Method int Array<T>::length (void) const
Return the length of the array.
@end deftypefn
@deftypefn Method T& Array<T>::elem (int @var{n})
@deftypefnx Method T& Array<T>::checkelem (int @var{n})
@deftypefnx Method T& {Array<T>::operator ()} (int @var{n})
If @var{n} is within the bounds of the array, return a reference to the
element indexed by @var{n}; otherwise, the current error handler is
invoked (@pxref{Error Handling}).
@end deftypefn
@deftypefn Method T Array<T>::elem (int @var{n}) const
@deftypefnx Method T Array<T>::checkelem (int @var{n}) const
@deftypefnx Method T Array<T>::operator () (int @var{n}) const
If @var{n} is within the bounds of the array, return the value indexed
by @var{n}; otherwise, call the current error handler.
@xref{Error Handling}.
@end deftypefn
@deftypefn Method T& Array<T>::xelem (int @var{n})
@deftypefnx Method T Array<T>::xelem (int @var{n}) const
Return a reference to, or the value of, the element indexed by @var{n}.
These methods never perform bounds checking.
@end deftypefn
@deftypefn Method void Array<T>::resize (int @var{n} [, const T &@var{val}])
Change the size of the array to be @var{n} elements. All elements are
unchanged, except that if @var{n} is greater than the current size and
the optional argument @var{val} is provided, the additional elements are
initialized to @var{val}; otherwise, any additional elements are left
uninitialized. In the current implementation, if @var{n} is less than
the current size, the length is updated but no memory is released.
@end deftypefn
@deftypefn Method {const T*} Array<T>::data (void) const
@end deftypefn
@c Should this be public?
@c
@c T *fortran_vec (void)
@deftypefn {} {} Array2 (void)
@deftypefnx {} {} Array2 (int @var{n}, int @var{m})
@deftypefnx {} {} Array2 (int @var{n}, int @var{m}, const T &@var{val})
@deftypefnx {} {} Array2 (const Array2<T> &@var{a})
@deftypefnx {} {} Array2 (const DiagArray<T> &@var{a})
@end deftypefn
@deftypefn {} Array2<T>& {operator =} (const Array2<T> &@var{a})
@end deftypefn
@deftypefn {} int dim1 (void) const
@deftypefnx {} int rows (void) const
@end deftypefn
@deftypefn {} int dim2 (void) const
@deftypefnx {} int cols (void) const
@deftypefnx {} int columns (void) const
@end deftypefn
@deftypefn {} T& elem (int @var{i}, int @var{j})
@deftypefnx {} T& checkelem (int @var{i}, int @var{j})
@deftypefnx {} T& {operator ()} (int @var{i}, int @var{j})
@end deftypefn
@c This needs to be fixed.
@c
@c T& xelem (int i, int j)
@c
@c T elem (int i, int j) const
@c T checkelem (int i, int j) const
@c T operator () (int i, int j) const
@deftypefn {} void resize (int @var{n}, int @var{m})
@deftypefnx {} void resize (int @var{n}, int @var{m}, const T &@var{val})
@end deftypefn
@deftypefn {} Array3 (void)
@deftypefnx {} Array3 (int @var{n}, int @var{m}, int @var{k})
@deftypefnx {} Array3 (int @var{n}, int @var{m}, int @var{k}, const T &@var{val})
@deftypefnx {} Array3 (const Array3<T> &@var{a})
@end deftypefn
@deftypefn {} Array3<T>& {operator =} (const Array3<T> &@var{a})
@end deftypefn
@deftypefn {} int dim1 (void) const
@deftypefnx {} int dim2 (void) const
@deftypefnx {} int dim3 (void) const
@end deftypefn
@deftypefn {} T& elem (int @var{i}, int @var{j}, int @var{k})
@deftypefnx {} T& checkelem (int @var{i}, int @var{j}, int @var{k})
@deftypefnx {} T& {operator ()} (int @var{i}, int @var{j}, int @var{k})
@end deftypefn
@c This needs to be fixed.
@c
@c T& xelem (int i, int j, int k)
@c
@c T elem (int i, int j, int k) const
@c T checkelem (int i, int j, int k) const
@c T operator () (int i, int j, int k) const
@deftypefn {} void resize (int @var{n}, int @var{m}, int @var{k})
@deftypefnx {} void resize (int @var{n}, int @var{m}, int @var{k}, const T &@var{val})
@end deftypefn
@deftypefn {} {}DiagArray (void)
@deftypefnx {} {}DiagArray (int @var{n})
@deftypefnx {} {}DiagArray (int @var{n}, const T &@var{val})
@deftypefnx {} {}DiagArray (int @var{r}, int @var{c})
@deftypefnx {} {}DiagArray (int @var{r}, int @var{c}, const T &@var{val})
@deftypefnx {} {}DiagArray (const Array<T> &@var{a})
@deftypefnx {} {}DiagArray (const DiagArray<T> &@var{a})
@end deftypefn
@deftypefn {} DiagArray<T>& {operator =} (const DiagArray<T> &@var{a})
@end deftypefn
@deftypefn {} int dim1 (void) const
@deftypefnx {} int rows (void) const
@end deftypefn
@deftypefn {} int dim2 (void) const
@deftypefnx {} int cols (void) const
@deftypefnx {} int columns (void) const
@end deftypefn
@deftypefn {} T& elem (int @var{r}, int @var{c})
@deftypefnx {} T& checkelem (int @var{r}, int @var{c})
@deftypefnx {} T& {operator ()} (int @var{r}, int @var{c})
@end deftypefn
@c This needs to be fixed.
@c
@c T& xelem (int r, int c)
@c
@c T elem (int r, int c) const
@c T checkelem (int r, int c) const
@c T operator () (int r, int c) const
@deftypefn {} void resize (int @var{n}, int @var{m})
@deftypefnx {} void resize (int @var{n}, int @var{m}, const T &@var{val})
@end deftypefn
|