Boost logo

Ublas :

Subject: Re: [ublas] [bindings][traits] is_vector, is_matrix
From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2009-03-11 07:46:15

Chris Rodgers wrote:
> On 11/03/2009 09:16, Rutger ter Borg wrote:
>> Karl Meerbergen wrote:
>>> Rutger,
>>> I am not always in favour of common names for different operations on
>>> the bindings level.
>>> Similarly, one could argue whether it is a good idea to have a function
>>> eig(), e.g. for unsymmetric and symmetric matrices, since their
>>> interface looks the same, but it is not the same (think of complex or
>>> real eigenvalues). using the same names for everything suggests the
>>> user
>>> not to think any longer about what he is doing (like in matlab).
> My vote would be to collapse things into short names e.g. eig(),
> solve() as much as it is possible to distinguish the different forms
> based on the types of the input arguments.

This is what I wanted to warn for. eig() is a good example for not doing
In the documentation you would have to write that for a Hermitian
matrix, the eigenvalue vector and eigenvector matrix must be real and
for a non-Hermitan vector and matrix, they must be complex. These are
rather different situations, which I believe can better be dealt with by
different function names.

The user will have to check whether his problem is symmetric or not
anyway, so why making it difficult to him by hiding this ...

For linear systems, I agree with a unique name.


> As a backup, it would be good to have some low-level names if you know
> exactly what method you wish to call.
> I think that this would go a long way towards making C++ linear
> algebra more user-friendly.
> Yours,
> Chris.
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]