octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #29768] logm fix


From: David Bateman
Subject: [Octave-bug-tracker] [bug #29768] logm fix
Date: Tue, 04 May 2010 12:17:15 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4

Follow-up Comment #2, bug #29768 (project octave):

For 4) there seems to be quite a few things we might do to speed up sqrtm.
The frobnorm function seems inefficient and might be rewritten as a template
like

Template <class T>
static T
frobnorm (const Array<T>& A)
{
  T sum = T();
  T *fv = A.fortran_vec ();
  for (octave_idx_type i = 0; i < A.numel (); i++)
    sum += real(fv[i] * conj(fv[i]));
  return sqrt (sum);
}

using fortan_vec to avoid the overhead of the checking of the indexing.
Similarly the sqrtm_from_schur function might be rewritten to use fortan_vec.

The biggest gain however will come from writing the methods

ComplexMatrix schur (Matrix&, std::string&)

and

FloatComplexMatrix schur (FloatMatrix&, std::string&)

Currently in Fsqrtm. A copy of the real matrix is to a complex matrix is
made, and then in the method ComplexSCHUR::init essentially another copy of
the complex matrix is made by the copy of write to the variable schur_mat. If
the above methods are written the second of these might be avoided.

D.
 


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29768>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.gnu.org/





reply via email to

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