- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please, help me. I'm using dgels function (declared in mkl_lapack.h) from MKL LAPACK package in my program on C++. I can't understand how should I store my full matrix in one-dimensional array - in column-major or row-major format.
For example, if matrix A=
(1.0 2.0)
(3.0 4.0)
(5.0 6.0)
then the array should be
1.1) [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] (row-major format) or
1.2) [1.0, 3.0, 5.0, 2.0, 4.0, 6.0] (column-major format).
And if Ax=b, where b is a vector (7.0, 8.0, 9.0), then b will be overwritten by the solution vector like
2.1) [x1, x2, 9.0] or
2.2) [x1, 8.0, x2].
For example, if matrix A=
(1.0 2.0)
(3.0 4.0)
(5.0 6.0)
then the array should be
1.1) [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] (row-major format) or
1.2) [1.0, 3.0, 5.0, 2.0, 4.0, 6.0] (column-major format).
And if Ax=b, where b is a vector (7.0, 8.0, 9.0), then b will be overwritten by the solution vector like
2.1) [x1, x2, 9.0] or
2.2) [x1, 8.0, x2].
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In case you didn't find answers in MKL docs,
http://www.netlib.org/clapack/readme
describes the storage from the C point of view (column-major)
I think you would have to specify more about your usage to understand the second part of your question. However, in the cases where the result doesn't use all the entries of b, it is the leading entries which are over-written.
http://www.netlib.org/clapack/readme
describes the storage from the C point of view (column-major)
I think you would have to specify more about your usage to understand the second part of your question. However, in the cases where the result doesn't use all the entries of b, it is the leading entries which are over-written.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - topol555
Please, help me. I'm using dgels function (declared in mkl_lapack.h) from MKL LAPACK package in my program on C++. I can't understand how should I store my full matrix in one-dimensional array - in column-major or row-major format.
For example, if matrix A=
(1.0 2.0)
(3.0 4.0)
(5.0 6.0)
then the array should be
1.1) [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] (row-major format) or
1.2) [1.0, 3.0, 5.0, 2.0, 4.0, 6.0] (column-major format).
And if Ax=b, where b is a vector (7.0, 8.0, 9.0), then b will be overwritten by the solution vector like
2.1) [x1, x2, 9.0] or
2.2) [x1, 8.0, x2].
For example, if matrix A=
(1.0 2.0)
(3.0 4.0)
(5.0 6.0)
then the array should be
1.1) [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] (row-major format) or
1.2) [1.0, 3.0, 5.0, 2.0, 4.0, 6.0] (column-major format).
And if Ax=b, where b is a vector (7.0, 8.0, 9.0), then b will be overwritten by the solution vector like
2.1) [x1, x2, 9.0] or
2.2) [x1, 8.0, x2].
Please look at the following link:
ttp://software.intel.com/sites/products/documentation/hpc/mkl/lapack/mkl_lapack_examples/index.htm
you can find there the C example of DGELS routine.
/* Solve the equations A*X = B */
dgels( "No transpose", &m, &n, &nrhs, a, &lda, b, &ldb, work, &lwork, &info );
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!
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