473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to Access upper triangular Matrix elements

Hi
i need to copy the upper triangular elements of matrix A[100][100] to an array
B[5050],how to perform this ,can u send me the accessing formula
Jul 6 '07 #1
6 4252
tnga
27
Hi
i need to copy the upper triangular elements of matrix A[100][100] to an array
B[5050],how to perform this ,can u send me the accessing formula
You mean the up-right corner? So that's half the matrix...
All you have to do is to read the lines of the matrix and everytime you read a line, start reading the next line one columm to the right. All you have to do is to write the values in array B in sequence. Did I understand correctly?

Regards
Jul 6 '07 #2
i need the mathematical formula for accessing the elements of upper triangular elements to an lineary array
Jul 6 '07 #3
i think now the question will be more clear
see we have access formula for elements in a matrix A[i][j] to an array[index]
using row major is
index=i*(no of columns)+j
similarily i want the mathematical formula for accessing the upper triangular elements in to an array using row major
Jul 6 '07 #4
tnga
27
i think now the question will be more clear
see we have access formula for elements in a matrix A[i][j] to an array[index]
using row major is
index=i*(no of columns)+j
similarily i want the mathematical formula for accessing the upper triangular elements in to an array using row major
Yes, that's what i understood after your reply...
I guess there must be something like dividing and using the rest of divisions between the position you want to get (index on B) and the length of the lines in the matrix...
I know it's wrong, but i guess it's something like this:

B[index]=a[index%n][i-index%n]

using a nxn size matrix.

Sorry, I can't help you very much on this. Just guessing...
Jul 6 '07 #5
hi thankx i got the answer
Jul 6 '07 #6
tnga
27
hi thankx i got the answer
What's the answer? Please share
Jul 6 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Duncan M Gunn | last post by:
Hi, I need to store the following matrix of values: T U V A 2 1 1 B 2 - - C - - 2 Where (-) is an empty cell.
4
by: L. | last post by:
Hello, I need to generate random Matrices (say of size 5*5), each with an average of X (say X=0.5), but with different values’ range. One matrix should have values in the range of 0-1, while...
10
by: Nevets Steprock | last post by:
I'm writing a web program where one of the sections is supposed to output a correlation matrix. The typical correlation matrix looks like this: ..23 ..34 .54 ..76 .44 .28 ..02 .77 ...
4
by: sitemap | last post by:
Hello. I have a problem to accessing the right clindNodes from the xml. I have many "step" elements with id. I want to get the attributes from the 5 "matrix" elements, depending on parent...
5
by: Je-Givara | last post by:
I want to get a Mapping Function for following sparse matrix of size NxN , where N is odd ----------------------------------------------------------------------------------- 0 0 0 0...
4
by: Je-Givara | last post by:
this is new mapping function needed for following --------------------------------------------------------------- a11 a12 a13 .... a1n 0 a22 a23 .... a2n 0 0 a33 .... a3n . ...
3
by: LolaT | last post by:
I am making a program that deals with matrices in Java. I keep getting an error and I don't know how to fix it my code so far is import java.io.*; import java.util.*; import...
1
by: anku sumbriya | last post by:
please send me the access formula of upper triangular matrix i.e how to access the elements in the upper triangle matrix
13
by: mo/-/sin | last post by:
hi........... i m mohsin plz provide me the program which represents triangular matrix in c language.........
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.