help-octave
[Top][All Lists]
Advanced

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

sqrt() of a Matrix in a DLD


From: John W. Eaton
Subject: sqrt() of a Matrix in a DLD
Date: Fri, 5 Mar 2004 13:39:44 -0600

On  5-Mar-2004, Al Niessner <address@hidden> wrote:

| I did a 'grep -i sqrt' in include/octave-2.1.52/octave and did not find
| anything that would indicate how to take the square root of a matrix. My
| m-file has sqrt(m) where m is a diagonal matrix. I could not find a
| similar function in the header files. Anyone know the correct syntax?

I think this came up on the list recently.  In Octave, mapper
functions like sqrt are implemented specially so that they can
properly handle conversion from real to complex, etc.  For example, if
you write

  sm = sqrt (m);

then sm will be complex if any element of m is negative.  Do you want
to preserve that behavior in your C++ function?

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]