Skip to content

Commit

Permalink
Remove complex part of sparse13 (#3130)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu authored Oct 18, 2024
1 parent 33263d0 commit cf2318c
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 2,032 deletions.
45 changes: 0 additions & 45 deletions src/sparse13/spalloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* spWhereSingular
* spGetSize
* spSetReal
* spSetComplex
* spFillinCount
* spElementCount
*
Expand Down Expand Up @@ -45,11 +44,6 @@
* or implied warranty.
*/

#ifndef lint
static char copyright[] = "Sparse1.3: Copyright (c) 1985,86,87,88 by Kenneth S. Kundert";
static char RCSid[] = "@(#)$Header$";
#endif

/*
* IMPORTS
*
Expand Down Expand Up @@ -126,12 +120,10 @@ char* spCreate(int Size, BOOLEAN Complex, int* pError)
}

/* Test for valid type. */
#if NOT spCOMPLEX
if (Complex) {
*pError = spPANIC;
return NULL;
}
#endif
#if NOT REAL
if (NOT Complex) {
*pError = spPANIC;
Expand Down Expand Up @@ -193,9 +185,6 @@ char* spCreate(int Size, BOOLEAN Complex, int* pError)

/* Take out the trash. */
Matrix->TrashCan.Real = 0.0;
#if spCOMPLEX
Matrix->TrashCan.Imag = 0.0;
#endif
Matrix->TrashCan.Row = 0;
Matrix->TrashCan.Col = 0;
Matrix->TrashCan.NextInRow = NULL;
Expand Down Expand Up @@ -233,24 +222,6 @@ char* spCreate(int Size, BOOLEAN Complex, int* pError)
Matrix->IntToExtColMap[I] = I;
}

#if TRANSLATE
/* Allocate space in memory for ExtToIntColMap vector. */
if ((Matrix->ExtToIntColMap = ALLOC(int, SizePlusOne)) == NULL)
goto MemoryError;

/* Allocate space in memory for ExtToIntRowMap vector. */
if ((Matrix->ExtToIntRowMap = ALLOC(int, SizePlusOne)) == NULL)
goto MemoryError;

/* Initialize MapExtToInt vectors. */
for (I = 1; I <= AllocatedSize; I++) {
Matrix->ExtToIntColMap[I] = -1;
Matrix->ExtToIntRowMap[I] = -1;
}
Matrix->ExtToIntColMap[0] = 0;
Matrix->ExtToIntRowMap[0] = 0;
#endif

/* Allocate space for fill-ins and initial set of elements. */
InitializeElementBlocks(Matrix, SPACE_FOR_ELEMENTS * AllocatedSize,
SPACE_FOR_FILL_INS * AllocatedSize);
Expand Down Expand Up @@ -671,14 +642,7 @@ int spGetSize(char* eMatrix, BOOLEAN External)
/* Begin `spGetSize'. */
ASSERT(IS_SPARSE(Matrix));

#if TRANSLATE
if (External)
return Matrix->ExtSize;
else
return Matrix->Size;
#else
return Matrix->Size;
#endif
}

/*
Expand All @@ -700,15 +664,6 @@ void spSetReal(char* eMatrix)
return;
}

void spSetComplex(char* eMatrix)
{
/* Begin `spSetComplex'. */

ASSERT(IS_SPARSE((MatrixPtr)eMatrix) AND spCOMPLEX);
((MatrixPtr)eMatrix)->Complex = YES;
return;
}

/*
* ELEMENT OR FILL-IN COUNT
*
Expand Down
Loading

0 comments on commit cf2318c

Please sign in to comment.