We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have tried to use the submatrix method for initializing a 10 x 5 matrix N from the first columns and rows of the 10 x 10 matrix M.
I am probably missing something, since it seems that N is not assigned the expected values of M (all ones). Any suggestions?
#include <iostream> #include <string> #include "gurls++/gvec.h" #include "gurls++/gmat2d.h" using namespace gurls; using namespace std; typedef double T; int main() { gMat2D<T> M(gMat2D<T>::zeros(10,10)+1); cout << "M initialized: " << endl << M << endl; gMat2D<T> N(gMat2D<T>::zeros(10,5)); // Initialize N M.submatrix(N , 10 , 5); cout << "N initialized: " << endl << N << endl; }
Output:
kammo@kammo-Latitude-E5540:~/Repos/gurlssandbox/build/bin$ ./submatrixTest M initialized: [ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ] N initialized: [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]
Thank you.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have tried to use the submatrix method for initializing a 10 x 5 matrix N from the first columns and rows of the 10 x 10 matrix M.
I am probably missing something, since it seems that N is not assigned the expected values of M (all ones). Any suggestions?
Output:
Thank you.
The text was updated successfully, but these errors were encountered: