00001
00002
00003 #ifndef _SPARSEGRIDMTXLL_H__
00004 #define _SPARSEGRIDMTXLL_H__
00005
00006 #include "SparseGridMtx.h"
00007
00008 DSS_NAMESPASE_BEGIN
00009
00010
00011
00012
00013 class SparseGridMtxLL :
00014 public SparseGridMtx
00015 {
00016 public:
00017
00018
00019 SparseGridMtxLL(SparseMatrixF& sm,BYTE block_size,Ordering* block_order,MathTracer* eMT,BOOL load_data = TRUE);
00020
00021
00022
00023 SparseGridMtxLL(SparseMatrixF& sm,BYTE block_size,Ordering* block_order,Ordering* node_order,MathTracer* eMT,BOOL load_data = TRUE);
00024
00025 virtual ~SparseGridMtxLL();
00026
00027 public:
00028
00029 double* Columns_data;
00030
00031 void AlocateMemoryByPattern(IConectMatrix* bskl);
00032
00033
00034 double GetValue(long bi,long bj,long si, long sj,long& aux_bi_idx,long& aux_bj_idx)
00035 {
00036 if (bi==bj)
00037 return this->Columns_data[bi*block_storage+si+sj*block_size];
00038 else
00039 if (bj>bi)
00040 return Columns[bj]->GetValue(block_size,bi,si,sj,Columns_data,aux_bj_idx);
00041 else
00042 return Columns[bi]->GetValue(block_size,bj,sj,si,Columns_data,aux_bi_idx);
00043 }
00044
00045 void Solve(double* b, double* x);
00046
00047
00048 virtual double& ElementAt(int i, int j);
00049 virtual void LoadZeros();
00050 virtual void LoadMatrixNumbers(SparseMatrixF& sm);
00051 virtual void SolveLV(const LargeVector& b, LargeVector& x);
00052 virtual void Factorize();
00053 virtual void Factorize_Incomplete();
00054 virtual void MultiplyByVector(const LargeVectorAttach& x, LargeVectorAttach& y);
00055
00056 void ForwardSubstL(double* x,long fixed_blocks);
00057 void BackSubstLT(double* x,long fixed_blocks);
00058
00059
00060 void SolveLL(double* x,long fixed_blocks=0);
00061
00062 public:
00063
00064 virtual void SchurComplementFactorization(int fixed_blocks);
00065 virtual void SolveA11(double* x,long fixed_blocks);
00066 virtual void Sub_A21_A11inv(double* x,long fixed_blocks);
00067 virtual void Sub_A11inv_A12(double* x,long fixed_blocks);
00068 virtual void WriteCondensedMatrixA22(double* a,Ordering* mcn,IntArrayList* lncn);
00069
00070 };
00071
00072 DSS_NAMESPASE_END
00073
00074 #endif// _SPARSEGRIDMTXLL_H__