- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi there,

I am currently working on a two-dimensional ADI Crank-Nicolson algorithm using the pardiso and cspblas packages. In order to use the Alternating-Direction-Implicit (ADI) method, I need to solve a linear system of equations Ax = By, where x and y are single columns and single rows from a 2D matrix. However I am having difficulty thinking of a way to extract singular rows and columns from a matrix.

Is there a fast way I can slice an array using the MKL package such that I do not have to iterate over my array every step?

In other languages this can be done by indexing in such a way Ax[1,:] = By[1,:] for example.

Thanks,

Dylan

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Dylan,

You mentioned using the pardiso and cspblas packages. So can I suppose the loop and extract singular rows and columns from a matrix are needed only in phase 3 steps. right?

and X and Y single columns and single rows from a 2D matrix. can you name row or column?

I guess, it may be column. then it should be ok for call pardiso and cspblas without exacting.

As Pardiso support multiply right hand. So you can call one blas function to compute B*Y=> Z as multiply right hand (each column is a zi ) . then you can get all of xi at pardiso phase 3 once. Thus no iteration are needed.

phase – integer, execution control. There are three major phases in the solving

process and one service phase

• Phase 1: Fill-in reduction analysis and symbolic factorization

pardiso()

• Phase 2: Numerical factorization

pardiso()

• Phase 3: Forward and Backward solve including iterative refinements

• Release Memory (phase ≤ 0).

If either xi and yi are row, you may reorig the AX=YB etc and using multiply right -hand support to get what you wanted.

Best Regards,

Ying

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Ying,

Thanks for the response.

Can I use cblas to perform matrix-vector multiplication with multiple vectors at once?

For example A*X_{i} = B_{i}, where A,X and B are NxN matrices, and B_{i} is the i^{th} column of B.

Thanks,

Dylan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Dylan,

If i understand correctly, yes, cblas_dgemm perform matrix -matrix multiplication, that equal matrix-vector multiplication with multiply vectors at once.

for example, for (i loop) Ci = A*Bi

cblas_dgemv(CblasRowMajor,CblasNoTrans,N,N,alpha,a,N,&b

*,N,beta,&c*

*,N);*. cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, m, n, k, alpha, A, k, B, n, beta, C, n);

Best Regards,

Ying

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page