00001 #ifndef _AdmittanceNetwork_lapack_h_
00002 #define _AdmittanceNetwork_lapack_h_
00003 #include "AdmittanceNetwork.h"
00004 #include "events.h"
00005
00012 class AdmittanceNetwork_LAPACK:
00013 public AdmittanceNetworkInterface
00014 {
00015 public:
00016
00017 AdmittanceNetwork_LAPACK(int N);
00018
00019 void add_line(int i, int j, Complex y, double turns, double phase_shift, int side);
00020
00021 void add_line(int i, int j, Complex y);
00022
00023 void remove_line(int i, int j, Complex y) { add_line(i,j,-y); }
00024
00025 void remove_line(int i, int j, Complex y, double turns, double phase_shift, int side);
00026
00027 void add_self(int i, Complex y);
00028
00029 void remove_self(int i, Complex y) { add_self(i,-y); }
00030
00031 void solve_for_voltage(const Complex* I, Complex* V);
00032
00033 void solve_for_current(const Complex* V, Complex* I);
00034
00035 Complex get(int i, int j) const;
00036
00037 ~AdmittanceNetwork_LAPACK();
00038 private:
00039
00040 const int N;
00041 double *Y, *LUY;
00042 bool dirty;
00043
00044 double *iv_lapack;
00045 int* ipiv_lapack;
00046 void set(int i, int j, Complex y);
00047 };
00048
00049 #endif