source: tags/arb_5.2/MULTI_PROBE/MP_probe_tabs.cxx

Last change on this file was 5390, checked in by westram, 16 years ago
  • TAB-Ex
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1#include <MultiProbe.hxx>
2#include <string.h>
3#include <math.h>
4
5
6
7//**************************************************************
8void probe_tabs::print()
9{
10    int i;
11
12
13    printf("**********************\n");
14    printf("GRUPPENTABELLE:\n");
15    for (i=0; i< length_of_group_tabs; i++)
16        printf("%d  %d \n", i, group_tab[i]);
17
18    printf("NON_GRUPPENTABELLE:\n");
19    for (i=0; i< length_of_group_tabs; i++)
20        printf("%d %d\n", i, non_group_tab[i]);
21
22    printf("**********************\n");
23
24}
25
26probe_tabs *probe_tabs::duplicate()
27{
28    int  i;
29    int *new_group_field     = new int[length_of_group_tabs];
30    int *new_non_group_field = new int[length_of_group_tabs];
31
32    for (i=0; i< length_of_group_tabs; i++)
33        new_group_field[i] = group_tab[i];
34
35
36    for (i=0; i< length_of_group_tabs; i++)
37        new_non_group_field[i] = non_group_tab[i];
38
39    return  new probe_tabs(new_group_field, new_non_group_field, length_of_group_tabs);
40}
41
42
43probe_tabs::probe_tabs(int *new_group_field, int *new_non_group_field, int len_group)
44{
45    int length;
46    memset(this,0, sizeof(probe_tabs));
47
48    if (new_group_field)                                // Duplicate !!!
49    {
50        group_tab = new_group_field;
51        non_group_tab = new_non_group_field;
52        length_of_group_tabs = len_group;
53    }
54    else
55    {
56        length = (int)(pow(3.0, (double)mp_gl_awars.no_of_probes));
57        group_tab = new int[length];
58        memset(group_tab, 0, sizeof(int)*length);
59        non_group_tab = new int[length];
60        memset(non_group_tab, 0, sizeof(int)*length);
61        length_of_group_tabs = length;
62    }
63}
64
65probe_tabs::~probe_tabs()
66{
67    delete [] group_tab;
68    delete [] non_group_tab;
69}
Note: See TracBrowser for help on using the repository browser.