Boost logo

Ublas :

Subject: Re: [ublas] Assignement operation proposal.
From: Nasos Iliopoulos (nasos_i_at_[hidden])
Date: 2010-03-28 20:22:20


Hi Gunter,

> . However I miss a method which jumps to the first column of the next
> row (or first row of next column).
This will be a very usefull addition. I will put it in soon.

> Further it should be explained which
> orientation is used to fill the matrix because most (C++-)people expect
> to give values row by row, but it could also be col-by-col or native
> (using the orientation of the matrix).
> To reduce number of surprises one could define "always row-by-row" and
> provice trans(m) << 1,2,3... for col-by-col assignement. (Some
> "automatic" choice seems to be dangerous to me.)

That's right, we need something for that. The default behaviour is row by row and I also feel it should probably be "always" row by row( with trans(m) << .... , the col_by_col assignment).
The other way is to provide something like:

m << fill_policy::traverse_by_column(), 1, 2, 3 ...
or
m << fill_policy::traverse_by_row(), 1, 2, 3 ...

(with by_row been the default). I will probably implement them both.

I was thinking of the native approach (using the orientation of the matrix), but I am not sure whether it will be better just because of performance, or it will just confuse people. What do other people think?

I was also thinking to add a "repeat" adaptor, so that you could do:
m1 << repeat(stepy, stepx, num_of_repetitions), expression_to_repeat, other_stuff...;
but I will take it easy for the next couple of weeks.

Best
Nasos

> Date: Mon, 29 Mar 2010 01:04:23 +0200
> From: guwi17_at_[hidden]
> To: ublas_at_[hidden]
> Subject: Re: [ublas] Assignement operation proposal.
>
> Hello Nasos,
>
> Nasos Iliopoulos schrieb:
> >
> > Dear all,
> >
> > [vector/matrix assignement proposal]
> >
>
> the description of the updated patch look very promising, see
>
> <https://svn.boost.org/trac/boost/ticket/4034#comment:1>
>
> . However I miss a method which jumps to the first column of the next
> row (or first row of next column). Further it should be explained which
> orientation is used to fill the matrix because most (C++-)people expect
> to give values row by row, but it could also be col-by-col or native
> (using the orientation of the matrix).
> To reduce number of surprises one could define "always row-by-row" and
> provice trans(m) << 1,2,3... for col-by-col assignement. (Some
> "automatic" choice seems to be dangerous to me.)
>
> mfg
> Gunter
>
>
>
> __________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 4980 (20100328) __________
>
> E-Mail wurde geprüft mit ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: nasos_i_at_[hidden]
                                               
_________________________________________________________________
The New Busy is not the old busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3