CN116186045A - Sparse matrix adjustment method and device, electronic equipment and storage medium - Google Patents

Sparse matrix adjustment method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116186045A
CN116186045A CN202310188820.7A CN202310188820A CN116186045A CN 116186045 A CN116186045 A CN 116186045A CN 202310188820 A CN202310188820 A CN 202310188820A CN 116186045 A CN116186045 A CN 116186045A
Authority
CN
China
Prior art keywords
array
coordinate
sparse matrix
target
adjusted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310188820.7A
Other languages
Chinese (zh)
Inventor
刘浩洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Big Data Research Institute Of Peking University
Peking University
Original Assignee
Chongqing Big Data Research Institute Of Peking University
Peking University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Big Data Research Institute Of Peking University, Peking University filed Critical Chongqing Big Data Research Institute Of Peking University
Priority to CN202310188820.7A priority Critical patent/CN116186045A/en
Publication of CN116186045A publication Critical patent/CN116186045A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2237Vectors, bitmaps or matrices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Feedback Control In General (AREA)

Abstract

The invention discloses a sparse matrix adjustment method, a sparse matrix adjustment device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a sparse matrix to be adjusted, wherein the sparse matrix to be adjusted comprises a first element meeting a preset condition; generating a target array corresponding to the sparse matrix to be adjusted, wherein the target array at least comprises: an element value array, a coordinate array, a start array, and a stop array; and adjusting the sparse matrix to be adjusted based on the target array. The invention solves the technical problem of low adjustment accuracy of adjusting the sparse matrix.

Description

Sparse matrix adjustment method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and apparatus for adjusting a sparse matrix, an electronic device, and a storage medium.
Background
In scientific computing, a matrix is one of the most basic data types. A matrix can be generally considered as a two-dimensional representation of an array of m rows and n columns, which typically requires the storage of m x n data. With the increase of the computing scale, how to store data efficiently is a great challenge, and if the data cannot be stored efficiently, the data has an influence on the operation and the operation of the subsequent matrix with a specific structure.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a sparse matrix adjusting method, a sparse matrix adjusting device, electronic equipment and a storage medium, which are used for at least solving the technical problem of low adjusting accuracy of adjusting the sparse matrix.
According to an aspect of the embodiment of the present invention, there is provided a method for adjusting a sparse matrix, including: acquiring a sparse matrix to be adjusted, wherein the sparse matrix to be adjusted comprises a first element meeting a preset condition; generating a target array corresponding to the sparse matrix to be adjusted, wherein the target array at least comprises: the system comprises an element value array, a coordinate array, a starting array and a terminating array, wherein the element value array is used for storing element values of first elements, the coordinate array is used for storing first coordinates of the first elements in a sparse matrix to be adjusted, the starting array is used for storing positions of the first elements meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array, and the total length of the element value array, and the terminating array is used for storing positions of last elements meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array; and adjusting the sparse matrix to be adjusted based on the target array.
Optionally, generating an element value array corresponding to the sparse matrix to be adjusted includes: traversing the sparse matrix to be adjusted based on a first preset rule to generate an initial element value array, wherein elements in the initial element value array all meet preset conditions; expanding the length of a storage space of an initial element value array based on a target format and a first coordinate to obtain an expanded initial element value array, wherein the target format is used for representing the number of rows and the number of columns of a sparse matrix to be adjusted, the length of a subarray of each row or each column in the initial element value array is smaller than or equal to the length of the target format, and element adjacent relations in the initial element value array are in one-to-one correspondence with element adjacent relations in the sparse matrix to be adjusted; filling preset values into preset positions of the expanded initial element value array to obtain the element value array, wherein the preset positions are used for representing positions without first elements after expansion, and the preset values are values with zero element values.
Optionally, generating the coordinate array corresponding to the sparse matrix to be adjusted includes: determining a first position of a first element in the element value array; and storing the first coordinates of the first element to a target position in a coordinate array, wherein the lengths of the element value array and the coordinate array are the same.
Optionally, generating a start array corresponding to the sparse matrix to be adjusted includes: traversing an element value array or a coordinate array; and storing the position of the initial first element of different columns or rows in the element value array or the coordinate array to obtain an initial array.
Optionally, generating a termination array corresponding to the sparse matrix to be adjusted includes: traversing an element value array or a coordinate array; and storing the position of the termination first element of different columns or rows in the element value array or the coordinate array to obtain a termination array.
Optionally, the method further comprises: determining whether the second element meets a preset condition or not in response to the change of the second element in the sparse matrix to be adjusted; and updating the target array based on the second element in response to the second element meeting the preset condition.
Optionally, updating the element value array based on the second element includes: determining a second coordinate of a second element in the sparse matrix to be adjusted; comparing the second coordinate with the first coordinate, and determining a second position of the second element in the element value array based on the second coordinate in response to the second coordinate being different from the first coordinate; determining a first target element stored in a first preset position in the element value array, wherein the first target element meets a preset condition, and the first preset position comprises: a second position, and a preset number of positions after the second position; the second element is stored to the second location and the first target element is stored at a location subsequent to the second location.
Optionally, in response to the second coordinate being the same as the first coordinate, the method further comprises: determining the position of the second element in the element value array as a first position; the second element is stored at the first location.
Optionally, updating the coordinate array based on the second element includes: determining a second coordinate of a second element in the sparse matrix to be adjusted; comparing the second coordinate with the first coordinate, and determining a second position of the second element in the coordinate array based on the second coordinate in response to the second coordinate being different from the first coordinate; determining a first target coordinate stored in a first preset position in a coordinate array, wherein the first target coordinate is a coordinate corresponding to a first element, and the first preset position comprises: a second position, and a preset number of positions after the second position; the coordinates of the second element are stored to the second location and the first target coordinates are stored at a location subsequent to the second location.
Optionally, in response to the second coordinate being the same as the first coordinate, the method further comprises: determining the position of the second element in the coordinate value array as a first position; the second element is stored at the first location.
Optionally, updating the termination array based on the second element includes: determining a new position of the last element in the updated element value array; determining a second target position of the last element in the termination array; updating the data stored at the second target location in the termination array based on the new location.
Optionally, determining the first target element stored in the first preset position in the element value array includes: responding to the second position as a preset position in the element value array, wherein the preset position is a position of a target column or a target row corresponding to the second coordinate in the element value array, expanding the length of the storage space of the target array based on the sparse matrix to be adjusted to obtain an expanded target array, and updating the expanded target array based on the second element; and determining the first target element stored in the element value array in response to the second position not being the preset position.
According to another aspect of the embodiment of the present invention, there is also provided an adjustment apparatus for a sparse matrix, including: the acquisition module is used for acquiring a sparse matrix to be adjusted, wherein the sparse matrix to be adjusted comprises first elements meeting preset conditions; the generating module is used for generating a target array corresponding to the sparse matrix to be adjusted, wherein the target array at least comprises: the system comprises an element value array, a coordinate array, a starting array and a terminating array, wherein the element value array is used for storing element values of first elements, the coordinate array is used for storing first coordinates of the first elements in a sparse matrix to be adjusted, the starting array is used for storing positions of the first elements meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array, and the total length of the element value array, and the terminating array is used for storing positions of last elements meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array; and the adjusting module is used for adjusting the sparse matrix to be adjusted based on the target array.
According to another aspect of the embodiment of the present invention, there is also provided an electronic device, including: one or more processors; a storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method for adjusting the sparse matrix of any of the above.
According to another aspect of the embodiments of the present invention, there is also provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, the processor of the device where the program is controlled to execute the method for adjusting the sparse matrix of any one of the above.
In the embodiment of the invention, a sparse matrix to be adjusted is acquired, wherein the sparse matrix to be adjusted contains a first element meeting a preset condition; generating a target array corresponding to the sparse matrix to be adjusted, wherein the target array at least comprises: the system comprises an element value array, a coordinate array, a starting array and a terminating array, wherein the element value array is used for storing element values of first elements, the coordinate array is used for storing first coordinates of the first elements in a sparse matrix to be adjusted, the starting array is used for storing positions of the first elements meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array, and the total length of the element value array, and the terminating array is used for storing positions of last elements meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array; and storing the target array. It is easy to note that, the new column termination array that puts forward in this application can realize reserving and compressing mechanism, further, through obtaining the first element that satisfies the preset condition in the sparse matrix of waiting to adjust, and based on first element generates corresponding target array, can make the efficient storage of data in the array, and then can carry out accurate adjustment to sparse matrix based on the target array, reached the purpose that can the efficient storage array, thereby realized improving the technological effect of the adjustment accuracy of adjusting sparse matrix, and then solved the technical problem that the adjustment accuracy of adjusting sparse matrix is low.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a flow chart of a method for adjusting a sparse matrix according to an embodiment of the present invention;
FIG. 2a is a schematic diagram of an alternative sparse matrix to be adjusted according to an embodiment of the present invention;
FIG. 2b is a schematic diagram of an alternative destination array in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of an alternative fill target array reservation blank in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative sparse matrix insertion element to be adjusted in accordance with an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an adjustment device for sparse matrix according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
According to an embodiment of the present invention, there is provided an embodiment of a method for adjusting a sparse matrix, it being noted that the steps shown in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in an order different from that herein.
Fig. 1 is a flowchart of a method for adjusting a sparse matrix according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, a sparse matrix to be adjusted is obtained, wherein the sparse matrix to be adjusted comprises first elements meeting preset conditions.
The sparse matrix to be adjusted can be a sparse matrix needing to store an array, the specific matrix type is not limited in the embodiment, a user can select the sparse matrix according to actual requirements, and in the embodiment, the sparse matrix to be adjusted can be any sparse matrix to be adjusted. Wherein, the sparse matrix is a matrix with most elements being zero, and only non-zero parts are recorded when recording, thereby achieving the purpose of saving memory resources. The preset condition may be a condition set by the user in advance and used for screening the first element, where the preset condition may be that the element value is not equal to zero, but not limited to, but also may be that the element value is not equal to any number, and the specific numerical value user may set by himself according to the actual requirement.
In an alternative embodiment, when the array needs to be stored, the sparse matrix to be adjusted and the first element in the sparse matrix to be adjusted, which meets the preset condition, may be acquired first.
Step S104, generating a target array corresponding to the sparse matrix to be adjusted, wherein the target array at least comprises: the system comprises an element value array, a coordinate array, a starting array and a terminating array, wherein the element value array is used for storing element values of a first element, the coordinate array is used for storing first coordinates of the first element in a sparse matrix to be adjusted, the starting array is used for storing positions of the first element meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array, and the total length of the element value array, and the terminating array is used for storing positions of the last element meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array.
The first coordinate may be a coordinate capable of representing the number of rows and columns where the first element is located in the sparse matrix to be adjusted.
Optionally, generating an element value array corresponding to the sparse matrix to be adjusted includes: traversing the sparse matrix to be adjusted based on a first preset rule to generate an initial element value array, wherein elements in the initial element value array all meet preset conditions; expanding the length of a storage space of an initial element value array based on a target format and a first coordinate to obtain an expanded initial element value array, wherein the target format is used for representing the number of rows and the number of columns of a sparse matrix to be adjusted, the length of a subarray of each row or each column in the initial element value array is smaller than or equal to the length of the target format, and element adjacent relations in the initial element value array are in one-to-one correspondence with element adjacent relations in the sparse matrix to be adjusted; filling preset values into preset positions of the expanded initial element value array to obtain the element value array, wherein the preset positions are used for representing positions without first elements after expansion, and the preset values are values with zero element values.
The first preset rule may be a rule set by a user in advance for traversing the sparse matrix to be adjusted, for example, a rule that traverses with column preference, or a rule that traverses with row preference, but the specific rule is not limited to this, and the specific rule is not limited in this embodiment. The initial element value array may be an element value array obtained by traversing the sparse matrix to be adjusted according to a first preset rule, where elements in the initial element value array all meet a first preset condition. The above-mentioned preset value may be a value set in advance by the user for filling the preset position, and may be zero in order not to change the number of the first elements stored in the sparse matrix to be adjusted, but is not limited thereto.
In an optional embodiment, when generating an element value array corresponding to the sparse matrix to be adjusted under the condition that the first preset rule is column-first, traversing the sparse matrix to be adjusted according to the column-first based on the first preset rule to generate an initial element value array, wherein elements in the initial element value array all meet preset conditions; secondly, the length of a storage space of an initial element value array can be expanded based on a target format and a first coordinate of the sparse matrix to be adjusted, wherein the length of each subarray in the expanded initial element value array is smaller than or equal to the number of rows of the sparse matrix to be adjusted, the number of subarrays is smaller than or equal to the number of columns of the sparse matrix to be adjusted, and the position of each element in the expanded initial element value array is unchanged and is consistent with the position of the element in the sparse matrix to be adjusted, so that the element adjacent relation in the expanded initial element value array is in one-to-one correspondence with the element adjacent relation in the sparse matrix to be adjusted; and filling preset values into preset positions of the expanded initial element value array to obtain the element value array.
In another optional embodiment, when the first preset rule is line-first, an element value array corresponding to the sparse matrix to be adjusted can be generated first, the sparse matrix to be adjusted can be traversed with line-first based on the first preset rule first, and an initial element value array is generated, wherein elements in the initial element value array all meet preset conditions; secondly, the length of a storage space of an initial element value array can be expanded based on a target format and a first coordinate of the sparse matrix to be adjusted, wherein the length of each subarray in the expanded initial element value array is smaller than or equal to the number of columns of the sparse matrix to be adjusted, the number of subarrays is smaller than or equal to the number of rows of the sparse matrix to be adjusted, and the position of each element in the expanded initial element value array is unchanged and is consistent with the position of the element in the sparse matrix to be adjusted, so that the element adjacent relation in the expanded initial element value array is in one-to-one correspondence with the element adjacent relation in the sparse matrix to be adjusted; and filling preset values into preset positions of the expanded initial element value array to obtain the element value array.
Optionally, generating the coordinate array corresponding to the sparse matrix to be adjusted includes: determining a first position of a first element in the element value array; and storing the first coordinates of the first element to a target position in a coordinate array, wherein the lengths of the element value array and the coordinate array are the same.
The first location may be a location where the first element is stored in an element value array. The target position may be a position in the coordinate array corresponding to the first position of the first element.
In an alternative embodiment, after the element value array of the sparse matrix to be adjusted is generated, first, a first position of the first element in the element value array may be determined, and second, row coordinates of the first element may be stored in a target position in a coordinate array, where a length of the coordinate array is the same as a length of the element value array.
In another alternative embodiment, after generating the element value array of the sparse matrix to be adjusted, first, a first position of the first element in the element value array may be determined, and second, column coordinates of the first element may be stored in a target position in a coordinate array, where a length of the coordinate array is the same as a length of the element value array.
Optionally, generating a start array corresponding to the sparse matrix to be adjusted includes: traversing an element value array or a coordinate array; and storing the position of the initial first element of different columns or rows in the element value array or the coordinate array to obtain an initial array.
In an alternative embodiment, after obtaining the element value array and the coordinate array, because the lengths of the element value array and the coordinate array are the same, and the first positions of the element value array and the target positions of the coordinate array are in one-to-one correspondence, traversing the element value array or the coordinate array can be selected, and the position sequence values of the initial first elements in different columns in the element value array or the coordinate array are stored, so that the initial array can be obtained.
In another alternative embodiment, the element value array or the coordinate array may be traversed selectively, and the position sequence value of the first element of different rows in the element value array or the coordinate array may be stored, so as to obtain the start array.
Optionally, generating a termination array corresponding to the sparse matrix to be adjusted includes: traversing an element value array or a coordinate array; and storing the position of the termination first element of different columns or rows in the element value array or the coordinate array to obtain a termination array.
In an alternative embodiment, after obtaining the element value array and the coordinate array, because the lengths of the element value array and the coordinate array are the same, and the first positions of the element value array and the target positions of the coordinate array are in one-to-one correspondence, traversing the element value array or the coordinate array can be selected, and the position sequence values of the termination first elements of different columns in the element value array or the coordinate array are stored, so that the termination array can be obtained.
In another alternative embodiment, the element value array or the coordinate array may be traversed selectively, and the position sequence value of the termination first element of different rows in the element value array or the coordinate array may be stored, so as to obtain the termination array.
And S106, adjusting the sparse matrix to be adjusted based on the target array.
In an alternative embodiment, after the target array of the sparse matrix to be adjusted is obtained, the sparse matrix to be adjusted can be adjusted based on the target array, so that a user can perform subsequent calculation based on the sparse matrix, and the accuracy and the high efficiency of the calculation can be ensured.
In another alternative embodiment, after the target array is obtained, the elements in the sparse matrix to be adjusted may be adjusted based on the element values and the positions of the elements in the target array.
Optionally, the method further comprises: determining whether the second element meets a preset condition or not in response to the change of the second element in the sparse matrix to be adjusted; and updating the target array based on the second element in response to the second element meeting the preset condition.
The second element may be an element newly input by the user to the sparse matrix to be adjusted and stored in a preset position.
In an alternative embodiment, after a new element is input into the sparse matrix to be adjusted and stored in a preset position, a second element may be obtained, whether the second element meets a preset condition may be determined in response to a change of the second element, and the target array may be updated based on the second element in response to the second element meeting the preset condition.
Optionally, updating the element value array based on the second element includes: determining a second coordinate of a second element in the sparse matrix to be adjusted; comparing the second coordinate with the first coordinate, and determining a second position of the second element in the element value array based on the second coordinate in response to the second coordinate being different from the first coordinate; determining a first target element stored in a first preset position in the element value array, wherein the first target element meets a preset condition, and the first preset position comprises: a second position, and a preset number of positions after the second position; the second element is stored to the second location and the first target element is stored at a location subsequent to the second location.
Optionally, in response to the second coordinate being the same as the first coordinate, the method further comprises: determining the position of the second element in the element value array as a first position; the second element is stored at the first location.
The second coordinate may be a coordinate capable of indicating the number of rows and columns where the second element is located in the sparse matrix to be adjusted. The second position may be a position of the second element in the element value array. The first preset position may be a position in the element value array for storing the second element and the element after the second element. The first target element may be an element stored in advance in an element value array.
In an alternative embodiment, updating the array of element values based on the second element includes: firstly, a second coordinate of a second element in the sparse matrix to be adjusted can be determined, secondly, the second coordinate can be compared with the first coordinate, when the second coordinate is different from the first coordinate, a second position of the second element stored in the element value array can be determined based on the second coordinate, then a first preset position for storing the second element in the element value array and a first target element in the first preset position can be determined, the second element can be stored in the second position in the first preset position in response to the first target element meeting a preset condition, and the first target element can be stored in a position after the second position.
In another alternative embodiment, when the second coordinate is the same as the first coordinate, firstly, the position of the second element in the element value array may be determined to be the first position corresponding to the first coordinate, and secondly, the second element may be stored in the first position, that is, the first element in the first position in the element value array may be updated to be the second element.
Optionally, updating the coordinate array based on the second element includes: determining a second coordinate of a second element in the sparse matrix to be adjusted; determining a second position of the second element in the coordinate array based on the second coordinates; comparing the second coordinate with the first coordinate, and determining a second position of the second element in the coordinate array based on the second coordinate in response to the second coordinate being different from the first coordinate; determining a first target coordinate stored in a first preset position in a coordinate array, wherein the first target coordinate is a coordinate corresponding to a first element, and the first preset position comprises: a second position, and a preset number of positions after the second position; the coordinates of the second element are stored to the second location and the first target coordinates are stored at a location subsequent to the second location.
The second position may be a position of the second element in the coordinate array. The first preset position may be a position in the coordinate array for storing the second element and the element after the second element. The first target coordinates may be coordinates corresponding to a first element stored in advance in the coordinate array.
In an alternative embodiment, after obtaining the updated element value array, first the second coordinate of the second element in the sparse matrix to be adjusted may be determined, second the second coordinate may be compared with the first coordinate, when the second coordinate is different from the first coordinate, the second position of the second element stored in the coordinate array may be determined based on the second coordinate, then the first preset position used to store the second element and the first target coordinate at the first preset position in the coordinate array may be determined, finally the coordinate of the second element may be stored at the second position in the first preset position, and the first target may be stored at a position after the second position.
In another alternative embodiment, when the second coordinate is the same as the first coordinate, firstly, the position of the second element in the coordinate value array may be determined to be the first position corresponding to the first coordinate, and secondly, the second element may be stored in the first position, that is, the first element in the first position in the coordinate value array may be updated to be the second element.
Optionally, updating the termination array based on the second element includes: determining a new position of the last element in the updated element value array; determining a second target position of the last element in the termination array; updating the data stored at the second target location in the termination array based on the new location.
In an alternative embodiment, after updating the element value array and the coordinate array based on the second element is completed, a new position of the last element in the updated element value array may be determined, a second target position of the last element in the termination array may be determined, and finally, data stored in the second target position in the termination array may be updated based on the new position.
In another alternative embodiment, when the second coordinate is different from the first coordinate, the stored data in the second target location in the termination array before and after updating is different; when the second coordinate is the same as the first coordinate, the stored data before and after updating is the same in the second target position in the termination array.
Optionally, determining the first target element stored in the first preset position in the element value array includes: responding to the second position as a preset position in the element value array, wherein the preset position is a position of a target column or a target row corresponding to the second coordinate in the element value array, expanding the length of the storage space of the target array based on the sparse matrix to be adjusted to obtain an expanded target array, and updating the expanded target array based on the second element; and determining the first target element stored in the element value array in response to the second position not being the preset position.
In an alternative embodiment, in response to the second position being a preset position of the element value array, where the preset position is a position of the target column or the target row corresponding to the second coordinate where the first element ends in the element value array, that is, in response to the target array not being expanded by a storage space length, the length of the storage space of the target array may be expanded based on the sparse matrix to be adjusted first, to obtain an expanded target array, and updating the expanded target array based on the second element; in response to the second location not being a preset location, a first target element stored in the element value array and the first preset location may be determined, the second element stored to a second location in the first preset location, and elements subsequent to the second element stored to a location subsequent to the second location.
The storage method of the array can be applied to a novel expandable numerical calculation software sparse matrix storage format, wherein the storage format introduces a reservation and compression mechanism on the basis of a column compression format. By using the reserved space in the matrix, the developer can easily fill in the sparse matrix. Meanwhile, the format retains the advantages of a column compression format, and can rapidly and efficiently perform various operations. Particularly, the storage format introduced in the invention can be mutually converted with a coordinate format or a line compression format, and has better compatibility. The invention also provides an implementation scheme of basic operation of a plurality of sparse matrixes based on the sparse matrix storage format, and the method can be further used for serving advanced operation of various sparse matrixes.
The sparse matrix designed by the invention has m rows and n columns, and totally contains nz non-zero elements, and the sparse matrix storage scheme mainly comprises 4 arrays:
1. element value array (abbreviated as pr array): the total length is nz, and the element values of the non-zero elements of the matrix are stored in a column-first manner (i.e., the non-zero elements in column 1 are stored first, the elements in column 2 are stored again, and so on). Allowing gaps between elements of different columns (and differences in column compression format);
2. row index array (abbreviated as ir array): the row coordinates of the non-zero elements of the matrix are stored in a column-first manner with a total length nz, and the elements of the pr array are corresponding. The row indexes of the same column element are arranged in an incremental way;
3. column start array (abbreviated jc array): the length is n+1, the first element of each column is positioned in an ir array and a pr array, the last element is occupied, and the total length of the pr array or the ir array is actually (larger than or equal to nz);
4. column termination array (abbreviated as jce array in this specification): the last element of each column has a length n, and the position of the last element in the ir or pr array is added by 1. The introduction of the column termination array is the key of solving the problem of low filling efficiency of the sparse matrix, and the conventional column compression format does not have the information of the array.
In this storage scheme, array jce is key to implementing reservation and compression mechanisms. For the elements and row indices in column j, its storage areas in the pr and ir arrays are jc [ j ] to jce [ j ] (not contained). Where jc [ j ] represents the value of the j-th position of the jc array. The reserved locations in column j are specified by jce [ j ] to jc [ j+1] (not included). When the sparse matrix requires dynamically adding elements, the effect of rapidly adding elements can be achieved by modifying only the local information of the ir, pr, jce array.
The invention also provides a partial sparse matrix basic operation based on the new storage format. By utilizing these operations, a user can develop various types of advanced operations. These basic operations include:
creation and reservation operations: i.e. how to create a sparse matrix of a given size using the storage format and to set reserved bits in the created matrix.
Query or insert element: i.e. how elements of a given location are quickly queried and inserted in a sparse matrix.
Traversing and basic operation: i.e. how to traverse all non-zero elements in a given sparse matrix and obtain the corresponding positions.
Compression: i.e., the reverse operation of reservation, clears reserved bits in the sparse matrix so that the elements are closely aligned.
Fig. 2a is a schematic structural diagram of an alternative sparse matrix to be adjusted according to an embodiment of the present invention, as shown in fig. 2a, the structure of the sparse matrix to be adjusted is 4*4, wherein a first column contains three elements 1, 2, 3, a second column contains one element 4, a third column contains two elements 5, 6, and a fourth column contains one element 7. Fig. 2b is a schematic structural diagram of an alternative target array according to an embodiment of the present invention, as shown in fig. 2b, the element values 1-7 are recorded in the element value array, and row coordinates corresponding to the element values 1-7 recorded in the coordinate array are respectively 0, 2, 3, 1, 2, 3, and 3, where positions without values in the element value element array and the row coordinate array are expanded positions, and are used for storing the element values and the corresponding row coordinates of the newly added element.
The invention provides a specific implementation of the sparse matrix of the invention in an object-oriented programming language (c++), but is not limited thereto and similar designs may be made in other programming languages.
1. Underlying data structure
First, a class (sparse_matrix) of a sparse matrix is defined by using an object-oriented mechanism (c++), and four arrays related to the present invention are defined, wherein in the present example, each index is stored using an integer type, and element values are stored using a double-precision type. The data type can be adjusted according to the situation when in actual implementation. All four arrays are realized by using a packaged array (vector) container of C++, and other types of containers can be replaced according to the requirements.
2. Creation and reservation
1. Creation/initialization: creating an m-row n-column all-0 sparse matrix, and initializing;
2. reservation: before storing the actual non-zero elements, the sparse matrix needs to reserve corresponding spaces in the ir array and the pr array, and after the corresponding spaces are reserved, the spaces are temporarily marked as blank, and the elements are waited to be inserted. The function reserve can be designed to reserve r elements for each column of the array, and the function of the padding (move) function is to correctly fill the reserved blank in the ir or pr array; note that if r elements are reserved per column, jc j is added with j r. Alternatively, the corresponding function may also be designed for the case where the reserved elements are different for each column.
FIG. 3 is a schematic diagram of an alternative filling the reserved blank of the target array according to the embodiment of the present invention, as shown in FIG. 4, when the element value array and the row coordinate array are not reserved, 0 in the column start array represents the position sequence of the first column start element, 3 represents the position sequence of the second column start element, 4 represents the position sequence of the third column start element, 6 represents the position sequence of the fourth column start element, 7 represents the position sequence of the next column start element, and so on; when one element is reserved for each column, the values of the column start elements are changed correspondingly, the position of the first column start element is not changed to 0, the position sequence of the second column start element is changed to 4, the position sequence of the third column start element is changed to 6, the position of the fourth column start element is changed to 9, and the position of the next column start element is changed to 11.
3. Adding and querying elements: fig. 4 is a schematic diagram of an optional sparse matrix to be adjusted according to an embodiment of the present invention, as shown in fig. 4, an element 8 is inserted at a position of a zeroth row of a first column of the matrix a, and it can be seen that a value of a starting element in a subarray where only the first column is located in the pr array is changed, a row coordinate in a subarray where only the first column is located in the ir array is changed, meanwhile, a jc array is not changed, and a position sequence of a terminating element in a subarray where only the first column is located in the jce array is changed.
From the above, when the sparse matrix has reserved bits, only the element structure of a certain column needs to be changed for each insertion operation, and the operation complexity is at most nz (j), where nz (j) is the existing element number of the j-th column. If a column compression format is adopted, the worst-case operation complexity is nz. When there is no reserved bit in the matrix, the reserved bit can be filled in a dynamic expansion mode, and then the adding operation is completed.
In the present invention, c++ can be used to give a procedure for inserting elements when there are reserved bits in the sparse matrix. The basic steps are to find the insertion position in the ir array and the pr array, and then insert the positions. An element v may be inserted at the (i, j) position of the matrix by an insert function, where i represents the i-th row, j represents the j-th column, and v represents the element value.
It should be noted that the insertion function in the example can only work when there are reserved bits in the sparse matrix, and the reserved bits will be reduced by 1 after the elements are successfully inserted. Alternatively, when there are no reserved bits in the sparse matrix, the elements may be reserved and inserted first, but this approach introduces additional overhead and is not suitable for all situations.
The query for sparse matrix elements may be accomplished by:
a) Inputting element positions (i, j) to be queried;
b) Inquiring jc [ j ] and jce [ j ] to obtain the range of inquiry;
c) Using a binary search for whether the corresponding range in the ir array contains i;
d) If the query is successful, returning the value of the corresponding position of pr, otherwise, returning 0.
The query operation is efficient, requiring at most log (nz (j)) operations. Alternatively, the query process may be performed by a query index (search_index) function, and preferably, the search_index may adopt a binary search manner, so that code performance may be improved.
4. Transformation/traversal of sparse matrix with coordinate format
The developer can conveniently construct the sparse matrix format from the sparse matrix of the coordinate format, and the method comprises the following specific steps:
a) A matrix in the form of input coordinates { (i, j, v) }, where i represents the i-th row, j represents the j-th column, and v represents the element value;
b) Rearranging elements of the matrix in the form of coordinates according to the sequence of column priority;
c) Removing v=0 elements and merging the same-position elements;
d) The ir, jc, pr, jce array in the format is constructed in the existing order.
On the other hand, the format of the present invention can be converted into a coordinate format using an algorithm, wherein the algorithm can also be used to traverse a sparse matrix to perform various operations.
5. Compression: the sparse matrix format in the present invention has two states: compressed and uncompressed. The interconversion between the two states can be achieved by both reservation and compression operations.
In the compressed state, all elements of the matrix are arranged in sequence, with no reserved bits. The latter n elements of jce array and jc array are identical at this time, and the format in the present invention is practically equivalent to the column compression format. Thus, the column compression format is a special case of the sparse matrix storage format described above. In a compressed state, the sparse matrix occupies smaller space and is more suitable for various operations of the sparse matrix, and the advantages of a column compression format are inherited.
In the non-compressed state, reserved bits exist between adjacent column elements of the sparse matrix, and the jce array and the jc array are different. This mode is more suitable for modification of sparse matrix structures. The matrix in the compressed state may be changed to the uncompressed state by adding reserved bits for each column through reserved operations. When the sparse matrix structure is constructed, the sparse matrix structure can be changed into a compressed state through compression operation, so that the performance is further improved.
By applying the reserved operation, the sparse matrix in the compressed state can be converted into the non-compressed state, or a matrix in the non-compressed state can be added with more reserved bits so as to enlarge the maximum non-zero element number which can be accommodated by the matrix. By applying the compression operation, the reserved bits in the matrix in the non-compression state can be deleted, so that the memory of the computer is saved, and the operation efficiency is improved.
In summary, the present invention provides a novel scalable sparse matrix storage method. By adding the jce array and introducing the reserved bit and the non-compressed state, the storage mode can improve the expandability of the sparse matrix under the condition of maintaining the operation performance, and solves the problem of low efficiency of dynamically modifying the sparse matrix structure.
Example 2
According to another aspect of the embodiments of the present invention, there is further provided a sparse matrix adjustment apparatus, which may execute the sparse matrix adjustment method provided in the foregoing embodiment 1, and the specific implementation manner and the preferred application scenario are the same as those of the foregoing embodiment 1, and are not described herein in detail.
Fig. 5 is a schematic structural diagram of an adjustment device for sparse matrix according to an embodiment of the present invention, as shown in fig. 5, the device includes: the obtaining module 52 is configured to obtain a sparse matrix to be adjusted, where the sparse matrix to be adjusted includes a first element that meets a preset condition; the generating module 54 is configured to generate a target array corresponding to the sparse matrix to be adjusted, where the target array at least includes: the system comprises an element value array, a coordinate array, a starting array and a terminating array, wherein the element value array is used for storing element values of first elements, the coordinate array is used for storing first coordinates of the first elements in a sparse matrix to be adjusted, the starting array is used for storing positions of the first elements meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array, and the total length of the element value array, and the terminating array is used for storing positions of last elements meeting preset conditions in each row or each column of the sparse matrix to be adjusted in the element value array; the adjustment module 56 is configured to adjust the sparse matrix to be adjusted based on the target array.
Optionally, the generating module includes: the first traversing unit is used for traversing the sparse matrix to be adjusted based on a first preset rule to generate an initial element value array, wherein elements in the initial element value array all meet preset conditions; the expansion unit is used for expanding the length of the storage space of the initial element value array based on the target format and the first coordinate to obtain an expanded initial element value array, wherein the target format is used for representing the number of rows and the number of columns of the sparse matrix to be adjusted, the length of the subarray of each row or each column in the initial element value array is smaller than or equal to the length of the target format, and the element adjacent relation in the initial element value array corresponds to the element adjacent relation in the sparse matrix to be adjusted one by one; and the filling unit is used for filling preset values into preset positions of the expanded initial element value array to obtain the element value array, wherein the preset positions are used for representing positions without the first element after expansion, and the preset values are values with zero element values.
Optionally, the generating module further includes: a first determining unit, configured to determine a first position of a first element in the element value array; and the first storage unit is used for storing the first coordinates of the first element to the target position in the coordinate array, wherein the lengths of the element value array and the coordinate array are the same.
Optionally, the generating module further includes: the second traversing unit is used for traversing the element value array or the coordinate array; and the second storage unit is used for storing the positions of the initial first elements of different columns or rows in the element value array or the coordinate array to obtain an initial array.
Optionally, the generating module further includes: the third traversing unit is used for traversing the element value array or the coordinate array; and the third storage unit is used for storing the positions of the termination first elements of different columns or different rows in the element value array or the coordinate array to obtain a termination array.
Optionally, the apparatus further comprises: the determining module is used for determining whether the second element meets a preset condition or not in response to the change of the second element in the sparse matrix to be adjusted; and the updating module is used for updating the target array based on the second element in response to the second element meeting the preset condition.
Optionally, the updating module includes: the second determining unit is used for determining a second coordinate of a second element in the sparse matrix to be adjusted; a third determining unit configured to determine a second position of the second element in the element value array based on the second coordinate; the first comparison unit is used for comparing the second coordinate with the first coordinate, and determining a second position of the second element in the element value array based on the second coordinate in response to the second coordinate being different from the first coordinate; a fourth determining unit, configured to determine a first target element stored in a first preset location in the element value array, where the first target element meets a preset condition, and the first preset location includes: a second position, and a preset number of positions after the second position; the second element is stored to the second location and the first target element is stored at a location subsequent to the second location.
Optionally, the first comparing unit includes: a first determining subunit, configured to determine a position of the second element in the element value array as a first position; and the first storage subunit is used for storing the second element to the first position.
Optionally, the updating module further comprises: a fifth determining unit, configured to determine a second coordinate of the second element in the sparse matrix to be adjusted; a second comparing unit for comparing the second coordinate with the first coordinate, and determining a second position of the second element in the coordinate array based on the second coordinate in response to the second coordinate being different from the first coordinate; a sixth determining unit, configured to determine a first target coordinate stored in a first preset position in the coordinate array, where the first target coordinate is a coordinate corresponding to the first element, and the first preset position includes: a second position, and a preset number of positions after the second position; the coordinates of the second element are stored to the second location and the first target coordinates are stored at a location subsequent to the second location.
Optionally, the second alignment unit includes: a second determining subunit, configured to determine a position of the second element in the coordinate value array as a first position; and the second storage subunit is used for storing the second element to the first position.
Optionally, the updating module further comprises: a seventh determining unit, configured to determine a new position of the last element in the updated element value array; an eighth determining unit, configured to determine a second target position of the last element in the termination array; and the updating unit is used for updating the data stored in the second target position in the termination array based on the new position.
Optionally, the fourth determining unit includes: the expansion subunit is used for responding to the second position as a preset position in the element value array, wherein the preset position is the position of a target column or a target row corresponding to the second coordinate in the element value array, terminating the first element, expanding the length of the storage space of the target array based on the sparse matrix to be adjusted to obtain an expanded target array, and updating the expanded target array based on the second element; and a third determining subunit configured to determine the first target element stored in the element value array in response to the second location not being the preset location.
Example 3
According to another aspect of the embodiment of the present invention, there is also provided an electronic device, including: one or more processors; a storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method for adjusting the sparse matrix of any of the above.
Example 4
According to another aspect of the embodiments of the present invention, there is also provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, the processor of the device where the program is controlled to execute the method for adjusting the sparse matrix of any one of the above.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (13)

1. The method for adjusting the sparse matrix is characterized by comprising the following steps of:
acquiring a sparse matrix to be adjusted, wherein the sparse matrix to be adjusted comprises a first element meeting a preset condition;
generating a target array corresponding to the sparse matrix to be adjusted, wherein the target array at least comprises: the system comprises an element value array, a coordinate array, a starting array and a terminating array, wherein the element value array is used for storing element values of the first element, the coordinate array is used for storing first coordinates of the first element in the sparse matrix to be adjusted, the starting array is used for storing the position of the first element meeting the preset condition in each row or each column of the sparse matrix to be adjusted in the element value array, and the total length of the element value array, and the terminating array is used for storing the position of the last element meeting the preset condition in each row or each column of the sparse matrix to be adjusted in the element value array;
And adjusting the sparse matrix to be adjusted based on the target array.
2. The method of claim 1, wherein generating the array of element values corresponding to the sparse matrix to be adjusted comprises:
traversing the sparse matrix to be adjusted based on a first preset rule to generate an initial element value array, wherein elements in the initial element value array all meet the preset conditions;
expanding the length of the storage space of the initial element value array based on a target format and the first coordinate to obtain an expanded initial element value array, wherein the target format is used for representing the number of rows and the number of columns of the sparse matrix to be adjusted, the length of a subarray of each row or each column in the initial element value array is smaller than or equal to the length of the target format, and element adjacent relations in the initial element value array are in one-to-one correspondence with element adjacent relations in the sparse matrix to be adjusted;
filling a preset value into a preset position of the expanded initial element value array to obtain the element value array, wherein the preset position is used for representing a position without the first element after expansion, and the preset value is a value with an element value of zero.
3. The method of claim 1, wherein generating the coordinate array corresponding to the sparse matrix to be adjusted comprises:
determining a first position of the first element in the element value array;
and storing the first coordinates of the first element to a target position in the coordinate array, wherein the lengths of the element value array and the coordinate array are the same.
4. The method according to claim 1, wherein the method further comprises:
determining whether the second element meets the preset condition or not in response to the change of the second element in the sparse matrix to be adjusted;
and responding to the second element meeting the preset condition, and updating the target array based on the second element.
5. The method of claim 4, wherein updating the array of element values based on the second element comprises:
determining a second coordinate of the second element in the sparse matrix to be adjusted;
comparing the second coordinate with a first coordinate, and determining a second position of the second element in the element value array based on the second coordinate in response to the second coordinate being different from the first coordinate;
Determining a first target element stored in a first preset position in the element value array, wherein the first target element meets the preset condition, and the first preset position comprises: the second position, and a preset number of positions after the second position;
storing the second element to the second location and storing the first target element at a location subsequent to the second location.
6. The method of claim 5, wherein in response to the second coordinate being the same as the first coordinate, the method further comprises:
determining the position of the second element in the element value array as a first position;
the second element is stored on the first location.
7. The method of claim 4, wherein updating the coordinate array based on the second element comprises:
determining a second coordinate of the second element in the sparse matrix to be adjusted;
comparing the second coordinate with a first coordinate, and determining a second position of the second element in the coordinate array based on the second coordinate in response to the second coordinate being different from the first coordinate;
Determining a first target coordinate stored in a first preset position in the coordinate array, wherein the first target coordinate is a coordinate corresponding to a first element, and the first preset position comprises: the second position, and a preset number of positions after the second position;
storing coordinates of the second element to the second location and storing the first target coordinates at a location subsequent to the second location.
8. The method of claim 7, wherein in response to the second coordinate being the same as the first coordinate, the method further comprises:
determining the position of the second element in the coordinate value array as a first position;
the second element is stored on the first location.
9. The method of claim 4, wherein updating the termination array based on the second element comprises:
determining a new position of the last element in the updated element value array;
determining a second target position of the last element in the termination array;
updating the data stored at the second target location in the termination array based on the new location.
10. The method of claim 5, wherein determining a first target element stored in the array of element values at a first predetermined location comprises:
responding to the second position as a preset position in the element value array, wherein the preset position is a position of a target column or a target row corresponding to a second coordinate in the element value array, expanding the length of a storage space of the target array based on the sparse matrix to be adjusted to obtain an expanded target array, and updating the expanded target array based on the second element;
and determining the first target element stored in the element value array in response to the second position not being the preset position.
11. An adjustment device for a sparse matrix, comprising:
the acquisition module is used for acquiring a sparse matrix to be adjusted, wherein the sparse matrix to be adjusted comprises first elements meeting preset conditions;
the generating module is configured to generate a target array corresponding to the sparse matrix to be adjusted, where the target array at least includes: the system comprises an element value array, a coordinate array, a starting array and a terminating array, wherein the element value array is used for storing element values of the first element, the coordinate array is used for storing first coordinates of the first element in the sparse matrix to be adjusted, the starting array is used for storing the position of the first element meeting the preset condition in each row or each column of the sparse matrix to be adjusted in the element value array, and the total length of the element value array, and the terminating array is used for storing the position of the last element meeting the preset condition in each row or each column of the sparse matrix to be adjusted in the element value array;
And the adjustment module is used for adjusting the sparse matrix to be adjusted based on the target array.
12. An electronic device, comprising:
one or more processors;
a storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the sparse matrix adjustment method of any one of claims 1-10.
13. A non-volatile storage medium, characterized in that the non-volatile storage medium comprises a stored program, wherein the program, when run, controls the execution of the method for adjusting a sparse matrix according to any one of claims 1-10 in a processor of a device in which the program is located.
CN202310188820.7A 2023-02-21 2023-02-21 Sparse matrix adjustment method and device, electronic equipment and storage medium Pending CN116186045A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310188820.7A CN116186045A (en) 2023-02-21 2023-02-21 Sparse matrix adjustment method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310188820.7A CN116186045A (en) 2023-02-21 2023-02-21 Sparse matrix adjustment method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116186045A true CN116186045A (en) 2023-05-30

Family

ID=86438144

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310188820.7A Pending CN116186045A (en) 2023-02-21 2023-02-21 Sparse matrix adjustment method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116186045A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117171497A (en) * 2023-11-02 2023-12-05 深圳十沣科技有限公司 Sparse matrix storage method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117171497A (en) * 2023-11-02 2023-12-05 深圳十沣科技有限公司 Sparse matrix storage method, device, equipment and storage medium
CN117171497B (en) * 2023-11-02 2024-02-06 深圳十沣科技有限公司 Sparse matrix storage method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US7216127B2 (en) Byte stream organization with improved random and keyed access to information structures
US5848416A (en) Method and apparatus for storing and retrieving data and a memory arrangement
US9262330B2 (en) Column oriented in-memory page caching
US10705734B2 (en) Expanding variable sub-column widths as needed to store data in memory
JP4717130B2 (en) Generating a full hash using an offset table
US6862599B2 (en) Software-based methodology for the storage and retrieval of diverse information
US20030034989A1 (en) Application editing apparatus and data processing method and program
CN102362273A (en) Dynamic hash table for efficient data access in relational database system
US5625812A (en) Method of data structure extraction for computer systems operating under the ANSI-92 SQL2 outer join protocol
US6735600B1 (en) Editing protocol for flexible search engines
EP0538035B1 (en) A system for designing a placement of a placement element
CN116186045A (en) Sparse matrix adjustment method and device, electronic equipment and storage medium
WO2003077184A1 (en) Array transformation in a behavioral synthesis tool
RU2633178C2 (en) Method and system of database for indexing links to database documents
US4780816A (en) Key-to-address transformations
JPH09245043A (en) Information retrieval device
KR20210049703A (en) Method and systems for adapting multiple key-value stores
US8341153B2 (en) Apparatus and method for heap sorting with collapsed values and selective value expansion
CN113222160A (en) Quantum state conversion method and device
CN113630123B (en) Data compression system and method
US7302377B1 (en) Accelerated event queue for logic simulation
CN108073709A (en) A kind of operating method of data record, device, equipment and storage medium
JP2007048318A (en) Relational database processing method and relational database processor
JP5736589B2 (en) Sequence data search device, sequence data search method and program
US8849866B2 (en) Method and computer program product for creating ordered data structure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination