00001 #ifndef _AdmittanceNetwork_superlu_h_
00002 #define _AdmittanceNetwork_superlu_h_
00003 #include <complex>
00004 #include "slu_zdefs.h"
00005 #include "AdmittanceNetwork.h"
00006
00010 class AdmittanceNetwork_SUPERLU:
00011 public AdmittanceNetworkInterface
00012 {
00013 public:
00023 AdmittanceNetwork_SUPERLU(int N, bool init_eye = false);
00027 void add_line(int i, int j, Complex y);
00028
00029 void add_line(int i, int j, Complex y, double turns, double phase_shift, int side);
00033 void remove_line(int i, int j, Complex y);
00034
00035 void remove_line(int i, int j, Complex y, double turns, double phase_shift, int side);
00039 void add_self(int i, Complex y);
00043 void remove_self(int i, Complex y);
00049 void solve_for_voltage(const Complex* I, Complex* V);
00055 void solve_for_current(const Complex* V, Complex* I);
00061 Complex get(int i, int j) const;
00065 void printAll();
00069 ~AdmittanceNetwork_SUPERLU();
00070 private:
00071
00072 SuperMatrix A, L, U, B;
00073
00074 int *perm_r, *perm_c;
00075
00076 doublecomplex* rhs;
00077
00078 bool dirty_val, dirty_struct;
00079
00080 const int N;
00081
00082 int Nalloc;
00083
00084 superlu_options_t options;
00085
00086 void set(int i, int j, Complex z);
00087 };
00088
00089 #endif
00090