00001 using System; 00002 using System.Collections; 00003 using System.Diagnostics; 00004 using System.Runtime.InteropServices; 00005 00006 using Golem; 00007 00008 namespace MathKer 00009 { 00010 /// <summary> 00011 /// This is a fixed sparse matrix format 00012 /// There is full set of rows but in each row are stored only nonzeros 00013 /// </summary> 00014 public class SparseConectivityMtxFixed : IConectMatrix 00015 { 00016 public: 00017 IntArrayList** ColumnsIndexes; 00018 int n; 00019 int nonzeros; 00020 00021 public: 00022 int N() {return n;} 00023 int Nonzeros() {return nonzeros;} 00024 00025 00026 public void Init(int N) 00027 { 00028 n = N; 00029 ColumnsIndexes = new IntArrayList*[n]; 00030 } 00031 00032 ~SparseConectivityMtxFixed() 00033 { 00034 for (int i=0; i<n; i++) 00035 if (ColumnsIndexes[i]) {delete ColumnsIndexes[i]; ColumnsIndexes[i] = NULL;} 00036 delete [] ColumnsIndexes; 00037 } 00038 00039 IntArrayList* GetIndexesAboveDiagonalInColumn(int j) 00040 { 00041 return ColumnsIndexes[j]; 00042 } 00043 } 00044 }