ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> scipy-user
scipy-user
Re: [SciPy-user] Trouble with linsolve
by Nils Wagner other posts by this author
Nov 28 2006 7:57AM messages near this date
[SciPy-user] Trouble with linsolve | Re: [SciPy-user] Trouble with linsolve
Nils Wagner wrote:
>  Hi all,
> 
>  I would like to solve
> 
>  K_dyn x = f,
> 
>  where K_dyn is a sparse matrix.  UMFPACK is not installed and I am using
>  the latest svn version.
> 
>    
> >>> K_dyn
> >>>         
>  <71987x71987 sparse matrix of type '<type 'numpy.float64'>'
>          with 3083884 stored elements (space for 3083884)
>          in Compressed Sparse Column format>
>    
> >>> f
> >>>         
>  <71987x1 sparse matrix of type '<type 'numpy.float64'>'
>          with 52 stored elements (space for 52)
>          in Compressed Sparse Column format>
>    
> >>> x = spsolve(K_dyn, f)
> >>>         
>  Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>    File
>  "/usr/local/lib64/python2.4/site-packages/scipy/linsolve/linsolve.py",
>  line 75, in spsolve
>      b = asarray(b, dtype=data.dtype)
>    File "/usr/local/lib64/python2.4/site-packages/numpy/core/numeric.py",
>  line 132, in asarray
>      return array(a, dtype, copy=False, order=order)
>  ValueError: setting an array element with a sequence.
> 
>  Is this a bug ?
> 
>  Nils
> 
>  _______________________________________________
>  SciPy-user mailing list
>  SciPy-user@[...].org
>  http://projects.scipy.org/mailman/listinfo/scipy-user
>    

With UMFPACK V4.4 I get

    x = spsolve(K_dyn, f)
  File "/usr/lib64/python2.4/site-packages/scipy/linsolve/linsolve.py",
line 65, in spsolve
    return umf.linsolve( umfpack.UMFPACK_A, mat, b, autoTranspose = True )
  File
"/usr/lib64/python2.4/site-packages/scipy/linsolve/umfpack/umfpack.py",
line 566, in linsolve
    sol = self.solve( sys, mtx, rhs, autoTranspose )
  File
"/usr/lib64/python2.4/site-packages/scipy/linsolve/umfpack/umfpack.py",
line 508, in solve
    self._numeric, self.control, self.info )
  File
"/usr/lib64/python2.4/site-packages/scipy/linsolve/umfpack/_umfpack.py",
line 214, in umfpack_di_solve
    return __umfpack.umfpack_di_solve(*args)
TypeError: not an array

> >> K_dyn
<71987x71987 sparse matrix of type '<type 'numpy.float64'> '
        with 3083884 stored elements (space for 3083884)
        in Compressed Sparse Column format> 
> >> f
<71987x1 sparse matrix of type '<type 'numpy.float64'> '
        with 52 stored elements (space for 52)
        in Compressed Sparse Column format> 
> >> shape(f)
(71987, 1)
> >> shape(K_dyn)
(71987, 71987)
> >> type(f)
<class 'scipy.sparse.sparse.csc_matrix'> 
> >> type(K_dyn)
<class 'scipy.sparse.sparse.csc_matrix'> 

Any pointer would be appreciated.

Nils

Numpy version 1.0.1.dev3462
Scipy version 0.5.2.dev2334
amd_info:
    libraries = ['amd']
    library_dirs = ['/usr/local/src/UMFPACKv4.4/AMD/Lib']
    define_macros = [('SCIPY_AMD_H', None)]
    swig_opts = ['-I/usr/local/src/UMFPACKv4.4/AMD/Include']
    include_dirs = ['/usr/local/src/UMFPACKv4.4/AMD/Include']

umfpack_info:
    libraries = ['umfpack', 'amd']
    library_dirs = ['/usr/local/src/UMFPACKv4.4/UMFPACK/Lib',
'/usr/local/src/UMFPACKv4.4/AMD/Lib']
    define_macros = [('SCIPY_UMFPACK_H', None), ('SCIPY_AMD_H', None)]
    swig_opts = ['-I/usr/local/src/UMFPACKv4.4/UMFPACK/Include',
'-I/usr/local/src/UMFPACKv4.4/AMD/Include']
    include_dirs = ['/usr/local/src/UMFPACKv4.4/UMFPACK/Include',
'/usr/local/src/UMFPACKv4.4/AMD/Include']

_______________________________________________
SciPy-user mailing list
SciPy-user@[...].org
http://projects.scipy.org/mailman/listinfo/scipy-user
Thread:
Nils Wagner
Nils Wagner
Bill Baxter
Nils Wagner
Nils Wagner

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved