Boost logo

Ublas :

Subject: [ublas] Extending Numeric Bindings: UMFPACK
From: Bruno Abreu Calfa (bacalfa_at_[hidden])
Date: 2011-11-06 21:33:14

Hello everyone,

I wanted to call the UMFPACK function "get_di_numeric" and I realized it is
not implemented in the numeric bindings package. So I appended the
following methods to the respective files:

// File: umfpack.hpp

template <typename T>
int getLunz (int* lnz, int* unz, int* n_row, int* n_col,
        int* nz_udiag, numeric_type<T> const& Numeric)
    return detail::getLunz(lnz, unz, n_row, n_col, nz_udiag, Numeric.ptr);

template <typename T, typename VecI, typename VecR, typename MatrA>
int getNumeric (MatrA& Lx, MatrA& Ux, VecI& P, VecI& Q,
        VecR& Dx, int* do_recip, VecR& Rs,
        numeric_type<T> const& Numeric)
    return detail::getNumeric(traits::spmatrix_index1_storage(Lx),

// File: umfpack_overloads.hpp

int getLunz (int *lnz, int *unz, int *n_row, int *n_col, int *nz_udiag,
        void *Numeric)
    return umfpack_di_get_lunz (lnz, unz, n_row, n_col, nz_udiag, Numeric);

int getNumeric (int* Lp, int* Lj, double* Lx,
        int* Up, int* Ui, double* Ux, int* P,
        int* Q, double* Dx, int *do_recip,
        double* Rs, void *Numeric)
    return umfpack_di_get_numeric (Lp, Lj, Lx, Up, Ui, Ux,
            P, Q, Dx, do_recip, Rs, Numeric);

Then, I ran the code in the attachment. The L matrix is all zeros, but if I
print the report from UMFPACK it works and obviously shows L and U not all
zeros. I am suspecting that the values are not being copied correctly to my
matrices. Does anyone have any idea why?

Thank you very much.