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 6701907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:59:24+00:00 2026-05-26T06:59:24+00:00

I am converting a Fortran program to C#. This has to be done in

  • 0

I am converting a Fortran program to C#. This has to be done in bits and pieces, with proof of concepts along the way.

One of these initial steps is to replicate the IMSL functions it uses. Luckily, it only uses a chosen few: some trivial random number generation, some trivial normal distribution inverts but also one not-so-trivial one: MCHOL.

From the documentation:

Computes an upper triangular factorization of a real symmetric matrix A plus a diagonal matrix D, where D is determined sequentially during the Cholesky factorization in order to make A + D nonnegative definite.

Routine MCHOL computes a Cholesky factorization, RTR, of A + D where A is symmetric and D is a diagonal matrix with sufficiently large diagonal elements such that A + D is nonnegative definite. The routine is similar to one described by Gill, Murray, and Wright (1981, pages 108−111). Here, though, we allow A + D to be singular.

(There are more details and a sample at the link).

For my proof of concept, I need to able to replicate the results as provided in the sample for the MCHOL documentation: passing in this matrix from the sample:

  DATA (A(1,J),J=1,N)/36.0, 12.0, 30.0, 6.0, 18.0/
  DATA (A(2,J),J=1,N)/12.0, 20.0, 2.0, 10.0, 22.0/
  DATA (A(3,J),J=1,N)/30.0, 2.0, 29.0, 1.0, 7.0/
  DATA (A(4,J),J=1,N)/6.0, 10.0, 1.0, 14.0, 20.0/
  DATA (A(5,J),J=1,N)/8.0, 22.0, 7.0, 20.0, 40.0/

And getting the following in return:

  6.000   2.000   5.000   1.000   3.000
  0.000   4.000  -2.000   2.000   4.000
  0.000   0.000   0.000   0.000   0.000
  0.000   0.000   0.000   3.000   3.000
  0.000   0.000   0.000   0.000   2.449

So far, I’ve tried using Math.NET, but it will not run on this example matrix because it is not positive definite.

I’ve also tried parts of ALGLIB, specifically spdmatrixcholesky. It seems to work, but only for part of the matrix:

  6       2       5       1       3
  12      4       -2      2       4
  30      2       0       1       7
  6       10      1       14      20
  8       22      7       20      40

Does anyone have any idea what I am doing wrong here? Do I need to call a different function here?

Since a quick answer doesn’t seem to be in the cards, it might be best if I understood the underlying mathematics so I can at least try to figure out what is going on here. Any theoretical underpinning or pointers appreciated as well.

  • 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-26T06:59:25+00:00Added an answer on May 26, 2026 at 6:59 am

    The MCHOL routine is not just doing Cholesky decomposition, it is doing the steps of Cholesky and keeping track of the D diagonals that let it keep going. It’s a “modified” Cholesky. Normal Cholesky needs a positive definite input, which the example is not.

    Here’s an implementation of MCHOL in MATLAB. I would use this implementation to build a .NET version.

    Wikipedia:Cholesky decomposition

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

Sidebar

Related Questions

Converting non-negative Integer to its list of digits is commonly done like this: import
Im converting an OBJ-C application to C# and am having trouble with this one:
Im converting this simple program from vb to c# it updates, displays, create and
Is converting a file to a byte array the best way to save ANY
I am converting from existing CVS repository to SVN repository. CVS repository has few
I have a fortran program generating unformatted files and I am trying to read
Converting an old vs2003 project to vs2010, and I've stumbled on one error: cannot
Converting from Django, I'm used to doing something like this: {% if not var1
While converting a project that used SlimDX, and therefore has unmanaged code, to .NET
We're converting some .NET 3.5 code to Java (Android). This Java code gives the

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.