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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:58:30+00:00 2026-05-11T18:58:30+00:00

I have two equations I’m solving on each recursive round: X = A –

  • 0

I have two equations I’m solving on each recursive round:

X = A – inv(B) * Y * inv(B),
X = X + A’ * inv(B) * A,

I solve the problem this way:

C = inv(B)Y <=> BC = Y, solve C.
D = C
inv(B) <=> DB = C <=> B’D’ = C’, solve D’

E = inv(B)*A <=> BE = A, solve E.

All matrices change over time, so I have to do this (or inverting) again every recursion. N is usually about 1-10, possibly more, but usually something like that. B is positive definite so I can use cholesky on factorisation, and then solve equations of multiple right hand sides.

Is this much slower or faster than just inverting B and then doing matrix multiplications with that? One invertion vs solving three systems of linear equations (there’s that another equation too) plus some transposing. I would think it’s at least numerically more stable than inverting?

Thanks.

  • 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-11T18:58:30+00:00Added an answer on May 11, 2026 at 6:58 pm

    First of all, let’s assume that all your matrixes are of order n x n. The cholesky factorization can then be done in O(n^3/6) operations (for large values of n).

    Solving B*c(i) = y(i) or L*L’*c(i) = y(i) (Cholesky) is 2*O(n^2/2) or O(n^2), but solving BC=Y is solving n of these equations (because Y is n x n), so at total we have O(n^3).

    Solving D’ is obviously analogous to this, so another O(n^3).

    Transposing D’ to D is rougly O(n^2), no calculations though, just swapping of data (apart from the diagonal elements which of course are the same).

    Solving E in BE = A in the second formula is backwards substitution of cholesky factorization once more, so O(n^3)

    A’ * E is n^2 * (n mult and n-1 add) which is O(2*n^3 – n^2)

    This sums up to: O(n^3/6) + 3*O(n^3) + O(n^2) + O(2*n^3 – n^2) ~ O(31*n^3/6) ~ O(5*n^3) (for large values of n)

    Note that I haven’t calculated the matrix additions/subtractions, but this isn’t relevant because they will be the same if we decide to invert B. I have also skipped A to A’ for the same reasons.

    Ok, so how expensive is inverting a matrix? Well we wan to solve the matrix equation:

    B * inv(B) = I, which is the same as solving B * x(i) = e(i) for i=1..n, where e(i) are the base unit vectors in I. This is usually done by using gauss elimination to transform the system to a triangular form, which takes about O(n^3/3) operations. When the triangulation is made it takes O(n^2/2) operations to solve it (backwards substitution). But this has to be done n times, which gives us a total of O(n^4/3) + O(n^3/2) operations, so as you can see we are already over the edge.

    However, calculating inv(B) when knowing the cholesky factorization of B is O(n^3) (because solving L*L’*inv(B) = I is the same as solving BE=A)

    So we then have: O(n^3/6) (cholesky of B) + O(n^3) (calculating inv(B) with cholesky) + 4*O(2n^3-n^2) (four matrix multiplications) ~ O(9*n^3) which is a little bit better, but still worse.

    So I suggest that you stay with your current approach. But you have to keep in mind that this is for large values of n. Unless n is 100+ I don’t think it matters that much anyway.

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

Sidebar

Ask A Question

Stats

  • Questions 206k
  • Answers 206k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could easily use mcrypt or a custom AES encryption… May 12, 2026 at 9:15 pm
  • Editorial Team
    Editorial Team added an answer I could be wrong (I haven't done AS2 for a… May 12, 2026 at 9:15 pm
  • Editorial Team
    Editorial Team added an answer You can use commercial datagrid. I had recently worked with… May 12, 2026 at 9:15 pm

Related Questions

I have two equations I'm solving on each recursive round: X = A -
I have two problems. I have to calculate two equations: X = A -
I have two simple while loops in my program that I feel ought to
I have two Haskell functions, both of which seem very similar to me. But
I have an application in which users interact with each-other. I want to visualize

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.