Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W wendelin
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedi
  • wendelin
  • Merge requests
  • !104

Merged
Created Dec 13, 2022 by Xiaowu Zhang@xiaowu.zhangDeveloper

Data mapping

  • Overview 14
  • Commits 3
  • Pipelines 3
  • Changes 19

data mapping is used to map complex data into a single value

the idea is if an object has complet data to process, like (object, value1, value2, value3,value4....), we can mapping (object, value1, value2, value3,value4....) into a single value X, then we process only X to make it faster

here is an use case:

we have two 2D data arrays with 5 columns, the first column is the name of object, the other fours are the differents value of this object

Data ArrayA:

object value1 value2 value3 value4
X 1 2 3 4
Y 5 6 7 8
Z 9 10 11 12

Data ArrayB:

object value1 value2 value3 value4
X 1 2 3 4
Y 5 8 7 8
Z 9 10 192 12

now we need to compare data array A to data array B to find which object inside A has different value.

without data mapping, we need to compare each object's 4 values, the complexity is O(2^n)

with data mapping:

we map those values:

(X, 1, 2, 3, 4) ==> 1

(Y, 5, 6, 7, 8) ==> 2

(Z, 9, 10, 11,12) ==>3

(Y, 5, 8, 7, 8) ==> 4

(Z, 9, 10, 192, 12) ==> 5

Data ArrayA:

object
1
2
3

Data ArrayB:

object
1
4
5

then compare 1D array is fast, the complexity is O(n)

Edited Dec 15, 2022 by Xiaowu Zhang
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: data_mapping
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7