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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:08:15+00:00 2026-05-23T18:08:15+00:00

How would look the code that can transform an upper triangular matrix into a

  • 0

How would look the code that can transform an upper triangular matrix into a full matrix.
The matrix is in a vector, not in a bidimensional array…

so the array

[ 1 2 3 4
  0 5 6 7
  0 0 8 9
  0 0 0 10 ]

would become an array like:

[ 1 2 3 4
  2 5 6 7
  3 6 8 9
  4 7 9 10 ]

could you provide some ideas, I was thinking in applying a kind of module or something…

There is one restriction, I am not using bidimensional arrays
I am usng a vector, so is a unidimensional array

  • 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-23T18:08:16+00:00Added an answer on May 23, 2026 at 6:08 pm

    First, you must understand the fundemtnal nature of a reflected matrix. For any i, j, the following assertion is true:

    m[i][j] ≡ m[j][i]
    

    So, you need some algorithm to make that true. May I suggest:

    for(int i = 0; i < HEIGHT; ++i)
      for(int j = 0; j < i; ++j)
        m[i][j] = m[j][i];
    

    Note the condition of the 2nd loop. By ensuring that j is always less than i, we restrict our activity to the bottom-left triangle.

    Next, you must understand how you have implemented a two-dimensional matrix in a one-dimensional array. It appears that you have established the identity:

    m[i][j] ≡ v[i*WIDTH+j]
    

    Substituting, we have:

    for(int i = 0; i < HEIGHT; ++i)
      for(int j = 0; j < i; ++j)
        v[i*WIDTH+j] = v[j*WIDTH+i];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can someone give me a hint on how a histogram's pseudo code would look
I'm trying to create a Python script that would : Look into the folder
Have a look here: In the following code, what would be the type of
Im looking to create a control that would look like comic baloon. In WPF
Could someone show me a regular expression that would look through this document and
In Java, it would look like this: class Foo { float[] array; } Foo
i want to realize a construct in MS SQL that would look like this
How do you create a desktop application using C# that would look like Visual
I'm writing some code that uses a Tree (a regular tree that can have
Can someone show me code that takes an image from a server and puts

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.