octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Consistently use element_type in the array classes.


From: Jaroslav Hajek
Subject: Re: [PATCH] Consistently use element_type in the array classes.
Date: Fri, 6 Mar 2009 21:08:25 +0100

On Fri, Mar 6, 2009 at 4:32 PM, Jason Riedy <address@hidden> wrote:
> # HG changeset patch
> # User Jason Riedy <address@hidden>
> # Date 1236353250 18000
> # Node ID e404bfa7024798178071a83bbce4379ec4eacd8f
> # Parent  57c3155754d69c8a01d2ec90fe37b5914a6f5de9
> Consistently use element_type in the array classes.
>
> The sparse and diagonal matrix classes used elt_type, although it
> appears that element_type in Array.h predates elt_type.  So convert
> elt_type to element_type.
>
> Also avoid explicit typedefs in intNDArray<T> and DiagArray2<T>.  In
> intNDArray<T>, element_type is inherited from MArrayN<T>.  In
> DiagArray2<T>, the defintion is imported from the protected base
> Array<T>.
>
> Signed-off-by: Jason Riedy <address@hidden>
> ---
>  liboctave/ChangeLog    |   11 +++++++++++
>  liboctave/DiagArray2.h |    2 +-
>  liboctave/Sparse.h     |    2 +-
>  liboctave/intNDArray.h |    2 +-
>  src/ChangeLog          |    5 +++++
>  src/ov-base-int.cc     |    4 ++--
>  6 files changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog
> --- a/liboctave/ChangeLog
> +++ b/liboctave/ChangeLog
> @@ -1,3 +1,14 @@
> +2009-03-05  Jason Riedy  <address@hidden>
> +
> +       * Sparse.h (Sparse<T>::elt_type): Remove typedef, replace with:
> +       * Sparse.h (Sparse<T>::element_type): Add typedef to be consistent
> +       with Array.h
> +       * DiagArray2.h (DiagArray2<T>::elt_type): Likewise, removed.
> +       * DiagArray2.h (DiagArray2<T>::element_type): Define by using
> +       Array<T>::element_type.
> +       * intNDArray.h (intNDArray<T>::element_type): Remove, inherited
> +       from MArrayN<T>.
> +
>  2009-03-05  Jaroslav Hajek  <address@hidden>
>
>        * dSparse.h (SparseMatrix::SparseMatrix(const PermMatrix&)): New
> diff --git a/liboctave/DiagArray2.h b/liboctave/DiagArray2.h
> --- a/liboctave/DiagArray2.h
> +++ b/liboctave/DiagArray2.h
> @@ -94,7 +94,7 @@
>
>  public:
>
> -  typedef T element_type;
> +  using Array<T>::element_type;
>
>   DiagArray2 (void)
>     : Array<T> (), d1 (0), d2 (0) { }
> diff --git a/liboctave/Sparse.h b/liboctave/Sparse.h
> --- a/liboctave/Sparse.h
> +++ b/liboctave/Sparse.h
> @@ -48,7 +48,7 @@
>  {
>  public:
>
> -  typedef T elt_type;
> +  typedef T element_type;
>
>  protected:
>   //--------------------------------------------------------------------
> diff --git a/liboctave/intNDArray.h b/liboctave/intNDArray.h
> --- a/liboctave/intNDArray.h
> +++ b/liboctave/intNDArray.h
> @@ -32,7 +32,7 @@
>  {
>  public:
>
> -  typedef T elt_type;
> +  using MArrayN<T>::element_type;
>
>   intNDArray (void) : MArrayN<T> () { }
>
> diff --git a/src/ChangeLog b/src/ChangeLog
> --- a/src/ChangeLog
> +++ b/src/ChangeLog
> @@ -1,3 +1,8 @@
> +2009-03-05  Jason Riedy  <address@hidden>
> +
> +       * ov-base-int.cc (convert_to_str_internal): Replace elt_type with
> +       element_type throughout.
> +
>  2009-03-05  Jaroslav Hajek  <address@hidden>
>
>        * DLD-FUNCTIONS/sparse.cc (Fsparse): Handle diagonal and permutation
> diff --git a/src/ov-base-int.cc b/src/ov-base-int.cc
> --- a/src/ov-base-int.cc
> +++ b/src/ov-base-int.cc
> @@ -145,9 +145,9 @@
>     {
>       OCTAVE_QUIT;
>
> -      typename T::elt_type tmp = this->matrix(i);
> +      typename T::element_type tmp = this->matrix(i);
>
> -      typedef typename T::elt_type::val_type val_type;
> +      typedef typename T::element_type::val_type val_type;
>
>       val_type ival = tmp.value ();
>
>

I applied this patch.

Thanks

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]