-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in CertainRows/Columns #188
Comments
The command
As you see from the method, first all rows from the upper matrix are extracted, then all rows from the lower one. @kamalsaleh s solution is valid, but produces a lot of matrices in between. |
mohamed-barakat
added a commit
to mohamed-barakat/homalg_project
that referenced
this issue
Dec 21, 2017
mohamed-barakat
added a commit
to mohamed-barakat/homalg_project
that referenced
this issue
Dec 21, 2017
and updated affected outputs in examples accordingly
HereAround
pushed a commit
to HereAround/homalg_project
that referenced
this issue
Jun 18, 2020
and updated affected outputs in examples accordingly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hallo,
The output of the command CertainRows/CertainColumns applied on a matrix (for which HasEvalUnionOfRows/Columns is set to be true) may be wrong.
Bellow is an example of this situation.
LoadPackage( "rings" );
R := HomalgFieldOfRationals();
A := HomalgMatrix( "[ 1,2,3,4,5,6 ]", 2, 3, R );
B := HomalgMatrix( "[ 1,2,2,2,1,1, 1,1,1,0,2,4 ]", 4, 3, R );
u1 := UnionOfColumns( A, HomalgZeroMatrix( 2, 3, R ) );
u2 := UnionOfColumns( HomalgZeroMatrix( 4, 3, R ), B );
u := UnionOfRows( u1, u2 );
Display( u );
[ [ 1, 2, 3, 0, 0, 0 ],
[ 4, 5, 6, 0, 0, 0 ],
[ 0, 0, 0, 1, 2, 2 ],
[ 0, 0, 0, 2, 1, 1 ],
[ 0, 0, 0, 1, 1, 1 ],
[ 0, 0, 0, 0, 2, 4 ] ]
Display( CertainRows( u, [ 2, 1 ] ) );
[ [ 4, 5, 6, 0, 0, 0 ],
[ 1, 2, 3, 0, 0, 0 ] ]
Display( CertainRows( u, [ 3, 1 ] ) );
[ [ 1, 2, 3, 0, 0, 0 ],
[ 0, 0, 0, 1, 2, 2 ] ]
You can find a solution to this in my master branch (not sure if it is the best possible):
kamalsaleh@4879149
The text was updated successfully, but these errors were encountered: