Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7593879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:16:46+00:00 2026-05-30T21:16:46+00:00

I’d like to seek some help with the DPOTRS function from LAPACK when being

  • 0

I’d like to seek some help with the DPOTRS function from LAPACK when being called from within C. Yes, I am aware that the matrix I am trying to work with is positive definite (with Eigenvalues 3, 1 in fact!)

Right now my function doesn’t work correctly. It returns an incorrect result.

double A[] = {2.0, 1.0, 1.0, 2.0};
double b[] = {1.5, 0.0};
printf("%5.3f %5.3f\n", b[0], b[1]);
info = dpotrs('U',2,1,A,2,b,2);
printf("%d\n", info);
printf("%5.3f %5.3f\n", b[0], b[1]);

This is the code. dpotrs is manually imported using this code:

static long dpotrs(char UPLO, long N, long NRHS, double* A, long LDA, double* B, long LDB)
{
    extern void dpotrs_(char* UPLOp, long* Np, long* NRHSp, double* A, long* LDAp, double* B, long* LDBp, long* infop);
    long info;
    dpotrs_(&UPLO, &N, &NRHS, A, &LDA, B, &LDB, &info);
    return info;
}

It returns the wrong result! The correct result would be 1.000,-0.500

However, I recieve 0.469,-0.188

But on top of that, info returns 0, as if it went well!

And that, ladies and gentlemen, boggles my mind.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:16:47+00:00Added an answer on May 30, 2026 at 9:16 pm

    I think you need to read some documentation:

    *
    *  Purpose
    *  =======
    *
    *  DPOTRS solves a system of linear equations A*X = B with a symmetric
    *  positive definite matrix A using the Cholesky factorization
    *  A = U**T*U or A = L*L**T computed by DPOTRF.
    *
    

    The input matrix to DPOTRS must be an already Cholesky factorized matrix in LAPACK upper or lower triangular format. You have skipped a step. Factorize your A with DPOTRF first, then use it to solve for one or more right hand sides with DPOTRS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have some data like this: 1 2 3 4 5 9 2 6
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.