ls1-MarDyn
ls1-MarDyn molecular dynamics code
FFTDataContainer_scalBlocks_v0.h
1/*
2 * FFTDataContainer_blocks.h
3 *
4 * Created on: Mar 15, 2016
5 * Author: gallardjm
6 */
7#ifndef FFTDATA_SCALBLOCK_V0_H_
8#define FFTDATA_SCALBLOCK_V0_H_
9
10#include "bhfmm/fft/FFTSettings_preprocessor.h" //tmp include for the typedef FFT_precision
11#include "bhfmm/fft/FFTDataContainer.h"
12#include "bhfmm/fft/tools/fft_utils.h"
13#include <stdlib.h>
14
15/*
16 * Storage for blocks, can be used with scaling Blocks (scalBlock)
17 *
18 * blocks[i] is a matrix reprensenting the ith block
19 * Convention: block 0 contain the terms of lowest order
20 * => source matrix in ascending block (block 0 is the top of the matrix),
21 * tf and target matrices in descending blocks (block 0 is the lower part of the matrix)
22 */
24
25public:
26 FFTDataContainer_scalBlocks_v0(int nbBlocks, int nx, int ny, bool scal,
27 int* blockSize) :
28 _nbBlocks(nbBlocks), _nx(nx), _ny(ny), _scal(scal), _blockSize(
29 blockSize) {
30 }
31
32 FFT_precision*** Re;
33 FFT_precision*** Im;
34 int _nbBlocks;
35 int _nx;
36 int _ny;
37 bool _scal;
38 int* _blockSize; //direct copy of the pointer, do not modify or free
39
41 delete_blocks(Re, _nbBlocks);
42 delete_blocks(Im, _nbBlocks);
43 }
44
47 new FFTDataContainer_scalBlocks_v0(_nbBlocks, _nx, _ny, _scal,
48 _blockSize);
49 if (_scal) {
50 copy->Re = copy_scalBlocks(Re, _nbBlocks, _nx, _blockSize);
51 copy->Im = copy_scalBlocks(Im, _nbBlocks, _nx, _blockSize);
52 } else {
53 copy->Re = copy_blocks(Re, _nbBlocks, _nx, _ny);
54 copy->Im = copy_blocks(Im, _nbBlocks, _nx, _ny);
55 }
56
57 return copy;
58 }
59};
60
61#endif
Definition: FFTDataContainer_scalBlocks_v0.h:23
FFTDataContainer * copyContainer()
Definition: FFTDataContainer_scalBlocks_v0.h:45
Definition: FFTDataContainer.h:14