Revision 1972 trunk/src/linad99/ivector.cpp

ivector.cpp (revision 1972)
21 21

  
22 22
#include <stdlib.h>
23 23

  
24
long int _farptr_tolong(void * px);
25
long int farptr_tolong(void *);
24
#ifdef DIAG
25
long int _farptr_tolong(void* px);
26
long int farptr_tolong(void*);
27
#endif
26 28

  
27 29
/**
30
Default constructor
31
*/
32
ivector::ivector(void)
33
{
34
  allocate();
35
}
36
/**
37
Copy constructor
38
*/
39
ivector::ivector(const ivector& t)
40
 {
41
   index_min=t.index_min;
42
   index_max=t.index_max;
43
   #ifdef DIAG
44
    cout << "Copy constructor called for ivector with address "
45
         << _farptr_tolong(t.v) <<"\n";
46
   #endif
47
   shape=t.shape;
48
   if (shape)
49
   {
50
     (shape->ncopies)++;
51
     v = t.v;
52
   }
53
 }
54
/**
28 55
Destructor
29 56
*/
30 57
ivector::~ivector()
......
37 64
    }
38 65
    else
39 66
    {
40
      if ( v == NULL)
67
      if (v != NULL)
41 68
      {
69
        deallocate();
70
      }
71
#ifdef SAFE_ALL
72
      else
73
      {
42 74
         cerr << " Trying to delete NULL pointer in ~ivector\n";
43 75
         ad_exit(21);
44 76
      }
45
      deallocate();
77
#endif
46 78
    }
47 79
  }
48 80
}
......
104 136
   shape=NULL;
105 137
 }
106 138

  
107
/**
108
 * Description not yet available.
109
 * \param
110
 */
111
ivector::ivector(const ivector& t)
112
 {
113
   index_min=t.index_min;
114
   index_max=t.index_max;
115
   #ifdef DIAG
116
    cout << "Copy constructor called for ivector with address "
117
         << _farptr_tolong(t.v) <<"\n";
118
   #endif
119
   shape=t.shape;
120
   if (shape)
121
   {
122
     (shape->ncopies)++;
123
     v = t.v;
124
   }
125
 }
126 139

  
127 140
/**
128 141
 * Description not yet available.
......
229 242
 * Description not yet available.
230 243
 * \param
231 244
 */
232
 ivector::ivector(void)
233
 {
234
   allocate();
235
 }
236

  
237
/**
238
 * Description not yet available.
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff