comparison liboctave/dNDArray.h @ 4511:24af46b4ce84

[project @ 2003-09-12 16:46:04 by jwe]
author jwe
date Fri, 12 Sep 2003 16:46:04 +0000
parents
children 508238e65af7
comparison
equal deleted inserted replaced
4510:59eaa51e43d3 4511:24af46b4ce84
1 /*
2
3 Copyright (C) 1996, 1997 John W. Eaton
4
5 This file is part of Octave.
6
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
10 later version.
11
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
21 */
22
23 #if !defined (octave_NDArray_int_h)
24 #define octave_NDArray_int_h 1
25
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
27 #pragma interface
28 #endif
29
30 #include "MArrayN.h"
31 //#include "mx-base.h"
32
33 #include "mx-defs.h"
34 #include "mx-op-defs.h"
35
36 #include "data-conv.h"
37 #include "mach-info.h"
38
39 class NDArray : public MArrayN<double>
40 {
41 public:
42
43 NDArray (void) : MArrayN<double> () { }
44
45 NDArray (Array<int>& dims) : MArrayN<double> (dims) { }
46
47 NDArray (Array<int>& dims, double val) : MArrayN<double> (dims, val) { }
48
49 NDArray (const NDArray& a): MArrayN<double> (a) { }
50
51 NDArray (const MArrayN<double>& a) : MArrayN<double> (a) { }
52
53 NDArray (const Matrix& m) : MArrayN<double> (m) { }
54
55 NDArray (const ArrayN<double>& a) : MArrayN<double> (a) { }
56
57 //NDArray (const Array<double>& a) : MArrayN<double> (a) { }
58
59 NDArray& operator = (const NDArray& a)
60 {
61 MArrayN<double>::operator = (a);
62 return *this;
63 }
64
65 // i/o
66
67 // friend std::ostream& operator << (std::ostream& os, const NDArray& a);
68 // friend std::istream& operator >> (std::istream& is, NDArray& a);
69
70 static double resize_fill_value (void) { return 0; }
71
72 bool any_element_is_negative (bool = false) const;
73 bool all_integers (double& max_val, double& min_val) const;
74
75 private:
76
77 NDArray (double *d, Array<int>& dims) : MArrayN<double> (d, dims) { }
78 };
79
80 MARRAY_FORWARD_DEFS (MArrayN, NDArray, double)
81
82 #endif