File: wrap.h

package info (click to toggle)
gnucap-python 0.0.2-1.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 2,668 kB
  • sloc: python: 7,873; sh: 4,384; cpp: 1,786; makefile: 249
file content (86 lines) | stat: -rw-r--r-- 2,136 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef GC_SWIG_WRAP_H
#define GC_SWIG_WRAP_H
#include <md.h>
//TODO: untangle
struct COMPLEX_array_t {
  operator COMPLEX*() { return _t; }
  COMPLEX& get(unsigned i){return _t[i];}
  COMPLEX& set(unsigned i, COMPLEX const& a){return _t[i]=a;}
  COMPLEX* _t;
};
inline COMPLEX& get_z(COMPLEX* n, unsigned x){
return n[x];
}


#include "m_matrix_hack.h"
#include <c_comand.h>
#include <l_dispatcher.h>
#include <s__.h>
#include <memory>

#if 0
class sim : public SIM {
protected:
  explicit sim() : SIM() { untested(); }
  ~sim() { untested(); }
public:
  virtual void  setup(CS&)=0;
  virtual void  sweep()=0;
  virtual void  do_it(CS&, CARD_LIST*){ incomplete(); };
};
#endif

#include <e_compon.h>

#if 0
class component : public COMPONENT {
protected:
  explicit component(const COMPONENT& c) : COMPONENT(c) { untested(); }
  explicit component() : COMPONENT() { untested(); }

public: // these pure in COMPONENT
  virtual CARD*	 clone()const{ unreachable(); }
  virtual std::string port_name(int)const { unreachable(); }
  virtual std::string value_name()const { unreachable(); }

public:	// obsolete -- do not use in new code
  bool print_type_in_spice()const { untested(); return false; }
  bool use_obsolete_callback_parse()const { untested(); return false; }
  bool use_obsolete_callback_print()const { untested(); return false; }
  void print_args_obsolete_callback(OMSTREAM&, LANGUAGE*)const { unreachable(); }
  void obsolete_move_parameters_from_common(const COMMON_COMPONENT*) { unreachable(); }
};
#endif

class card : public CARD {
public:
  explicit card() : CARD()  {}
public: // pure?
  virtual CARD* clone(CS&){ unreachable(); return nullptr;}
};

std::string command(char const*command);
void parse(char const*command);

inline void test_dummy(CARD *c){ untested(); }

class BSCR{
public:
  BSCR( BSMATRIX<COMPLEX> const& m, size_t r) : _m(m), _r(r){ }
  COMPLEX get(size_t x) const{
	  return _m.s(_r, x);
  }

public:
  size_t size() const{ return _m.size(); }
  double density() const{
	  return const_cast<BSMATRIX<COMPLEX>& >(_m).density();
  }

private:
  BSMATRIX<COMPLEX> const& _m;
  size_t _r;
};

#endif