Hi,
Can you think of some "selection matrix" to select only certain colum
vectors of a matrix?
For example,
X=[x1 x2 x3 x4] where xi is a column vector.
I would like to have a matrix J such that
XJ or JX will be [x1 x3] by selecting only 1st and 3rd columns of the
matrix.
Thanks in advance.
.
On Jan 20, 2:41 pm, usuiisu <ikuy…@gmail.com> wrote:
> Hi,
> Can you think of some "selection matrix" to
> select only certain colum vectors of a matrix?
> For example,
> X=[x1 x2 x3 x4] where xi is a column vector.
> I would like to have a matrix J such that
> XJ or JX will be [x1 x3] by selecting only
> 1st and 3rd columns of the matrix.
> Thanks in advance.
To get columns 1 and 3, postmultiply X by
J = {{1,0},
{0,0},
{0,1},
{0,0}}.
On Thu, 20 Jan 2011 14:41:19 -0800, usuiisu wrote:
> Hi,
> Can you think of some "selection matrix" to select only certain colum
> vectors of a matrix?
> For example,
> X=[x1 x2 x3 x4] where xi is a column vector. I would like to have a
> matrix J such that XJ or JX will be [x1 x3] by selecting only 1st and
> 3rd columns of the matrix.
That depends on the programming language you’re using.
In Scilab (Matlab) X[(1,3,7)] is a matrix with the 1st, 3rd, 7th
column of the original matrix X.
In C++ you can use the "Eigen" matrix package (IMHO, the best (free) one)
(see http://eigen.tuxfamily.org/)
There you can access the column of a matrix A by saying A.col(i).
And, using the ‘<<’ operator, you can build a matrix of out other
matrices.
See http://eigen.tuxfamily.org/dox-devel/QuickRefPage.html
Helmut.
- Hide quoted text — Show quoted text -
On Fri, 21 Jan 2011 09:10:57 -0800, aruzinsky wrote:
> 1. The license, at
> http://eigen.tuxfamily.org/index.php?title=Licensing_FAQ, is overly
> verbose bullshit. The authors are assholes for even expecting
> non-lawyers to read that.
> 2. Those authors’ C++ classes are likely to conflict with one’s own C+ +
> classes. Amazingly those authors expect the World to revolve around
> their C++ classes.
> 3. In stark contrast, free, well written C code is available at
> http://mymathlib.webtrellis.net/matrices/ which has no legal strings
> other than copyright. The developer must be a true philanthropist
> because he or she does not even give their full name, only initials.
> 4. The C code at http://mymathlib.webtrellis.net/matrices/ is easily
> integrated into one’s own C++ classes.
This shadows some light on the author!
For all others:
I have been using Eigen for teaching as well as for time critical
applications with the best experience only.
Anybody criticizing Eigen should show me a package which integrates well
with C++ (no C-like packages, please) which has optional index checking
with only 2 characters to change AND with a performance which even comes
close to that of Eigen!
But, believe whom you like to believe.
Helmut Jarausch
RWTH-Aachen University
Germany
"usuiisu" <ikuy…@gmail.com> wrote in message news:84788d70-de48-41ad-928b-cce21ffbb6cf@v26g2000yqf.googlegroups.com…
| Hi,
|
| Can you think of some "selection matrix" to select only certain colum
| vectors of a matrix?
| For example,
| X=[x1 x2 x3 x4] where xi is a column vector.
| I would like to have a matrix J such that
| XJ or JX will be [x1 x3] by selecting only 1st and 3rd columns of the
| matrix.
In PL/I —
To get the first column , use x(*,1).
Toget the third column, use x(*,3).
The complete operation would be:
y(*,1) = x(*,1);
y(*,2) = x(*,3);
"aruzinsky" <aruzin…@general-cathexis.com> wrote in message
news:4c189118-bebc-4dbd-8ce6-f1d778c45d21@k22g2000yqh.googlegroups.com…
>Please, stop perpetuating the delusion that the OP’s question has
>something to do with some programming language.
The OP’s question implies a programming approach.
But even if that was not his intention, he can easily ignore my post.
On the other hand, your own posts are about programming.
On Jan 24, 5:01 am, "robin" <robi…@dodo.mapson.com.au> wrote:
- Hide quoted text — Show quoted text -
> "usuiisu" <ikuy…@gmail.com> wrote in
> messagenews:84788d70-de48-41ad-928b-cce21ffbb6cf@v26g2000yqf.googlegroups.com…
> | Hi,
> |
> | Can you think of some "selection matrix" to select only certain colum
> | vectors of a matrix?
> | For example,
> | X=[x1 x2 x3 x4] where xi is a column vector.
> | I would like to have a matrix J such that
> | XJ or JX will be [x1 x3] by selecting only 1st and 3rd columns of the
> | matrix.
> In PL/I —
> To get the first column , use x(*,1).
> Toget the third column, use x(*,3).
> The complete operation would be:
> y(*,1) = x(*,1);
> y(*,2) = x(*,3);
"aruzinsky" <aruzin…@general-cathexis.com> wrote in message
news:aeb4d8ef-3320-45bb-991a-dc1d17186ef8@l22g2000vbp.googlegroups.com…
>On Jan 25, 7:35 am, "robin" <robi…@dodo.mapson.com.au> wrote:
>> "aruzinsky" <aruzin…@general-cathexis.com> wrote in message
>> news:4c189118-bebc-4dbd-8ce6-f1d778c45d21@k22g2000yqh.googlegroups.com…
>> >Please, stop perpetuating the delusion that the OP’s question has
>> >something to do with some programming language.
>> The OP’s question implies a programming approach.
>You are wrong.
That’s up to the OP to decide, not you.
I say that the question implies a programming approach.
>> But even if that was not his intention, he can easily ignore my post.
>But, you are wrong
That’s for the OP to decide, not you.
> and I am doing you a favor
You are not doing anyone any favor.
If you don’t like my post, you don’t have to read it.