help-octave
[Top][All Lists]
Advanced

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

Re: A(i,:) in .oct file?


From: A S Hodel
Subject: Re: A(i,:) in .oct file?
Date: Thu, 08 Feb 2001 22:34:31 -0600
User-agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022

You could possibly use a direct call the the BLAS daxpy (or zaxpy) routine.
I think it would go something like:

  daxpy( vector_len, -l(i), g(i,0), g.rows(), g(i+1,0), g.rows() );

That depends on Octave storing its matrices in column-major order, but it's
the best I can come up with.

> on 2/8/01 9:37 PM, John W. Eaton at address@hidden wrote:

> On  7-Feb-2001, Paul Kienzle <address@hidden> wrote:
> 
> | Hi!  How do I translate something like:
> | 
> |  g(i+1,:) -= l(i)*g(i,:);
> | 
> | into a .oct file?
> | 
> |  for (j=0; j<g.columns(); j++) g(i+1,j) -= l(i)*g(i,j);
> | 
> | works, but it isn't very elegant,
> 
> I can't think of a better way.  Assuming g is a Matrix object, I think
> you could use
> 
> g.insert (g.row(i+1) - l(i)*g.row(i), i+1, 0);
> 
> but that is going to generate some copies.  Probably the loop is about
> as good as you can do.
> 
> | and I do have a lot of them to do.
> 
> I suppose I would define a macro or inline function to hide the
> details.
> 
> 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
> -------------------------------------------------------------
> 

-- 
A S Hodel Assoc. Prof. Dept Elec. Comp. Eng.  Auburn Univ, AL 36849-5201
(334) 844-1854 Fax -1809 http://www.eng.auburn.edu/~scotte



-------------------------------------------------------------
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]