| |

VerySource

 Forgot password?
 Register
Search
View: 817|Reply: 3

Diagonal matrix compression storage of a data structure

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-5 15:50:01
| Show all posts |Read mode
Which friend can answer? Convert an n-diagonal matrix matrix a [i] [j] (n = 1.2.3 ...) into a one-dimensional matrix sa [k]

  How to calculate the relationship between k and i, j?

  E.g. two diagonal matrix
    k = i + j-1
    But how did you get it?

  Thank you
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-20 23:09:02
| Show all posts
up
Reply

Use magic Report

2

Threads

20

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-22 16:00:02
| Show all posts
Well, this is so prescribed, there are not many reasons, just remember that k = i + j-1
This can save nearly half of the storage space.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-26 17:45:01
| Show all posts
Well, that's it, there is not much why, just remember that k = i+j-1
This saves nearly half of the storage space
This is not an answer
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list