Browse Source

Formatting: tabs to spaces

pre-master-46
Holger Vogt 1 year ago
parent
commit
243bdff377
  1. 22
      src/maths/sparse/spalloc.c

22
src/maths/sparse/spalloc.c

@ -129,7 +129,7 @@ spCreate(int Size, int Complex, int *pError)
/* Test for valid size. */ /* Test for valid size. */
#if EXPANDABLE #if EXPANDABLE
if (Size < 0) { if (Size < 0) {
*pError = spPANIC;
*pError = spPANIC;
return NULL; return NULL;
} }
#else #else
@ -153,8 +153,8 @@ spCreate(int Size, int Complex, int *pError)
SizePlusOne = (unsigned)(AllocatedSize + 1); SizePlusOne = (unsigned)(AllocatedSize + 1);
if ((Matrix = SP_MALLOC(struct MatrixFrame, 1)) == NULL) { if ((Matrix = SP_MALLOC(struct MatrixFrame, 1)) == NULL) {
*pError = spNO_MEMORY;
return NULL;
*pError = spNO_MEMORY;
return NULL;
} }
/* Initialize matrix */ /* Initialize matrix */
@ -237,7 +237,7 @@ spCreate(int Size, int Complex, int *pError)
/* Initialize MapIntToExt vectors. */ /* Initialize MapIntToExt vectors. */
for (I = 1; I <= AllocatedSize; I++) for (I = 1; I <= AllocatedSize; I++)
{ {
Matrix->IntToExtRowMap[I] = I;
Matrix->IntToExtRowMap[I] = I;
Matrix->IntToExtColMap[I] = I; Matrix->IntToExtColMap[I] = I;
} }
@ -252,8 +252,8 @@ spCreate(int Size, int Complex, int *pError)
/* Initialize MapExtToInt vectors. */ /* Initialize MapExtToInt vectors. */
for (I = 1; I <= AllocatedSize; I++) { for (I = 1; I <= AllocatedSize; I++) {
Matrix->ExtToIntColMap[I] = -1;
Matrix->ExtToIntRowMap[I] = -1;
Matrix->ExtToIntColMap[I] = -1;
Matrix->ExtToIntRowMap[I] = -1;
} }
Matrix->ExtToIntColMap[0] = 0; Matrix->ExtToIntColMap[0] = 0;
Matrix->ExtToIntRowMap[0] = 0; Matrix->ExtToIntRowMap[0] = 0;
@ -317,7 +317,7 @@ spcGetElement(MatrixPtr Matrix)
#if !COMBINE || STRIP || LINT #if !COMBINE || STRIP || LINT
/* Allocate block of MatrixElements if necessary. */ /* Allocate block of MatrixElements if necessary. */
if (Matrix->ElementsRemaining == 0) { if (Matrix->ElementsRemaining == 0) {
pElements = SP_MALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
pElements = SP_MALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
RecordAllocation( Matrix, pElements ); RecordAllocation( Matrix, pElements );
if (Matrix->Error == spNO_MEMORY) return NULL; if (Matrix->Error == spNO_MEMORY) return NULL;
Matrix->ElementsRemaining = ELEMENTS_PER_ALLOCATION; Matrix->ElementsRemaining = ELEMENTS_PER_ALLOCATION;
@ -422,7 +422,7 @@ InitializeElementBlocks(MatrixPtr Matrix, int InitialNumberOfElements,
Matrix->FirstElementListNode->pElementList = pElement; Matrix->FirstElementListNode->pElementList = pElement;
Matrix->FirstElementListNode->NumberOfElementsInList = Matrix->FirstElementListNode->NumberOfElementsInList =
InitialNumberOfElements;
InitialNumberOfElements;
Matrix->FirstElementListNode->Next = NULL; Matrix->FirstElementListNode->Next = NULL;
/* Allocate block of MatrixElements for fill-ins. */ /* Allocate block of MatrixElements for fill-ins. */
@ -548,15 +548,15 @@ RecordAllocation(MatrixPtr Matrix, void *AllocatedPtr )
/* If Allocated pointer is NULL, assume that tmalloc returned a /* If Allocated pointer is NULL, assume that tmalloc returned a
* NULL pointer, which indicates a spNO_MEMORY error. */ * NULL pointer, which indicates a spNO_MEMORY error. */
if (AllocatedPtr == NULL) { if (AllocatedPtr == NULL) {
Matrix->Error = spNO_MEMORY;
Matrix->Error = spNO_MEMORY;
return; return;
} }
/* Allocate block of MatrixElements if necessary. */ /* Allocate block of MatrixElements if necessary. */
if (Matrix->RecordsRemaining == 0) { if (Matrix->RecordsRemaining == 0) {
AllocateBlockOfAllocationList( Matrix );
AllocateBlockOfAllocationList( Matrix );
if (Matrix->Error == spNO_MEMORY) { if (Matrix->Error == spNO_MEMORY) {
SP_FREE(AllocatedPtr);
SP_FREE(AllocatedPtr);
return; return;
} }
} }

Loading…
Cancel
Save