# HG changeset patch
# User Kai T. Ohlhus <k.ohlhus@gmail.com>
# Date 1415705496 -3600
#      Tue Nov 11 12:31:36 2014 +0100
# Node ID d556dc78af2ff35a900aaa46cc18ee6cdeb6c4c3
# Parent  50922b1c74df83761a2612e6c80715965c8c40ac
Remove deprecated methods in liboctave.

* Array2.h, Array3.h, ArrayN.h, module.mk: deprecated headers removed.
* chNDArray.cc: avoid usage of deprecated methods in constructors.
* Array.h: documentation improved. Deprecated methods removed.
* kron.cc (kron): use undeprecated constructor.

diff -r 50922b1c74df -r d556dc78af2f libinterp/corefcn/kron.cc
--- a/libinterp/corefcn/kron.cc	Mon Nov 10 23:11:20 2014 +0000
+++ b/libinterp/corefcn/kron.cc	Tue Nov 11 12:31:36 2014 +0100
@@ -138,7 +138,7 @@
   octave_idx_type nb = b.rows ();
   const Array<octave_idx_type>& pa = a.col_perm_vec ();
   const Array<octave_idx_type>& pb = b.col_perm_vec ();
-  Array<octave_idx_type> res_perm (na * nb);
+  Array<octave_idx_type> res_perm (dim_vector (1, na * nb));
   octave_idx_type rescol = 0;
   for (octave_idx_type i = 0; i < na; i++)
     {
diff -r 50922b1c74df -r d556dc78af2f liboctave/array/Array.h
--- a/liboctave/array/Array.h	Mon Nov 10 23:11:20 2014 +0000
+++ b/liboctave/array/Array.h	Tue Nov 11 12:31:36 2014 +0100
@@ -41,9 +41,7 @@
 #include "oct-mem.h"
 #include "oct-refcount.h"
 
-//! One dimensional array class.  Handles the reference counting for
-//! all the derived classes.
-
+//!Handles the reference counting for all the derived classes.
 template <class T>
 class
 Array
@@ -180,20 +178,6 @@
     rep->count++;
   }
 
-  //! Obsolete 1D ctor (there are no 1D arrays).
-  explicit Array (octave_idx_type n) GCC_ATTR_DEPRECATED
-    : dimensions (n, 1), rep (new typename Array<T>::ArrayRep (n)),
-      slice_data (rep->data), slice_len (rep->len)
-  { }
-
-  //! Obsolete initialized 1D ctor (there are no 1D arrays).
-  explicit Array (octave_idx_type n, const T& val) GCC_ATTR_DEPRECATED
-    : dimensions (n, 1), rep (new typename Array<T>::ArrayRep (n)),
-      slice_data (rep->data), slice_len (rep->len)
-  {
-    fill (val);
-  }
-
   //! nD uninitialized ctor.
   explicit Array (const dim_vector& dv)
     : dimensions (dv),
@@ -305,7 +289,7 @@
   }
 
   //! @name First dimension
-  //! 
+  //!
   //! Get the first dimension of the array (number of rows)
   //@{
   octave_idx_type dim1 (void) const { return dimensions(0); }
@@ -322,7 +306,7 @@
   //@}
 
   //! @name Third dimension
-  //! 
+  //!
   //! Get the third dimension of the array (number of pages)
   //@{
   octave_idx_type dim3 (void) const { return dimensions(2); }
@@ -338,9 +322,6 @@
   //! Chop off leading singleton dimensions
   Array<T> squeeze (void) const;
 
-  void chop_trailing_singletons (void) GCC_ATTR_DEPRECATED
-  { dimensions.chop_trailing_singletons (); }
-
   octave_idx_type compute_index (octave_idx_type i, octave_idx_type j) const;
   octave_idx_type compute_index (octave_idx_type i, octave_idx_type j,
                                  octave_idx_type k) const;
@@ -501,22 +482,15 @@
 
   //@{
   //! Resizing (with fill).
-  void resize1 (octave_idx_type n, const T& rfv);
-  void resize1 (octave_idx_type n) { resize1 (n, resize_fill_value ()); }
-
-  void resize (octave_idx_type n) GCC_ATTR_DEPRECATED { resize1 (n); }
-
-  void resize (octave_idx_type nr, octave_idx_type nc,
-               const T& rfv) GCC_ATTR_DEPRECATED
-  {
-    resize2 (nr, nc, rfv);
-  }
-
-  void resize (octave_idx_type nr, octave_idx_type nc) GCC_ATTR_DEPRECATED
+  void resize2 (octave_idx_type nr, octave_idx_type nc, const T& rfv);
+  void resize2 (octave_idx_type nr, octave_idx_type nc)
   {
     resize2 (nr, nc, resize_fill_value ());
   }
 
+  void resize1 (octave_idx_type n, const T& rfv);
+  void resize1 (octave_idx_type n) { resize1 (n, resize_fill_value ()); }
+
   void resize (const dim_vector& dv, const T& rfv);
   void resize (const dim_vector& dv) { resize (dv, resize_fill_value ()); }
   //@}
@@ -747,7 +721,7 @@
 
   //@{
   //! WARNING: Only call these functions from jit
-  
+
   int *jit_ref_count (void) { return rep->count.get (); }
 
   T *jit_slice_data (void) const { return slice_data; }
@@ -758,13 +732,6 @@
   //@}
 
 private:
-
-  void resize2 (octave_idx_type nr, octave_idx_type nc, const T& rfv);
-  void resize2 (octave_idx_type nr, octave_idx_type nc)
-  {
-    resize2 (nr, nc, resize_fill_value ());
-  }
-
   static void instantiation_guard ();
 };
 
diff -r 50922b1c74df -r d556dc78af2f liboctave/array/Array2.h
--- a/liboctave/array/Array2.h	Mon Nov 10 23:11:20 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Template array classes
-/*
-
-Copyright (C) 1996-2013 John W. Eaton
-
-This file is part of Octave.
-
-Octave is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-Octave is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with Octave; see the file COPYING.  If not, see
-<http://www.gnu.org/licenses/>.
-
-*/
-
-#if !defined (octave_Array2_h)
-#define octave_Array2_h 1
-
-#include "Array.h"
-#define Array2 Array
-
-// If we're with GNU C++, issue a warning.
-#ifdef __GNUC__
-#warning Using Array2<T> is deprecated. Use Array<T> directly.
-#endif
-
-#endif
diff -r 50922b1c74df -r d556dc78af2f liboctave/array/Array3.h
--- a/liboctave/array/Array3.h	Mon Nov 10 23:11:20 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-// Template array classes
-/*
-
-Copyright (C) 1996-2013 John W. Eaton
-
-This file is part of Octave.
-
-Octave is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-Octave is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with Octave; see the file COPYING.  If not, see
-<http://www.gnu.org/licenses/>.
-
-*/
-
-#if !defined (octave_Array3_h)
-#define octave_Array3_h 1
-
-#include <cassert>
-#include <cstdlib>
-
-#include "Array.h"
-#include "lo-error.h"
-
-class idx_vector;
-
-// Three dimensional array class.
-
-template <class T>
-class
-Array3 : public Array<T>
-{
-public:
-
-  Array3 (void) : Array<T> (dim_vector (0, 0, 0)) { }
-
-  Array3 (octave_idx_type r, octave_idx_type c,
-          octave_idx_type p) : Array<T> (dim_vector (r, c, p)) { }
-
-  Array3 (octave_idx_type r, octave_idx_type c, octave_idx_type p, const T& val)
-    : Array<T> (dim_vector (r, c, p), val) { }
-
-  Array3 (const Array3<T>& a)
-    : Array<T> (a, a.dims ()) { }
-
-  Array3 (const Array<T>& a, octave_idx_type r, octave_idx_type c,
-          octave_idx_type p)
-    : Array<T> (a, dim_vector (r, c, p)) { }
-
-  ~Array3 (void) { }
-
-  Array3<T>& operator = (const Array3<T>& a)
-  {
-    if (this != &a)
-      Array<T>::operator = (a);
-
-    return *this;
-  }
-
-  void resize (octave_idx_type r, octave_idx_type c, octave_idx_type p)
-  { Array<T>::resize (dim_vector (r, c, p)); }
-
-  void resize (octave_idx_type r, octave_idx_type c, octave_idx_type p,
-               const T& val)
-  { Array<T>::resize (dim_vector (r, c, p), val); }
-
-  Array3<T> sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const
-  {
-    Array<T> tmp = Array<T>::sort (dim, mode);
-    return Array3<T> (tmp, tmp.rows (), tmp.columns (), tmp.pages ());
-  }
-
-  Array3<T> sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0,
-                  sortmode mode = ASCENDING) const
-  {
-    Array<T> tmp = Array<T>::sort (sidx, dim, mode);
-    return Array3<T> (tmp, tmp.rows (), tmp.columns (), tmp.pages ());
-  }
-};
-
-// If we're with GNU C++, issue a warning.
-#ifdef __GNUC__
-#warning Using Array3<T> is deprecated. Use Array<T> directly.
-#endif
-
-#endif
diff -r 50922b1c74df -r d556dc78af2f liboctave/array/ArrayN.h
--- a/liboctave/array/ArrayN.h	Mon Nov 10 23:11:20 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Template array classes
-/*
-
-Copyright (C) 2000-2013 John W. Eaton
-
-This file is part of Octave.
-
-Octave is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-Octave is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with Octave; see the file COPYING.  If not, see
-<http://www.gnu.org/licenses/>.
-
-*/
-
-#if !defined (octave_ArrayN_h)
-#define octave_ArrayN_h 1
-
-#include "Array.h"
-#define ArrayN Array
-
-// If we're with GNU C++, issue a warning.
-#ifdef __GNUC__
-#warning Using ArrayN<T> is deprecated. Use Array<T> directly.
-#endif
-
-#endif
diff -r 50922b1c74df -r d556dc78af2f liboctave/array/chNDArray.cc
--- a/liboctave/array/chNDArray.cc	Mon Nov 10 23:11:20 2014 +0000
+++ b/liboctave/array/chNDArray.cc	Tue Nov 11 12:31:36 2014 +0100
@@ -40,36 +40,33 @@
 charNDArray::charNDArray (char c)
   : Array<char> ()
 {
-  octave_idx_type nc = 1;
-  octave_idx_type nr = 1;
+  octave_idx_type n = 1;
 
-  resize (nr, nc);
+  resize1 (n);
 
-  elem (0, 0) = c;
+  elem (0) = c;
 }
 
 charNDArray::charNDArray (const char *s)
   : Array<char> ()
 {
-  octave_idx_type nc = s ? strlen (s) : 0;
-  octave_idx_type nr = s && nc > 0 ? 1 : 0;
+  octave_idx_type n = s ? strlen (s) : 0;
 
-  resize (nr, nc);
+  resize1 (n);
 
-  for (octave_idx_type i = 0; i < nc; i++)
-    elem (0, i) = s[i];
+  for (octave_idx_type i = 0; i < n; i++)
+    elem (i) = s[i];
 }
 
 charNDArray::charNDArray (const std::string& s)
   : Array<char> ()
 {
-  octave_idx_type nc = s.length ();
-  octave_idx_type nr = nc > 0 ? 1 : 0;
+  octave_idx_type n = s.length ();
 
-  resize (nr, nc);
+  resize1 (n);
 
-  for (octave_idx_type i = 0; i < nc; i++)
-    elem (0, i) = s[i];
+  for (octave_idx_type i = 0; i < n; i++)
+    elem (i) = s[i];
 }
 
 charNDArray::charNDArray (const string_vector& s, char fill_value)
diff -r 50922b1c74df -r d556dc78af2f liboctave/array/module.mk
--- a/liboctave/array/module.mk	Mon Nov 10 23:11:20 2014 +0000
+++ b/liboctave/array/module.mk	Tue Nov 11 12:31:36 2014 +0100
@@ -2,10 +2,7 @@
   array/module.mk
 
 ARRAY_INC = \
-  array/Array2.h \
-  array/Array3.h \
   array/Array.h \
-  array/ArrayN.h \
   array/Array-util.h \
   array/boolMatrix.h \
   array/boolNDArray.h \
