- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you check the following example?
void test_mkl_dcsrmv()
{
// |1 1||0|=|1|
// |0 1||1| |1|
int size = 2;
double one = 1.0;
double entries[] = {1.0, 1.0, 1.0};
int adjncy[] = {0, 1, 1};
int pntrb[] = {0, 2};
int pntre[] = {1, 2};
double x[] = {0.0, 1.0};
double y[] = {0.0, 0.0};
// y = alpha*A*x + beta*y
mkl_dcsrmv("N", &size, &size, &one, "G**C", entries, adjncy, pntrb, pntre,
x, &one, y);
std::cout << "y=[" << y[0] << "," << y[1] << "]\n";
// Should print "y=[1,1]". Right?
}
As a matter of fact, it prints "y=[0,0]". Why????
Thanks!
Could you check the following example?
void test_mkl_dcsrmv()
{
// |1 1||0|=|1|
// |0 1||1| |1|
int size = 2;
double one = 1.0;
double entries[] = {1.0, 1.0, 1.0};
int adjncy[] = {0, 1, 1};
int pntrb[] = {0, 2};
int pntre[] = {1, 2};
double x[] = {0.0, 1.0};
double y[] = {0.0, 0.0};
// y = alpha*A*x + beta*y
mkl_dcsrmv("N", &size, &size, &one, "G**C", entries, adjncy, pntrb, pntre,
x, &one, y);
std::cout << "y=[" << y[0] << "," << y[1] << "]\n";
// Should print "y=[1,1]". Right?
}
As a matter of fact, it prints "y=[0,0]". Why????
Thanks!
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - agnonchik
Hi,
Could you check the following example?
void test_mkl_dcsrmv()
{
// |1 1||0|=|1|
// |0 1||1| |1|
int size = 2;
double one = 1.0;
double entries[] = {1.0, 1.0, 1.0};
int adjncy[] = {0, 1, 1};
int pntrb[] = {0, 2};
int pntre[] = {1, 2};
double x[] = {0.0, 1.0};
double y[] = {0.0, 0.0};
// y = alpha*A*x + beta*y
mkl_dcsrmv("N", &size, &size, &one, "G**C", entries, adjncy, pntrb, pntre,
x, &one, y);
std::cout << "y=[" << y[0] << "," << y[1] << "]n";
// Should print "y=[1,1]". Right?
}
As a matter of fact, it prints "y=[0,0]". Why????
Thanks!
Could you check the following example?
void test_mkl_dcsrmv()
{
// |1 1||0|=|1|
// |0 1||1| |1|
int size = 2;
double one = 1.0;
double entries[] = {1.0, 1.0, 1.0};
int adjncy[] = {0, 1, 1};
int pntrb[] = {0, 2};
int pntre[] = {1, 2};
double x[] = {0.0, 1.0};
double y[] = {0.0, 0.0};
// y = alpha*A*x + beta*y
mkl_dcsrmv("N", &size, &size, &one, "G**C", entries, adjncy, pntrb, pntre,
x, &one, y);
std::cout << "y=[" << y[0] << "," << y[1] << "]n";
// Should print "y=[1,1]". Right?
}
As a matter of fact, it prints "y=[0,0]". Why????
Thanks!
The representation ofyour matrix in CSR fromat is not correct in your program. In your case, the values of thearray pntre must be
int pntre[] = {2, 3};
intead of your setting
int pntre[] = {1, 2};
If we replace the values of pntre by {2, 3 }, we get y=[1,1] as it should be.
All the best
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Sergey!
Now it works.
Now it works.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page