- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I'm a beginner in using MKL library , Actually I want to solve a system of equation by calling dgetf and dgetrs function , but the segmentation fault error always appear when I run my program. The equation is Ax=B, which A is a dim*dim array and B is a dim array. Here is the part of my program which solves the system of equation
void Solve(int dim, double* A, double* B)
{
int* piv = new int [dim];
int info = 0;
int nhrs = 1;
char p = 'T';
dgetrf(&dim, &dim, A, &dim, piv, &info);
if(info)
{
printf("Fact failed -- %d\\n", info);
for(int i = 0; i < dim; i ++)
{
for(int j = 0; j < dim; j ++)
printf("%e\\t", A[i*dim+j]);
printf("\\n");
}
exit(0);
}
cout<<"\\n","\\n";
dgetrs(&p, &dim, &nhrs, A,&dim, piv, B, &dim, &info);
if(info)
{
printf("Solve failed -- %d\\n", info);
exit(0);
}
free(piv);
}
It would be highly appreciated if you can hel me .링크가 복사됨
10 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
You have posted a fragment of a program. There is no point in listing all the possible ways in which that fragment could be expanded into a runnable program that causes a runtime error. Nor is there much to gain from posting one example of code that runs correctly, even though this is quite a bit easier to do.
Present a complete example and you will improve the chances that someone will tell you what the mistakes are.
Present a complete example and you will improve the chances that someone will tell you what the mistakes are.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Thanksfor your comment , I didn't get your meaning , here is the function which should solve my system of equation Ax=B, where A is the Matrix ofcoefficient, and in a n*n array , and b is the right side of my equation which is a n array . This is a complete example forexampleif youputA={1,2,1,2,1,1,1,1,0} and B={230} and send it ti the Sole the error segmentation fault appears.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I checked the problem with the version 10.2 Update7. win7. 32bit. No exceptions were found with the inputs you pointed.
for example - see the results after dgetrf
dgetrf passed -- 0
2.000000e+000 5.000000e-001 5.000000e-001
1.000000e+000 1.500000e+000 3.333333e-001
1.000000e+000 5.000000e-001 -6.666667e-001
--Gennady
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
"mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib"
if you need I can send the VS2008 project with yourexample.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Thank you so much, my question is that do you know which libraries are equal to this library in linux version , I'm using a linux version of mkl library so I don't know which library I should link for this new version because the guide library for last version is omitted in this version .
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Enough has changed since the MKL which had libguide, and enough depends on input from you, that the link advisor at the top of this forum would be better than taking a guess, although basically there's a direct correspondence between libraries needed for Windows and those for linux.
