help-octave
[Top][All Lists]
Advanced

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

Re: Hi, another newbie ...


From: John W. Eaton
Subject: Re: Hi, another newbie ...
Date: Fri, 20 Dec 2002 10:39:16 -0600

On 20-Dec-2002, Andrzej M. Ostruszka <address@hidden> wrote:

| Ahh, right... I forgot that it is really a vector (_list affix is a bit
| misleading -- it's a vector cause you wanted random access I guess)

Yes, but we could get indexed access with a list as well, though it
might be slower.  You shouldn't really have to care about the
implementation.

| but still the original point holds, I mean there's no need at all for all
| those octave_value_list(double) and others since appropriate
| constructors are already present in octave_value (they are even
| "harmful" since they introduce ambiguities as in this example with
| append).

You are probably right.  It can cause some trouble that these
constructors exist.  I'm willing to remove them.

Paul (or others), how much trouble do you think it would cause for the
octave-forge (or other) code if I removed all of the following
octave_value_list constructors:

  octave_value_list (double d)
  octave_value_list (const Matrix& m)
  octave_value_list (const DiagMatrix& d)
  octave_value_list (const RowVector& v)
  octave_value_list (const ColumnVector& v)
  octave_value_list (const Complex& c)
  octave_value_list (const ComplexMatrix& m)
  octave_value_list (const ComplexDiagMatrix& d)
  octave_value_list (const ComplexRowVector& v)
  octave_value_list (const ComplexColumnVector& v)
  octave_value_list (const char *s)
  octave_value_list (const std::string& s)
  octave_value_list (const string_vector& s)
  octave_value_list (double base, double limit, double inc)
  octave_value_list (const Range& r)

?

I think it would only mean that instead of

  octave_value_list retval;
  ...
  retval = 3.1415926;

you would have to write

  octave_value_list retval;
  ...
  retval(0) = 3.1415926;

or you could also use

  octave_value_list retval;
  ...
  retval = octave_value (3.1415926);

or even

  octave_value retval;
  ...
  retval = 3.1415926;


I would fix whatever internal Octave stuff breaks and also help with
anything that breaks in octave-forge.

Thanks,

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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