From 221940b3ae2b5c3e7a42eda9c35a91367d326858 Mon Sep 17 00:00:00 2001 From: Francesco Lannutti Date: Thu, 9 Feb 2012 01:53:43 +0100 Subject: [PATCH] KLU-1 Patch for dump_routines and new SMPmatrix structure --- src/maths/sparse/spbuild.c | 20 ------ src/maths/sparse/spoutput.c | 125 ------------------------------------ 2 files changed, 145 deletions(-) diff --git a/src/maths/sparse/spbuild.c b/src/maths/sparse/spbuild.c index d1e19bda2..bcafa6c2d 100644 --- a/src/maths/sparse/spbuild.c +++ b/src/maths/sparse/spbuild.c @@ -77,26 +77,6 @@ static void ExpandTranslationArrays( MatrixPtr, int ); -int WriteCol_original(MatrixPtr Matrix, int Col, spREAL *CSC_Element, int *CSC_Row, spREAL **bind_Sparse, spREAL **bind_KLU, spREAL **diag) { - - int i=0; - ElementPtr current=Matrix->FirstInCol[Col]; - while (current!=NULL) { -// spREAL element=current->Real; - bind_Sparse [i] = (double *)current ; -// CSC_Element[i]=element; - bind_KLU [i] = &(CSC_Element [i]) ; - CSC_Row[i]=(current->Row) - 1; - if (CSC_Row [i] == Col - 1) diag [0] = &(CSC_Element [i]) ; - i++; - current=current->NextInCol; - } - - return i; -} - - - /* * CLEAR MATRIX diff --git a/src/maths/sparse/spoutput.c b/src/maths/sparse/spoutput.c index 9a3b7c9dc..921c4a9a4 100644 --- a/src/maths/sparse/spoutput.c +++ b/src/maths/sparse/spoutput.c @@ -60,131 +60,6 @@ int Printer_Width = PRINTER_WIDTH; #include "ngspice/wstdio.h" #endif -void spMatrix_CSC(MatrixPtr Matrix, int *Ap, int *Ai, double *Ax, int n, double **bind_Sparse, double **bind_KLU, double **diag) { - - int offset, i ; - - offset=0; - Ap[0]=offset; - for (i=1;i<=n;i++) { - offset+=WriteCol_original(Matrix, i, (spREAL*)((long)Ax+offset*sizeof(spREAL)), - (int*)((long)Ai+offset*sizeof(int)), - (spREAL **)((long)bind_Sparse + offset * sizeof(spREAL *)), - (spREAL **)((long)bind_KLU + offset * sizeof(spREAL *)), - (spREAL **)((long)diag + (i - 1) * sizeof(spREAL *))); - - Ap[i]=offset; - } - -} - -void spMatrix_CSC_dump(MatrixPtr Matrix, char *CSC_output) { - - int offset, i, j, *CSC_Ai, *CSC_Ap, *temp_vector_Ap, *temp_vector_Ai, *Q, *Q_new, n, nz, col; - int pstart, pend, dim, k, max_index, max_Ai, temp_Ai; - double **bind ; //FITTIZIO - spREAL temp_elem, *CSC_A, *temp_vector_A; - n=spGetSize(Matrix, 1); - nz = Matrix->Elements ; - Q=(int*)SP_MALLOC(int, n); - temp_vector_Ap=(int*)SP_MALLOC(int, n+1); - temp_vector_Ai=(int*)SP_MALLOC(int, nz); - temp_vector_A=(spREAL*)SP_MALLOC(spREAL, nz); - CSC_Ap=(int*)SP_MALLOC(int, n+1); - CSC_Ai=(int*)SP_MALLOC(int, nz); - CSC_A=(spREAL*)SP_MALLOC(spREAL, nz); - - offset=0; - temp_vector_Ap[0]=offset; - for (i=1;i<=n;i++) { - offset+=WriteCol_original(Matrix, i, (spREAL*)((long)temp_vector_A+offset*sizeof(spREAL)), (int*)((long)temp_vector_Ai+offset*sizeof(int)), (spREAL **)bind, (spREAL **)bind, (spREAL **)bind); //NON FUNZIONA PER ORA - temp_vector_Ap[i]=offset; - Q[i-1]=col; - } - - for (i=0;i