Boost logo

Ublas :

Subject: Re: [ublas] Extending Numeric Bindings: UMFPACK
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2011-11-07 03:45:32


On 2011-11-07 03:33, Bruno Abreu Calfa wrote:
> 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>
> inline
> 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>
> inline
> 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),
> traits::spmatrix_index2_storage(Lx),
> traits::spmatrix_value_storage(Lx),
> traits::spmatrix_index1_storage(Ux),
> traits::spmatrix_index2_storage(Ux),
> traits::spmatrix_value_storage(Ux),
> traits::vector_storage(P),
> traits::vector_storage(Q),
> traits::vector_storage(Dx),
> do_recip,
> traits::vector_storage(Rs),
> Numeric.ptr
> );
> }
>
>
> // File: umfpack_overloads.hpp
>
> inline
> 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);
> }
>
> inline
> 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.
>
>
> Bruno
>
>

Hello Bruno,

I see you're using bindings version 1. Have you tried those at

http://svn.boost.org/svn/boost/sandbox/numeric_bindings/

?

Regards,

Rutger