FMM Data Structures. Content. Introduction Hierarchical Space Subdivision with 2 d -Trees Hierarchical Indexing System Parent & Children Finding

Similar documents
Fast Multipole and Related Algorithms

Efficient O(N log N) algorithms for scattered data interpolation

Fast Multipole Methods. Linear Systems. Matrix vector product. An Introduction to Fast Multipole Methods.

CS535 Fall Department of Computer Science Purdue University

FMM implementation on CPU and GPU. Nail A. Gumerov (Lecture for CMSC 828E)

GPU accelerated heterogeneous computing for Particle/FMM Approaches and for Acoustic Imaging

Iterative methods for use with the Fast Multipole Method

CMSC 858M/AMSC 698R. Fast Multipole Methods. Nail A. Gumerov & Ramani Duraiswami. Lecture 20. Outline

c 2007 Society for Industrial and Applied Mathematics

Algorithms for GIS:! Quadtrees

CSE 554 Lecture 5: Contouring (faster)

CS 171: Introduction to Computer Science II. Binary Search Trees

Ray Tracing with Spatial Hierarchies. Jeff Mahovsky & Brian Wyvill CSC 305

An improvement in the build algorithm for Kd-trees using mathematical mean

Organizing Spatial Data

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Programming II (CS300)

Accelerating Ray Tracing

Ray Tracing Acceleration Data Structures

Heaps Outline and Required Reading: Heaps ( 7.3) COSC 2011, Fall 2003, Section A Instructor: N. Vlajic

CSI33 Data Structures

Data Structures and Algorithms

ExaFMM. Fast multipole method software aiming for exascale systems. User's Manual. Rio Yokota, L. A. Barba. November Revision 1

Spatial Data Structures

Data Mining. Dr. Raed Ibraheem Hamed. University of Human Development, College of Science and Technology Department of Computer Science

CS 234. Module 8. November 15, CS 234 Module 8 ADT Priority Queue 1 / 22

Module 4: Index Structures Lecture 13: Index structure. The Lecture Contains: Index structure. Binary search tree (BST) B-tree. B+-tree.

Multi-way Search Trees. (Multi-way Search Trees) Data Structures and Programming Spring / 25

Spatial Data Structures for GIS Visualization. Ed Grundy

Spatial Data Structures

Chapter 11: Indexing and Hashing

Treelogy: A Benchmark Suite for Tree Traversals

CS 331 DATA STRUCTURES & ALGORITHMS BINARY TREES, THE SEARCH TREE ADT BINARY SEARCH TREES, RED BLACK TREES, THE TREE TRAVERSALS, B TREES WEEK - 7

Hash Tables. CS 311 Data Structures and Algorithms Lecture Slides. Wednesday, April 22, Glenn G. Chappell

CSI33 Data Structures

Idea. Found boundaries between regions (edges) Didn t return the actual region

Physical Level of Databases: B+-Trees

Fast Methods with Sieve

Ray Tracing: Intersection

Balanced Search Trees. CS 3110 Fall 2010

CS 406: Syntax Directed Translation

Computational Geometry

The priority is indicated by a number, the lower the number - the higher the priority.

TREES. Trees - Introduction

Spatial Data Structures

Spatial Data Structures for Computer Graphics

CSE 214 Computer Science II Introduction to Tree

CS 352: Computer Graphics. Hierarchical Graphics, Modeling, And Animation

CMSC 754 Computational Geometry 1

Chapter 12: Indexing and Hashing. Basic Concepts

Module 8: Range-Searching in Dictionaries for Points

Spatial Data Structures

Computational Geometry

CS350: Data Structures Red-Black Trees

Chapter 12: Indexing and Hashing

Fast Multipole Accelerated Indirect Boundary Elements for the Helmholtz Equation

A Real-time Rendering Method Based on Precomputed Hierarchical Levels of Detail in Huge Dataset

Topic 18 Binary Trees "A tree may grow a thousand feet tall, but its leaves will return to its roots." -Chinese Proverb

Binary Trees

Trees. (Trees) Data Structures and Programming Spring / 28

Trees : Part 1. Section 4.1. Theory and Terminology. A Tree? A Tree? Theory and Terminology. Theory and Terminology

MODELING AND HIERARCHY

Database Systems. File Organization-2. A.R. Hurson 323 CS Building

13.4 Deletion in red-black trees

CS24 Week 8 Lecture 1

CPSC / Sonny Chan - University of Calgary. Collision Detection II

Advanced Tree Data Structures

Algorithms and Data Structures

FMM accelerated BEM for 3D Helmholtz equation

Section 4 SOLUTION: AVL Trees & B-Trees

Accelerated Raytracing

13.4 Deletion in red-black trees

Online Document Clustering Using the GPU

Scalable Fast Multipole Methods on Distributed Heterogeneous Architectures

Tree-based methods on GPUs

CS 231 Data Structures and Algorithms Fall Recursion and Binary Trees Lecture 21 October 24, Prof. Zadia Codabux

7 Approximate Nearest Neighbors

Empirical Analysis of Space Filling Curves for Scientific Computing Applications

DDS Dynamic Search Trees

Empirical Analysis of Space Filling Curves for Scientific Computing Applications

Introduction. Computer Vision & Digital Image Processing. Preview. Basic Concepts from Set Theory

Comparison of Compressed Quadtrees and Compressed k-d Tries for Range Search

Morphological track 1

Binary Search Trees. Carlos Moreno uwaterloo.ca EIT

Intro to DB CHAPTER 12 INDEXING & HASHING

UNIT III BALANCED SEARCH TREES AND INDEXING

IN101: Algorithmic techniques Vladimir-Alexandru Paun ENSTA ParisTech

Terascale on the desktop: Fast Multipole Methods on Graphical Processors

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

Geometric Algorithms. Geometric search: overview. 1D Range Search. 1D Range Search Implementations

Binary Trees, Binary Search Trees

CS F-11 B-Trees 1

kd-trees Idea: Each level of the tree compares against 1 dimension. Let s us have only two children at each node (instead of 2 d )

Some Search Structures. Balanced Search Trees. Binary Search Trees. A Binary Search Tree. Review Binary Search Trees

Module 8: Binary trees

Tree Structures. A hierarchical data structure whose point of entry is the root node

Copyright Detection System for Videos Using TIRI-DCT Algorithm

Fast methods for N-body problems

Algorithms and Applications

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Transcription:

FMM Data Structures Nail Gumerov & Ramani Duraiswami UMIACS [gumerov][ramani]@umiacs.umd.edu CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Content Introduction Hierarchical Space Subdivision with d -Trees Hierarchical Indexing System Parent & Children Finding Binary Ordering Spatial Ordering Using Bit Interleaving Neighbor & Box Center Finding Spatial Data Structuring Threshold Level of Space Subdivision Operations on Sets CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Reference: N.A. Gumerov, R. Duraiswami & E.A. Borovikov Data Structures, Optimal Choice of Parameters, and Complexity Results for Generalized Multilevel Fast Multipole Methods in d Dimensions UMIACS TR -8, Also issued as Computer Science Technical Report CS-TR-# 4458. Volume 9 pages. University of Maryland, College Park,. AVAILABLE ONLINE VIA http://www.umiacs.umd.edu/~gumerov http://www.umiacs.umd.edu/~ramani CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Introduction CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

FMM Data Structures Since the complexity of FMM should not exceed O(N ) (at M~N), data organization should be provided for efficient numbering, search, and operations with these data. Some naive approaches can utilize search algorithms that result in O(N ) complexity of the FMM (and so they kill the idea of the FMM). In d-dimensions O(NlogN) complexity for operations with data can be achieved. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 FMM Data Structures () Approaches include: Data preprocessing Sorting Building lists (such as neighbor lists): requires memory, potentially can be avoided; Building and storage of trees: requires memory, potentially can be avoided; Operations with data during the FMM algorithm execution: Operations on data sets; Search procedures. Preferable algorithms: Avoid unnecessary memory usage; Use fast (constant and logarithmic) search procedures; Employ bitwise operations; Can be parallelized. Tradeoff Between Memory and Speed CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Space Subdivision with d -Trees CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Historically: Binary trees (D), Quadtrees (D), Octrees (D); We will consider a concept of d -tree. d= binary; d= quadtree; d= octree; d=4 hexatree; and so on.. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Hierarchy in d -tree Level Level Level Level Neighbor Neighbor Neighbor (Sibling) (Sibling) Parent Neighbor (Sibling) Child Self Child Child Child Neighbor Neighbor Neighbor Neighbor CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 d -trees Level -tree (binary) -tree (quad) d -tree Parent Number of Boxes d Neighbor (Sibling) Self Children Maybe Neighbor d d CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Hierarchical Indexing CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Hierarchical Indexing in d -trees. Index at the Level. Indexing in quad-tree The large black box has the indexing string (,). So its index is 4 =. The small black box has the indexing string (,,). So its index is 4 =54. In general: Index (Number) at level l is: CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Universal Index (Number) The large black box has the indexing string (,). So its index is 4 = at level The small gray box has the indexing string (,,). So its index is 4 = at level. In general: Universal index is a pair: CSCAMM FAM4: 4/9/4 This index at this level Duraiswami & Gumerov, -4 Parent s indexing string: Parent Index Parent s index: Parent index does not depend on the level of the box! E.g. in the quad-tree at any level Parent s universal index: Algorithm to find the parent number: For box # 4 (gray or black) the parent box index is 4. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Children indexing strings: Children Indexes Children indexes: Children indexes do not depend on the level of the box! E.g. in the quad-tree at any level: Children universal indexes: Algorithm to find the children numbers: CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 A couple of examples: CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Can it be even faster? YES! USE BITSHIFT PROCEDURES! (HINT: Multiplication and division by d are equivalent to d-bit shift.) CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Matlab Program for Parent Finding Box Index p = bitshift(n,-d); Parent Box Index Space dimensionality CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Binary Ordering CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Finding the index of the box containing a given point Level : Level : Level l: CSCAMM FAM4: 4/9/4 We use indexing strings! Duraiswami & Gumerov, -4 Finding the index of the box containing a given point () This is an algorithm for finding of the box index at level l (!). Faster method: Use bit shift and take prefix. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Finding the center of a given box. This is the algorithm! CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Neighbor finding Due to all boxes are indexed consequently: Neighbor((Number,level))=Number± CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Spatial Ordering Using Bit Interleaving CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Bit Interleaving This maps R d R, where coordinates are ordered naturally! CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Example of Bit Interleaving. Consider -dimensional space, and an octree. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Convention for Children Ordering. (,) (,) x (,) (,) (,,) (,,) (,,) x x 5 4 7 6 (,,) (,,) (,,) x (,,) d = x d = (,,) CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Finding the index of the box containing a given point. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Finding the index of the box containing a given point. Algorithm and Example. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Bit Deinterleaving CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Bit deinterleving (). Example. Number = 7689 It is OK that the first group is incomplete To break the number into groups of d bits start from the last digit! Number = = = 7 Number = = = 58 Number = = = 9 CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Finding the center of a given box. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Neighbor Finding CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Example of Neighbor Finding 6 Number 5 4 7 6 5 4 7 9 5 55 6 6 9 8 5 54 6 6 5 7 49 5 57 59 8 4 6 48 5 56 58 7 5 7 9 45 47 6 4 6 8 44 46 9 5 4 4 8 4 4 4 x 4 5 6 7 x Number interleaving 6 = deinterleaving (,) = (,4) generation of neighbors (,),(,4),(,5),(,), (,5),(4,),(4,4),(4,5) = (,),(,),(,), (,),(,),(,), (,),(,),,,,,,, CSCAMM =, 4, FAM4: 5, 5, 7, 4/9/4 7, 48, 49 Duraiswami & Gumerov, -4 Spatial Data Structuring CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Definitions Definitions CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Threshold Level CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Spatial Data Sorting CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Spatial Data Sorting () Before sorting represent your data with maximum number of bits available (or intended to use). This corresponds to maximum level L available available (say [L available =BitMax/d]. In the hierarchical d -tree space subdivision the sorted list will remain sorted at any level L< L available. So the data ordering is required only one time. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

After data sorting we need to find the maximum level of space subdivision that will be employed In Multilevel FMM two following conditions can be mainly considered: At level L max each box contains not more than s points (s is called clustering or grouping parameter) At level L max the neighborhood of each box contains not more than q points. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 The threshold level determination algorithm in O(N) time s is the clustering parameter CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

Binary Search in Sorted List Operation of getting non-empty boxes at any level L (say neighbors) can be performed with O(logN) complexity for any fixed d. It consists of obtaining a small list of all neighbor boxes with O() complexity and Binary search of each neighbor in the sorted list at level L is an O(Ld) operation. For small L and d this is almost O() procedure. CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4 Operations on Sets CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4

CSCAMM FAM4: 4/9/4 Duraiswami & Gumerov, -4