|
Ublas : |
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2008-09-01 16:22:01
Dominik Szczerba schrieb:
> is it also available for small dense matrices?
>
no - only sparse types can use a different index base. Why is such a
feature important for dense matrices?
A workaround is to create a custom matrix class like
// untested
class my_matrix : public matrix<double> {
...
const double & operator() (size_type i, size_type j) const {
return matrix<double>::operator()(i-1, j-1);
}
>>> - unfold a matrix into vector, like in matlab v=m(:)
>>>
>> It's possible, though not 'officially' supported.
>>
>
> any hint how? just referencing the first element of the matrix?
>
Yes. You can always use &(v.data()[0]) to get a raw pointer to the data.