Boost logo

Boost Users :

From: jhr.walter_at_[hidden]
Date: 2003-04-27 05:45:49


Hi Patrick,

you wrote:

> Answering myself,

That happens sometimes ;-)

> without a symmetric type I can just check for a diagonal matrix inside the
> pinv function and branch, see code below.

As far as I've understood you're looking for a type safe diagonal variant of
banded_matrix. Would it be helpful, if we'd go to add something like

    // Diagonal matrix class
    template<class T, class F, class A>
    class diagonal_matrix:
        public banded_matrix<T, F, A> {
    public:
        BOOST_UBLAS_USING banded_matrix<T, F, A>::operator =;
        typedef banded_matrix<T, F, A> matrix_type;

        // Construction and destruction
        BOOST_UBLAS_INLINE
        diagonal_matrix ():
            matrix_type () {}
        BOOST_UBLAS_INLINE
        diagonal_matrix (std::size_t size1, std::size_t size2):
            matrix_type (size1, size2) {}
        BOOST_UBLAS_INLINE
        ~diagonal_matrix () {}

        // Assignment
        BOOST_UBLAS_INLINE
        diagonal_matrix &operator = (const diagonal_matrix &m) {
            matrix_type::operator = (m);
            return *this;
        }
    };

and the corresponding diagonal_adaptor to the code base?

> Are there some recommendations for namespaces for functions like "pinv" ?
> Inside the loop, shall I use size_type?

I currently haven't enough time to look into a SVD implementation. So I'll
cc this reply to http://groups.yahoo.com/group/ublas-dev.

HTH,

Joerg

[snip]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net