[Top][All Lists]

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

Matrices in liboctave

From: John W. Eaton
Subject: Matrices in liboctave
Date: Fri, 7 May 1999 21:26:25 -0500 (CDT)

On  8-May-1999, Eduardo Gallestey <address@hidden> wrote:

| I am transforming some of my "octave" code into C++ programs. For that,
| of course, I am using "liboctave". Now, by looking at the "liboctave"
| code, I have been able to figure out, how most of the operations should
| be carried out. However, I've got problems with commands like:
| A=[A11 A12; A21 A22];
| where Aij are given matrices. I guess, it must be some combination of 
| template <class T>
| void
| Array2<T>::resize (int r, int c, const T& val)
| with 
| template <class T>
| Array2<T>&
| Array2<T>::insert (const Array2<T>& a, int r, int c)
| but, what I get is something awkward.
| Has somebody tried that? I would appreciate any hints.

You could use the append and stack functions defined in dMatrix.h or
CMatrix.h, but resize followed by a series of insert operations is
going to be more efficient because you only have to resize and copy


reply via email to

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