1 #ifndef QNANO_NEW_ORGANIZE_BLOCKS_DEFINED_H 2 #define QNANO_NEW_ORGANIZE_BLOCKS_DEFINED_H 7 #include "tools/Size_Provider.h" 15 virtual size_t get_block_size(
size_t block)
const = 0;
16 virtual size_t get_base_index(
size_t block)
const = 0;
17 virtual size_t get_nr_blocks()
const = 0;
18 virtual size_t get_DIM()
const{
return get_base_index(get_nr_blocks()-1)+get_block_size(get_nr_blocks()-1);}
21 size_t get_range_size(
size_t block_start,
size_t nr_blocks)
const;
30 size_t blocksize, nrblocks;
32 void set_block_size(
size_t bs){ blocksize=bs; }
33 void set_nr_blocks(
size_t nr){ nrblocks=nr; }
34 virtual size_t get_block_size(
size_t block=0)
const{
return blocksize;}
35 virtual size_t get_base_index(
size_t block)
const{
return blocksize*block; }
36 virtual size_t get_nr_blocks()
const{
return nrblocks;}
37 virtual size_t get_DIM()
const{
return blocksize*nrblocks;}
46 void set_nr_blocks(
size_t nr){ nrblocks=nr; }
47 virtual size_t get_block_size(
size_t block=0)
const{
return 1;}
48 virtual size_t get_base_index(
size_t block)
const{
return block; }
49 virtual size_t get_nr_blocks()
const{
return nrblocks;}
50 virtual size_t get_DIM()
const{
return nrblocks;}
60 virtual size_t get_block_size(
size_t block=0)
const{
return 1;}
61 virtual size_t get_base_index(
size_t block)
const{
return block; }
62 virtual size_t get_nr_blocks()
const{
return provider->size();}
63 virtual size_t get_DIM()
const{
return provider->size();}
69 provider=other.provider;
79 provider=&Size_Provider_Zero_Instance;
88 std::vector<size_t> blocksizes;
89 std::vector<size_t> baseindices;
91 virtual size_t get_block_size(
size_t block)
const;
92 virtual size_t get_base_index(
size_t block)
const;
93 virtual size_t get_nr_blocks()
const;
94 virtual void calculate_base_indices();
99 : blocksizes(blocksizes_) {
100 calculate_base_indices();
Definition: Organize_Blocks.h:42
Definition: Size_Provider.h:11
Definition: Organize_Blocks.h:13
Definition: Organize_Blocks.h:55
Definition: Organize_Blocks.h:86
Definition: Organize_Blocks.h:28