Compressed storage of special matrices for C + + array applications

Source: Internet
Author: User

Matrix:

A matrix is a mathematical model that is often used in numerical programming, which consists of a number of m rows and N columns (M=n is called a phalanx). In programs written in advanced languages, a two-dimensional array is usually used to represent the matrix, which enables each element in the matrix to find a corresponding storage location in a two-dimensional array. However, some high-order matrices with the following characteristics are often found in the calculation of numerical analysis, that is, the matrix has many values of the same or 0-valued elements, in order to save storage space, they need to "compress storage", that is, do not save or save the same value of the same or 0-valued elements.

Operation: The matrix can be added, subtract, multiply and so on.

Storage compression Target:

Save storage space

How to compress:

0 Yuan does not store

Multiple values are the same

To compress stored objects:

Sparse matrices

Special matrices

Special matrices:

A matrix with a certain regularity in the distribution of the same or 0 elements is called a special matrix example: symmetric matrices, upper (lower) triangular matrices are special matrices

Special matrix compression Storage (with symmetric matrices as an example)

Symmetric matrices are n-order matrices satisfying the following conditions: aij= aji 1<= i,j<= N

k= 0 1 2 3 4 5 6 N (n+1)/2-1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.