Discussion:
[Pyublas] .real part of matrix as argument
Neal Becker
2010-06-04 12:49:17 UTC
Permalink
Unfortunately, it seems that if my function is:

F (pyublas::numpy_matrix<double>)

Then if I pass it my_array.real, I get:

cpm.cpm_siso(numpy.ndarray, float, numpy.ndarray, numpy.ndarray,
numpy.ndarray, numpy.ndarray)
did not match C++ signature:
cpm_siso(pyublas::numpy_matrix<double,
boost::numeric::ublas::basic_row_major<unsigned long, long> >, double,
pyublas::numpy_vector<double>, pyublas::numpy_vector<double>,
pyublas::numpy_matrix<int, boost::numeric::ublas::basic_row_major<unsigned
long, long> >, pyublas::numpy_matrix<int,
boost::numeric::ublas::basic_row_major<unsigned long, long> >)

I have to pass instead my_array.real.copy().

I wonder if this could be fixed?
Andreas Kloeckner
2010-06-18 20:24:04 UTC
Permalink
Post by Neal Becker
F (pyublas::numpy_matrix<double>)
cpm.cpm_siso(numpy.ndarray, float, numpy.ndarray, numpy.ndarray,
numpy.ndarray, numpy.ndarray)
cpm_siso(pyublas::numpy_matrix<double,
boost::numeric::ublas::basic_row_major<unsigned long, long> >, double,
pyublas::numpy_vector<double>, pyublas::numpy_vector<double>,
pyublas::numpy_matrix<int, boost::numeric::ublas::basic_row_major<unsigned
long, long> >, pyublas::numpy_matrix<int,
boost::numeric::ublas::basic_row_major<unsigned long, long> >)
I have to pass instead my_array.real.copy().
I wonder if this could be fixed?
This boils down to a stride. Non-1 strides in matrices are, as of right
now, not supported. This could be fixed, but would again entail forcing
PyUblas onto a strided-by-default storage base for matrices, where the
same speed tradeoffs as for vectors enter in even more severe form.

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pyublas/attachments/20100618/02c6aa33/attachment.pgp>
Loading...