Revision 752 branches/threaded2/src/linad99/ddlist.cpp

ddlist.cpp (revision 752)
8 8
 * \file
9 9
 * Description not yet available.
10 10
 */
11
/// file ddlist.cpp
12
#include "fvar.hpp"
13 11

  
14
#ifdef __ZTC__
15
   #include <iostream.hpp>
16
#endif
17

  
18
#ifdef __TURBOC__
19
   #pragma hdrstop
20
   #include <iostream.h>
21
#endif
22

  
23 12
#include <stdlib.h>
13
#include "fvar.hpp"
14

  
24 15
//#define MAX_DLINKS 1000
25
dlink * dlink::previous(){return prev;}
26 16

  
27
//////////////////////////////
28
// global list names
17
dlink::dlink()
18
{
19
  di.x = 0;
20
  prev = nullptr;
21
}
22
dlink::~dlink()
23
{
24
}
25
dlink* dlink::previous()
26
{
27
  return prev;
28
}
29 29

  
30
//dlist * GRAD_LIST;
31
//extern dlist * GRAD_LIST; //js
32
/////////////////////////////
33
extern char demo_capacity[];
34
extern char please_buy[];
35
extern char otter_address1[];
36
extern char otter_address2[];
37
extern char otter_address3[];
38
extern char otter_address4[];
39
extern char otter_address5[];
30
__thread char* ddlist_space;
31
__thread char* ddlist_spacea;
40 32

  
41

  
42
__ADMBTHREAD__ char* ddlist_space;
43
__ADMBTHREAD__ char* ddlist_spacea;
44

  
45 33
/**
46 34
 * Description not yet available.
47 35
 * \param
48 36
 */
49 37
dlist::dlist(void)
50 38
{
51
  int on,nopt;
39
  int on, nopt;
52 40
  if ( (on=option_match(ad_comm::argc,ad_comm::argv,"-mdl",nopt))>-1)
53 41
  {
54
    if (nopt ==1)	    
42
    if (nopt == 1)	    
55 43
    {	      
56 44
      gradient_structure::MAX_DLINKS=atoi(ad_comm::argv[on+1]);
57 45
    }
58 46
    else
59 47
    {
60
      cerr << "Wrong number of options to -mdl -- must be 1"
61
        " you have " << nopt << endl;		
48
      cerr << "Wrong number of options to -mdl -- must be 1 you have " << nopt << endl;		
62 49
      ad_exit(1);
63 50
    }	
64 51
  }   
65
  // cout << sizeof(double_and_int) << endl;
66
  // cerr << "dlist::dlist(void)\n";
67
  last = 0;
52

  
53
  last = nullptr;
68 54
  last_offset = 0;
69 55
  nlinks = 0;
56

  
70 57
  dlink_addresses = new dlink*[gradient_structure::MAX_DLINKS];
58
  for (int i = 0; i < gradient_structure::MAX_DLINKS; ++i)
59
  {
60
    dlink_addresses[i] = nullptr;
61
  }
62

  
71 63
  ddlist_space = (char*)malloc(2 * sizeof(double) * (gradient_structure::MAX_DLINKS + 1));
72
  //cout << (int) (ddlist_space) << endl;
73
  //cout << ((int) (ddlist_space))%8 << endl;
74 64
#if defined(__x86_64)
75 65
  intptr_t adjust=(8 - ((intptr_t)(ddlist_space))%8)%8;
76 66
#else
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff