Re: push_back in ublas

David Bellot via ublas <[email protected]> Thu, 13 Jun 2019 09:01:56 +1000
Newsgroups gmane.comp.lib.boost.ublas
Message-ID <CAOE6ZJEY8uyoPNS=6T5fH_ZLuK-5201daUCi9KkNaFifMpPcxw@mail.gmail.com>
--===============4837655303797637444==
Content-Type: multipart/alternative; boundary="000000000000f749c0058b28677b"

--000000000000f749c0058b28677b
Content-Type: text/plain; charset="UTF-8"

>
> I  think push_back does only make sense for vectors. I would prefer a
> free fuction such as 'cat' that can operate also on tensors.
>

Being also an R programmer, I like the functional approach with free
functions. It also makes sense from a template point of view.
It's indeed a 'cat' or 'c' we need. In R for example, you also have rbind
and cbind for adding rows or columns to matrices/data.frame and 'c' for
anything which looks like a vector. It's very convenient to use.

For a ublas::vector, it seems pretty obvious. For a matrix? Or a tensor?
>> If I decide to represent all the vectors as matrices now, they become row
>> and column vectors then.
>>
>> Should I expect the same effect on doing a push_back to a row vector and
>> a column vector?
>>
>> In general, could we make ublas STL compatible in general (means
>> vector/matrix/tensor are STL compatible)?
>> Does my question even make sense?
>>
>

> Makes totally sense. I have already sth prepared. We can do it very
> generic.
>

Awesome. Could you create a branch in the git and push your code on that
branch so that we can start playing with it/

Cheers,
David

--000000000000f749c0058b28677b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex"><div dir=3D"auto"><div dir=3D"auto">I=C2=A0<span style=
=3D"font-family:sans-serif">=C2=A0think push_back does only make sense for =
vectors. I would prefer a free fuction such as &#39;cat&#39; that can opera=
te also on tensors.</span></div></div></blockquote><div><br></div><div clas=
s=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;font-si=
ze:small">Being also an R programmer, I like the functional approach with f=
ree functions. It also makes sense from a template point of view.</div><div=
 class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;fo=
nt-size:small">It&#39;s indeed a &#39;cat&#39; or &#39;c&#39; we need. In R=
 for example, you also have rbind and cbind for adding rows or columns to m=
atrices/data.frame and &#39;c&#39; for anything which looks like a vector. =
It&#39;s very convenient to use.</div><div class=3D"gmail_default" style=3D=
"font-family:arial,helvetica,sans-serif;font-size:small"><br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex"><div dir=3D"auto"><div class=3D"g=
mail_quote" dir=3D"auto"><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">=
<div dir=3D"ltr"><div style=3D"font-family:arial,helvetica,sans-serif;font-=
size:small"><span class=3D"gmail_default" style=3D"font-family:arial,helvet=
ica,sans-serif;font-size:small"></span>For a ublas::vector, it seems pretty=
 obvious. For a matrix? Or a tensor?</div><div style=3D"font-family:arial,h=
elvetica,sans-serif;font-size:small">If I decide to represent all the vecto=
rs as matrices now, they become row and column vectors then.</div><div styl=
e=3D"font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div=
 style=3D"font-family:arial,helvetica,sans-serif;font-size:small">Should I =
expect the same effect on doing a push_back to a row vector and a column ve=
ctor?</div><div style=3D"font-family:arial,helvetica,sans-serif;font-size:s=
mall"><br></div><div style=3D"font-family:arial,helvetica,sans-serif;font-s=
ize:small">In general, could we make ublas STL compatible in general (means=
 vector/matrix/tensor are STL compatible)?</div><div style=3D"font-family:a=
rial,helvetica,sans-serif;font-size:small">Does my question even make sense=
?</div></div></blockquote></div><div dir=3D"auto"></div></div></blockquote>=
<div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=
=3D"auto"><div dir=3D"auto">Makes totally sense. I have already sth prepare=
d. We can do it very generic.<br></div></div></blockquote><div><br></div><d=
iv class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;=
font-size:small">Awesome. Could you create a branch in the git and push you=
r code on that branch so that we can start playing with it/</div><div class=
=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;font-siz=
e:small"><br></div><div class=3D"gmail_default" style=3D"font-family:arial,=
helvetica,sans-serif;font-size:small">Cheers,</div><div class=3D"gmail_defa=
ult" style=3D"font-family:arial,helvetica,sans-serif;font-size:small">David=
</div></div></div>

--000000000000f749c0058b28677b--

--===============4837655303797637444==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline