Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }