Exemplo n.º 1
0
        public SuperLUContext(CompressedColumnStorage <T> matrix)
        {
            handles = new List <GCHandle>();

            int m = matrix.RowCount;
            int n = matrix.ColumnCount;

            this.matrix = matrix;

            this.A = CreateSparse(matrix, handles);
            this.L = new SuperMatrix();
            this.U = new SuperMatrix();

            this.glu = new GlobalLU();

            this.perm_c = new int[n];
            this.perm_r = new int[m];
            this.etree  = new int[n];

            this.R = CreateArray(m);
            this.C = CreateArray(n);

            this.equed = new byte[2];

            options = new SuperLUOptions();
        }
Exemplo n.º 2
0
        protected SuperMatrix CreateDense(Dtype type, T[] vector, List <GCHandle> handles)
        {
            var A = new SuperMatrix();

            A.nrow = vector.Length;
            A.ncol = 1;

            A.Dtype = type;
            A.Mtype = Mtype.SLU_GE;
            A.Stype = Stype.SLU_DN;

            var store = new DNformat();

            store.lda   = vector.Length;
            store.nzval = InteropHelper.Pin(vector, handles);

            A.Store = InteropHelper.Pin(store, handles);

            return(A);
        }
Exemplo n.º 3
0
        protected SuperMatrix CreateEmptyDense(Dtype type, int size, List <GCHandle> handles)
        {
            var A = new SuperMatrix();

            A.nrow = size;
            A.ncol = 0;

            A.Dtype = type;
            A.Mtype = Mtype.SLU_GE;
            A.Stype = Stype.SLU_DN;

            var store = new DNformat();

            store.lda   = size;
            store.nzval = IntPtr.Zero;

            A.Store = InteropHelper.Pin(store, handles);

            return(A);
        }
Exemplo n.º 4
0
        protected SuperMatrix CreateDense(Dtype type, DenseColumnMajorStorage <T> matrix, List <GCHandle> handles)
        {
            var A = new SuperMatrix();

            A.nrow = matrix.RowCount;
            A.ncol = matrix.ColumnCount;

            A.Dtype = type;
            A.Mtype = Mtype.SLU_GE;
            A.Stype = Stype.SLU_DN;

            var store = new DNformat();

            store.lda   = matrix.RowCount;
            store.nzval = InteropHelper.Pin(matrix.Values, handles);

            A.Store = InteropHelper.Pin(store, handles);

            return(A);
        }