2000-04-27 22:03:57 +02:00
|
|
|
|
/*
|
|
|
|
|
|
* MATRIX ALLOCATION MODULE
|
|
|
|
|
|
*
|
|
|
|
|
|
* Author: Advising professor:
|
|
|
|
|
|
* Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
|
|
|
|
|
|
* UC Berkeley
|
|
|
|
|
|
*
|
|
|
|
|
|
* This file contains the allocation and deallocation routines for the
|
|
|
|
|
|
* sparse matrix routines.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> User accessible functions contained in this file:
|
|
|
|
|
|
* spCreate
|
|
|
|
|
|
* spDestroy
|
|
|
|
|
|
* spError
|
|
|
|
|
|
* spWhereSingular
|
|
|
|
|
|
* spGetSize
|
|
|
|
|
|
* spSetReal
|
|
|
|
|
|
* spSetComplex
|
|
|
|
|
|
* spFillinCount
|
|
|
|
|
|
* spElementCount
|
|
|
|
|
|
* spOriginalCount
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Other functions contained in this file:
|
|
|
|
|
|
* spcGetElement
|
|
|
|
|
|
* InitializeElementBlocks
|
|
|
|
|
|
* spcGetFillin
|
|
|
|
|
|
* RecordAllocation
|
|
|
|
|
|
* AllocateBlockOfAllocationList
|
|
|
|
|
|
* EnlargeMatrix
|
|
|
|
|
|
* ExpandTranslationArrays
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Revision and copyright information.
|
|
|
|
|
|
*
|
|
|
|
|
|
* Copyright (c) 1985,86,87,88,89,90
|
|
|
|
|
|
* by Kenneth S. Kundert and the University of California.
|
|
|
|
|
|
*
|
|
|
|
|
|
* Permission to use, copy, modify, and distribute this software and
|
|
|
|
|
|
* its documentation for any purpose and without fee is hereby granted,
|
|
|
|
|
|
* provided that the copyright notices appear in all copies and
|
|
|
|
|
|
* supporting documentation and that the authors and the University of
|
|
|
|
|
|
* California are properly credited. The authors and the University of
|
|
|
|
|
|
* California make no representations as to the suitability of this
|
|
|
|
|
|
* software for any purpose. It is provided `as is', without express
|
|
|
|
|
|
* or implied warranty.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* IMPORTS
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Import descriptions:
|
|
|
|
|
|
* spConfig.h
|
|
|
|
|
|
* Macros that customize the sparse matrix routines.
|
|
|
|
|
|
* spMatrix.h
|
|
|
|
|
|
* Macros and declarations to be imported by the user.
|
|
|
|
|
|
* spDefs.h
|
|
|
|
|
|
* Matrix type and macro definitions for the sparse matrix routines.
|
|
|
|
|
|
*/
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
#include <assert.h>
|
2003-08-23 21:49:03 +02:00
|
|
|
|
#include <stdlib.h>
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
#define spINSIDE_SPARSE
|
2003-08-23 21:49:03 +02:00
|
|
|
|
|
2000-04-27 22:03:57 +02:00
|
|
|
|
#include "spconfig.h"
|
2011-12-11 19:05:00 +01:00
|
|
|
|
#include "ngspice/spmatrix.h"
|
2000-04-27 22:03:57 +02:00
|
|
|
|
#include "spdefs.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Function declarations
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
static void InitializeElementBlocks( MatrixPtr, int, int );
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
static void RecordAllocation( MatrixPtr, void *);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
static void AllocateBlockOfAllocationList( MatrixPtr );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* MATRIX ALLOCATION
|
|
|
|
|
|
*
|
|
|
|
|
|
* Allocates and initializes the data structures associated with a matrix.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Returned:
|
|
|
|
|
|
* A pointer to the matrix is returned cast into the form of a pointer to
|
|
|
|
|
|
* a character. This pointer is then passed and used by the other matrix
|
|
|
|
|
|
* routines to refer to a particular matrix. If an error occurs, the NULL
|
|
|
|
|
|
* pointer is returned.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Size <input> (int)
|
|
|
|
|
|
* Size of matrix or estimate of size of matrix if matrix is EXPANDABLE.
|
|
|
|
|
|
* Complex <input> (int)
|
|
|
|
|
|
* Type of matrix. If Complex is 0 then the matrix is real, otherwise
|
|
|
|
|
|
* the matrix will be complex. Note that if the routines are not set up
|
|
|
|
|
|
* to handle the type of matrix requested, then a spPANIC error will occur.
|
|
|
|
|
|
* Further note that if a matrix will be both real and complex, it must
|
|
|
|
|
|
* be specified here as being complex.
|
|
|
|
|
|
* pError <output> (int *)
|
|
|
|
|
|
* Returns error flag, needed because function spError() will not work
|
|
|
|
|
|
* correctly if spCreate() returns NULL.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Local variables:
|
|
|
|
|
|
* AllocatedSize (int)
|
|
|
|
|
|
* The size of the matrix being allocated.
|
|
|
|
|
|
* Matrix (MatrixPtr)
|
|
|
|
|
|
* A pointer to the matrix frame being created.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Possible errors:
|
|
|
|
|
|
* spNO_MEMORY
|
|
|
|
|
|
* spPANIC
|
|
|
|
|
|
* Error is cleared in this routine.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2010-07-23 19:33:10 +02:00
|
|
|
|
MatrixPtr
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
spCreate(int Size, int Complex, int *pError)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
unsigned SizePlusOne;
|
|
|
|
|
|
MatrixPtr Matrix;
|
|
|
|
|
|
int I;
|
|
|
|
|
|
int AllocatedSize;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spCreate'. */
|
|
|
|
|
|
/* Clear error flag. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*pError = spOKAY;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Test for valid size. */
|
|
|
|
|
|
if ((Size < 0) || (Size == 0 && !EXPANDABLE)) {
|
|
|
|
|
|
*pError = spPANIC;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2003-08-14 13:46:55 +02:00
|
|
|
|
|
|
|
|
|
|
#if 0 /* pn: skipped for cider */
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Test for valid type. */
|
|
|
|
|
|
if (!Complex) {
|
|
|
|
|
|
*pError = spPANIC;
|
|
|
|
|
|
return NULL;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Create Matrix. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
AllocatedSize = MAX( Size, MINIMUM_ALLOCATED_SIZE );
|
|
|
|
|
|
SizePlusOne = (unsigned)(AllocatedSize + 1);
|
|
|
|
|
|
|
2010-10-24 14:51:43 +02:00
|
|
|
|
if ((Matrix = SP_MALLOC(struct MatrixFrame, 1)) == NULL) {
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
*pError = spNO_MEMORY;
|
|
|
|
|
|
return NULL;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Initialize matrix */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Matrix->ID = SPARSE_ID;
|
|
|
|
|
|
Matrix->Complex = Complex;
|
|
|
|
|
|
Matrix->PreviousMatrixWasComplex = Complex;
|
|
|
|
|
|
Matrix->Factored = NO;
|
|
|
|
|
|
Matrix->Elements = 0;
|
|
|
|
|
|
Matrix->Error = *pError;
|
|
|
|
|
|
Matrix->Originals = 0;
|
|
|
|
|
|
Matrix->Fillins = 0;
|
|
|
|
|
|
Matrix->Reordered = NO;
|
|
|
|
|
|
Matrix->NeedsOrdering = YES;
|
|
|
|
|
|
Matrix->NumberOfInterchangesIsOdd = NO;
|
|
|
|
|
|
Matrix->Partitioned = NO;
|
|
|
|
|
|
Matrix->RowsLinked = NO;
|
|
|
|
|
|
Matrix->InternalVectorsAllocated = NO;
|
|
|
|
|
|
Matrix->SingularCol = 0;
|
|
|
|
|
|
Matrix->SingularRow = 0;
|
|
|
|
|
|
Matrix->Size = Size;
|
|
|
|
|
|
Matrix->AllocatedSize = AllocatedSize;
|
|
|
|
|
|
Matrix->ExtSize = Size;
|
|
|
|
|
|
Matrix->AllocatedExtSize = AllocatedSize;
|
|
|
|
|
|
Matrix->CurrentSize = 0;
|
|
|
|
|
|
Matrix->ExtToIntColMap = NULL;
|
|
|
|
|
|
Matrix->ExtToIntRowMap = NULL;
|
|
|
|
|
|
Matrix->IntToExtColMap = NULL;
|
|
|
|
|
|
Matrix->IntToExtRowMap = NULL;
|
|
|
|
|
|
Matrix->MarkowitzRow = NULL;
|
|
|
|
|
|
Matrix->MarkowitzCol = NULL;
|
|
|
|
|
|
Matrix->MarkowitzProd = NULL;
|
|
|
|
|
|
Matrix->DoCmplxDirect = NULL;
|
|
|
|
|
|
Matrix->DoRealDirect = NULL;
|
|
|
|
|
|
Matrix->Intermediate = NULL;
|
|
|
|
|
|
Matrix->RelThreshold = DEFAULT_THRESHOLD;
|
|
|
|
|
|
Matrix->AbsThreshold = 0.0;
|
|
|
|
|
|
|
|
|
|
|
|
Matrix->TopOfAllocationList = NULL;
|
|
|
|
|
|
Matrix->RecordsRemaining = 0;
|
|
|
|
|
|
Matrix->ElementsRemaining = 0;
|
|
|
|
|
|
Matrix->FillinsRemaining = 0;
|
|
|
|
|
|
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, Matrix );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY) goto MemoryError;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Take out the trash. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Matrix->TrashCan.Real = 0.0;
|
|
|
|
|
|
Matrix->TrashCan.Imag = 0.0;
|
|
|
|
|
|
Matrix->TrashCan.Row = 0;
|
|
|
|
|
|
Matrix->TrashCan.Col = 0;
|
|
|
|
|
|
Matrix->TrashCan.NextInRow = NULL;
|
|
|
|
|
|
Matrix->TrashCan.NextInCol = NULL;
|
|
|
|
|
|
#if INITIALIZE
|
|
|
|
|
|
Matrix->TrashCan.pInitInfo = NULL;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate space in memory for Diag pointer vector. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_CALLOC( Matrix->Diag, ElementPtr, SizePlusOne);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Diag == NULL)
|
|
|
|
|
|
goto MemoryError;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate space in memory for FirstInCol pointer vector. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_CALLOC( Matrix->FirstInCol, ElementPtr, SizePlusOne);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->FirstInCol == NULL)
|
|
|
|
|
|
goto MemoryError;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate space in memory for FirstInRow pointer vector. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_CALLOC( Matrix->FirstInRow, ElementPtr, SizePlusOne);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->FirstInRow == NULL)
|
|
|
|
|
|
goto MemoryError;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate space in memory for IntToExtColMap vector. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
if (( Matrix->IntToExtColMap = SP_MALLOC(int, SizePlusOne)) == NULL)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
goto MemoryError;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate space in memory for IntToExtRowMap vector. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
if (( Matrix->IntToExtRowMap = SP_MALLOC(int, SizePlusOne)) == NULL)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
goto MemoryError;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Initialize MapIntToExt vectors. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
for (I = 1; I <= AllocatedSize; I++)
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
{
|
|
|
|
|
|
Matrix->IntToExtRowMap[I] = I;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Matrix->IntToExtColMap[I] = I;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if TRANSLATE
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate space in memory for ExtToIntColMap vector. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
if (( Matrix->ExtToIntColMap = SP_MALLOC(int, SizePlusOne)) == NULL)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
goto MemoryError;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate space in memory for ExtToIntRowMap vector. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
if (( Matrix->ExtToIntRowMap = SP_MALLOC(int, SizePlusOne)) == NULL)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
goto MemoryError;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Initialize MapExtToInt vectors. */
|
|
|
|
|
|
for (I = 1; I <= AllocatedSize; I++) {
|
|
|
|
|
|
Matrix->ExtToIntColMap[I] = -1;
|
|
|
|
|
|
Matrix->ExtToIntRowMap[I] = -1;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
Matrix->ExtToIntColMap[0] = 0;
|
|
|
|
|
|
Matrix->ExtToIntRowMap[0] = 0;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate space for fill-ins and initial set of elements. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
InitializeElementBlocks( Matrix, SPACE_FOR_ELEMENTS*AllocatedSize,
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
SPACE_FOR_FILL_INS*AllocatedSize );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY)
|
|
|
|
|
|
goto MemoryError;
|
|
|
|
|
|
|
2010-07-23 19:33:10 +02:00
|
|
|
|
return Matrix;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
MemoryError:
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Deallocate matrix and return no pointer to matrix if there is not enough
|
|
|
|
|
|
memory. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*pError = spNO_MEMORY;
|
2010-07-23 19:33:10 +02:00
|
|
|
|
spDestroy(Matrix);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* ELEMENT ALLOCATION
|
|
|
|
|
|
*
|
|
|
|
|
|
* This routine allocates space for matrix elements. It requests large blocks
|
|
|
|
|
|
* of storage from the system and doles out individual elements as required.
|
|
|
|
|
|
* This technique, as opposed to allocating elements individually, tends to
|
|
|
|
|
|
* speed the allocation process.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Returned:
|
|
|
|
|
|
* A pointer to an element.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Matrix <input> (MatrixPtr)
|
|
|
|
|
|
* Pointer to matrix.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Local variables:
|
|
|
|
|
|
* pElement (ElementPtr)
|
|
|
|
|
|
* A pointer to the first element in the group of elements being allocated.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Possible errors:
|
|
|
|
|
|
* spNO_MEMORY
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
ElementPtr
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
spcGetElement(MatrixPtr Matrix)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
ElementPtr pElements;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spcGetElement'. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
#if !COMBINE || STRIP || LINT
|
|
|
|
|
|
/* Allocate block of MatrixElements if necessary. */
|
|
|
|
|
|
if (Matrix->ElementsRemaining == 0) {
|
2010-10-24 14:51:43 +02:00
|
|
|
|
pElements = SP_MALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, pElements );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY) return NULL;
|
|
|
|
|
|
Matrix->ElementsRemaining = ELEMENTS_PER_ALLOCATION;
|
|
|
|
|
|
Matrix->NextAvailElement = pElements;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
#if COMBINE || STRIP || LINT
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->ElementsRemaining == 0)
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
{
|
|
|
|
|
|
pListNode = Matrix->LastElementListNode;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* First see if there are any stripped elements left. */
|
|
|
|
|
|
if (pListNode->Next != NULL) {
|
|
|
|
|
|
Matrix->LastElementListNode = pListNode = pListNode->Next;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Matrix->ElementsRemaining = pListNode->NumberOfElementsInList;
|
|
|
|
|
|
Matrix->NextAvailElement = pListNode->pElementList;
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
} else {
|
|
|
|
|
|
/* Allocate block of elements. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
pElements = SP_MALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, pElements );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY) return NULL;
|
|
|
|
|
|
Matrix->ElementsRemaining = ELEMENTS_PER_ALLOCATION;
|
|
|
|
|
|
Matrix->NextAvailElement = pElements;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate an element list structure. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
pListNode->Next = SP_MALLOC(struct ElementListNodeStruct,1);
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, pListNode->Next );
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY)
|
|
|
|
|
|
return NULL;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Matrix->LastElementListNode = pListNode = pListNode->Next;
|
|
|
|
|
|
|
|
|
|
|
|
pListNode->pElementList = pElements;
|
|
|
|
|
|
pListNode->NumberOfElementsInList = ELEMENTS_PER_ALLOCATION;
|
|
|
|
|
|
pListNode->Next = NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Update Element counter and return pointer to Element. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Matrix->ElementsRemaining--;
|
|
|
|
|
|
return Matrix->NextAvailElement++;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* ELEMENT ALLOCATION INITIALIZATION
|
|
|
|
|
|
*
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* This routine allocates space for matrix fill-ins and an initial
|
|
|
|
|
|
* set of elements. Besides being faster than allocating space for
|
|
|
|
|
|
* elements one at a time, it tends to keep the fill-ins physically
|
|
|
|
|
|
* close to the other matrix elements in the computer memory. This
|
|
|
|
|
|
* keeps virtual memory paging to a minimum.
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Matrix <input> (MatrixPtr)
|
|
|
|
|
|
* Pointer to the matrix.
|
|
|
|
|
|
* InitialNumberOfElements <input> (int)
|
|
|
|
|
|
* This number is used as the size of the block of memory, in
|
|
|
|
|
|
* MatrixElements, reserved for elements. If more than this number of
|
|
|
|
|
|
* elements are generated, then more space is allocated later.
|
|
|
|
|
|
* NumberOfFillinsExpected <input> (int)
|
|
|
|
|
|
* This number is used as the size of the block of memory, in
|
|
|
|
|
|
* MatrixElements, reserved for fill-ins. If more than this number of
|
|
|
|
|
|
* fill-ins are generated, then more space is allocated, but they may
|
|
|
|
|
|
* not be physically close in computer's memory.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Local variables:
|
|
|
|
|
|
* pElement (ElementPtr)
|
|
|
|
|
|
* A pointer to the first element in the group of elements being allocated.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Possible errors:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* spNO_MEMORY */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
static void
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
InitializeElementBlocks(MatrixPtr Matrix, int InitialNumberOfElements,
|
|
|
|
|
|
int NumberOfFillinsExpected)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
ElementPtr pElement;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `InitializeElementBlocks'. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate block of MatrixElements for elements. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
pElement = SP_MALLOC(struct MatrixElement, InitialNumberOfElements);
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, pElement );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY) return;
|
|
|
|
|
|
Matrix->ElementsRemaining = InitialNumberOfElements;
|
|
|
|
|
|
Matrix->NextAvailElement = pElement;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate an element list structure. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
Matrix->FirstElementListNode = SP_MALLOC(struct ElementListNodeStruct,1);
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, Matrix->FirstElementListNode );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY) return;
|
|
|
|
|
|
Matrix->LastElementListNode = Matrix->FirstElementListNode;
|
|
|
|
|
|
|
|
|
|
|
|
Matrix->FirstElementListNode->pElementList = pElement;
|
|
|
|
|
|
Matrix->FirstElementListNode->NumberOfElementsInList =
|
|
|
|
|
|
InitialNumberOfElements;
|
|
|
|
|
|
Matrix->FirstElementListNode->Next = NULL;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate block of MatrixElements for fill-ins. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
pElement = SP_MALLOC(struct MatrixElement, NumberOfFillinsExpected);
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, pElement );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY) return;
|
|
|
|
|
|
Matrix->FillinsRemaining = NumberOfFillinsExpected;
|
|
|
|
|
|
Matrix->NextAvailFillin = pElement;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate a fill-in list structure. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
Matrix->FirstFillinListNode = SP_MALLOC(struct FillinListNodeStruct,1);
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, Matrix->FirstFillinListNode );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY) return;
|
|
|
|
|
|
Matrix->LastFillinListNode = Matrix->FirstFillinListNode;
|
|
|
|
|
|
|
|
|
|
|
|
Matrix->FirstFillinListNode->pFillinList = pElement;
|
|
|
|
|
|
Matrix->FirstFillinListNode->NumberOfFillinsInList =NumberOfFillinsExpected;
|
|
|
|
|
|
Matrix->FirstFillinListNode->Next = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* FILL-IN ALLOCATION
|
|
|
|
|
|
*
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* This routine allocates space for matrix fill-ins. It requests
|
|
|
|
|
|
* large blocks of storage from the system and doles out individual
|
|
|
|
|
|
* elements as required. This technique, as opposed to allocating
|
|
|
|
|
|
* elements individually, tends to speed the allocation process.
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*
|
|
|
|
|
|
* >>> Returned:
|
|
|
|
|
|
* A pointer to the fill-in.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Matrix <input> (MatrixPtr)
|
|
|
|
|
|
* Pointer to matrix.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Possible errors:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* spNO_MEMORY */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
ElementPtr
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
spcGetFillin(MatrixPtr Matrix)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spcGetFillin'. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
#if !STRIP || LINT
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->FillinsRemaining == 0)
|
|
|
|
|
|
return spcGetElement( Matrix );
|
|
|
|
|
|
#endif
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
#if STRIP || LINT
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
if (Matrix->FillinsRemaining == 0) {
|
|
|
|
|
|
pListNode = Matrix->LastFillinListNode;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* First see if there are any stripped fill-ins left. */
|
|
|
|
|
|
if (pListNode->Next != NULL) {
|
|
|
|
|
|
Matrix->LastFillinListNode = pListNode = pListNode->Next;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Matrix->FillinsRemaining = pListNode->NumberOfFillinsInList;
|
|
|
|
|
|
Matrix->NextAvailFillin = pListNode->pFillinList;
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
} else {
|
|
|
|
|
|
/* Allocate block of fill-ins. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
pFillins = SP_MALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, pFillins );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY) return NULL;
|
|
|
|
|
|
Matrix->FillinsRemaining = ELEMENTS_PER_ALLOCATION;
|
|
|
|
|
|
Matrix->NextAvailFillin = pFillins;
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate a fill-in list structure. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
pListNode->Next = SP_MALLOC(struct FillinListNodeStruct,1);
|
2013-04-28 13:47:50 +02:00
|
|
|
|
RecordAllocation( Matrix, pListNode->Next );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Matrix->Error == spNO_MEMORY) return NULL;
|
|
|
|
|
|
Matrix->LastFillinListNode = pListNode = pListNode->Next;
|
|
|
|
|
|
|
|
|
|
|
|
pListNode->pFillinList = pFillins;
|
|
|
|
|
|
pListNode->NumberOfFillinsInList = ELEMENTS_PER_ALLOCATION;
|
|
|
|
|
|
pListNode->Next = NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Update Fill-in counter and return pointer to Fill-in. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Matrix->FillinsRemaining--;
|
|
|
|
|
|
return Matrix->NextAvailFillin++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* RECORD A MEMORY ALLOCATION
|
|
|
|
|
|
*
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* This routine is used to record all memory allocations so that the
|
|
|
|
|
|
* memory can be freed later.
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Matrix <input> (MatrixPtr)
|
|
|
|
|
|
* Pointer to the matrix.
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* AllocatedPtr <input> (void *)
|
* src/main.c, src/multidec.c, src/proc2mod.c,
src/frontend/display.c, src/frontend/outitf.c,
src/frontend/help/readhelp.c, src/frontend/help/x11disp.c,
src/frontend/parser/complete.c, src/frontend/parser/glob.c,
src/frontend/plotting/graf.c,
src/frontend/plotting/graphdb.c,
src/frontend/plotting/x11.c, src/include/graph.h,
src/include/iferrmsg.h, src/include/ifsim.h,
src/include/macros.h, src/maths/poly/polyfit.c,
src/maths/sparse/spalloc.c, src/maths/sparse/spconfig.h,
src/misc/alloc.c, src/misc/mktemp.c,
src/spicelib/analysis/cktpzstr.c,
src/spicelib/devices/bsim2/b2temp.c,
src/spicelib/devices/bsim3/b3temp.c,
src/spicelib/devices/bsim3v1/b3v1temp.c,
src/spicelib/devices/bsim3v2/b3v2temp.c,
src/spicelib/devices/bsim4/b4temp.c: replaced malloc
realloc and free calls to use tmalloc trealloc and txfree.
* tests/diffpair.out, tests/fourbitadder.out,
tests/resistance/res_partition.out: Updated.
2000-10-14 15:16:53 +02:00
|
|
|
|
* The pointer returned by tmalloc or calloc. These pointers are
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* saved in a list so that they can be easily freed.
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*
|
|
|
|
|
|
* >>> Possible errors:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* spNO_MEMORY */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
static void
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
RecordAllocation(MatrixPtr Matrix, void *AllocatedPtr )
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `RecordAllocation'. */
|
* src/main.c, src/multidec.c, src/proc2mod.c,
src/frontend/display.c, src/frontend/outitf.c,
src/frontend/help/readhelp.c, src/frontend/help/x11disp.c,
src/frontend/parser/complete.c, src/frontend/parser/glob.c,
src/frontend/plotting/graf.c,
src/frontend/plotting/graphdb.c,
src/frontend/plotting/x11.c, src/include/graph.h,
src/include/iferrmsg.h, src/include/ifsim.h,
src/include/macros.h, src/maths/poly/polyfit.c,
src/maths/sparse/spalloc.c, src/maths/sparse/spconfig.h,
src/misc/alloc.c, src/misc/mktemp.c,
src/spicelib/analysis/cktpzstr.c,
src/spicelib/devices/bsim2/b2temp.c,
src/spicelib/devices/bsim3/b3temp.c,
src/spicelib/devices/bsim3v1/b3v1temp.c,
src/spicelib/devices/bsim3v2/b3v2temp.c,
src/spicelib/devices/bsim4/b4temp.c: replaced malloc
realloc and free calls to use tmalloc trealloc and txfree.
* tests/diffpair.out, tests/fourbitadder.out,
tests/resistance/res_partition.out: Updated.
2000-10-14 15:16:53 +02:00
|
|
|
|
/* If Allocated pointer is NULL, assume that tmalloc returned a
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* NULL pointer, which indicates a spNO_MEMORY error. */
|
|
|
|
|
|
if (AllocatedPtr == NULL) {
|
|
|
|
|
|
Matrix->Error = spNO_MEMORY;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Allocate block of MatrixElements if necessary. */
|
|
|
|
|
|
if (Matrix->RecordsRemaining == 0) {
|
|
|
|
|
|
AllocateBlockOfAllocationList( Matrix );
|
|
|
|
|
|
if (Matrix->Error == spNO_MEMORY) {
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_FREE(AllocatedPtr);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Add Allocated pointer to Allocation List. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
(++Matrix->TopOfAllocationList)->AllocatedPtr = AllocatedPtr;
|
|
|
|
|
|
Matrix->RecordsRemaining--;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* ADD A BLOCK OF SLOTS TO ALLOCATION LIST
|
|
|
|
|
|
*
|
|
|
|
|
|
* This routine increases the size of the allocation list.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Matrix <input> (MatrixPtr)
|
|
|
|
|
|
* Pointer to the matrix.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Local variables:
|
|
|
|
|
|
* ListPtr (AllocationListPtr)
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* Pointer to the list that contains the pointers to segments of
|
|
|
|
|
|
* memory that were allocated by the operating system for the
|
|
|
|
|
|
* current matrix.
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*
|
|
|
|
|
|
* >>> Possible errors:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* spNO_MEMORY */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
static void
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
AllocateBlockOfAllocationList(MatrixPtr Matrix)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
int I;
|
|
|
|
|
|
AllocationListPtr ListPtr;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `AllocateBlockOfAllocationList'. */
|
|
|
|
|
|
/* Allocate block of records for allocation list. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
ListPtr = SP_MALLOC(struct AllocationRecord, (ELEMENTS_PER_ALLOCATION+1));
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
if (ListPtr == NULL) {
|
|
|
|
|
|
Matrix->Error = spNO_MEMORY;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* String entries of allocation list into singly linked list.
|
|
|
|
|
|
List is linked such that any record points to the one before
|
|
|
|
|
|
it. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
ListPtr->NextRecord = Matrix->TopOfAllocationList;
|
|
|
|
|
|
Matrix->TopOfAllocationList = ListPtr;
|
|
|
|
|
|
ListPtr += ELEMENTS_PER_ALLOCATION;
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
for (I = ELEMENTS_PER_ALLOCATION; I > 0; I--) {
|
|
|
|
|
|
ListPtr->NextRecord = ListPtr - 1;
|
|
|
|
|
|
ListPtr--;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Record allocation of space for allocation list on allocation list. */
|
|
|
|
|
|
Matrix->TopOfAllocationList->AllocatedPtr = (void *)ListPtr;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Matrix->RecordsRemaining = ELEMENTS_PER_ALLOCATION;
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* MATRIX DEALLOCATION
|
|
|
|
|
|
*
|
|
|
|
|
|
* Deallocates pointers and elements of Matrix.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* Matrix <input> (void *)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* Pointer to the matrix frame which is to be removed from memory.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Local variables:
|
|
|
|
|
|
* ListPtr (AllocationListPtr)
|
|
|
|
|
|
* Pointer into the linked list of pointers to allocated data structures.
|
|
|
|
|
|
* Points to pointer to structure to be freed.
|
|
|
|
|
|
* NextListPtr (AllocationListPtr)
|
|
|
|
|
|
* Pointer into the linked list of pointers to allocated data structures.
|
|
|
|
|
|
* Points to the next pointer to structure to be freed. This is needed
|
|
|
|
|
|
* because the data structure to be freed could include the current node
|
|
|
|
|
|
* in the allocation list.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2013-04-28 20:00:32 +02:00
|
|
|
|
spDestroy(MatrixPtr Matrix)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
2013-04-28 20:00:32 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
AllocationListPtr ListPtr, NextListPtr;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spDestroy'. */
|
|
|
|
|
|
assert( IS_SPARSE( Matrix ) );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Deallocate the vectors that are located in the matrix frame. */
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_FREE( Matrix->IntToExtColMap );
|
|
|
|
|
|
SP_FREE( Matrix->IntToExtRowMap );
|
|
|
|
|
|
SP_FREE( Matrix->ExtToIntColMap );
|
|
|
|
|
|
SP_FREE( Matrix->ExtToIntRowMap );
|
|
|
|
|
|
SP_FREE( Matrix->Diag );
|
|
|
|
|
|
SP_FREE( Matrix->FirstInRow );
|
|
|
|
|
|
SP_FREE( Matrix->FirstInCol );
|
|
|
|
|
|
SP_FREE( Matrix->MarkowitzRow );
|
|
|
|
|
|
SP_FREE( Matrix->MarkowitzCol );
|
|
|
|
|
|
SP_FREE( Matrix->MarkowitzProd );
|
|
|
|
|
|
SP_FREE( Matrix->DoCmplxDirect );
|
|
|
|
|
|
SP_FREE( Matrix->DoRealDirect );
|
|
|
|
|
|
SP_FREE( Matrix->Intermediate );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Sequentially step through the list of allocated pointers
|
|
|
|
|
|
* freeing pointers along the way. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
ListPtr = Matrix->TopOfAllocationList;
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
while (ListPtr != NULL) {
|
|
|
|
|
|
NextListPtr = ListPtr->NextRecord;
|
|
|
|
|
|
if ((void *) ListPtr == ListPtr->AllocatedPtr) {
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_FREE( ListPtr );
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
} else {
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_FREE( ListPtr->AllocatedPtr );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
ListPtr = NextListPtr;
|
|
|
|
|
|
}
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* RETURN MATRIX ERROR STATUS
|
|
|
|
|
|
*
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* This function is used to determine the error status of the given
|
|
|
|
|
|
* matrix.
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*
|
|
|
|
|
|
* >>> Returned:
|
|
|
|
|
|
* The error status of the given matrix.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* eMatrix <input> (void *)
|
|
|
|
|
|
* The matrix for which the error status is desired. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
int
|
2010-07-23 19:33:10 +02:00
|
|
|
|
spError(MatrixPtr eMatrix )
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spError'. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
if (eMatrix != NULL) {
|
2010-07-23 19:33:10 +02:00
|
|
|
|
assert(eMatrix->ID == SPARSE_ID);
|
|
|
|
|
|
return eMatrix->Error;
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
} else {
|
|
|
|
|
|
/* This error may actually be spPANIC, no way to tell. */
|
|
|
|
|
|
return spNO_MEMORY;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* WHERE IS MATRIX SINGULAR
|
|
|
|
|
|
*
|
|
|
|
|
|
* This function returns the row and column number where the matrix was
|
|
|
|
|
|
* detected as singular or where a zero was detected on the diagonal.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* eMatrix <input> (void *)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* The matrix for which the error status is desired.
|
|
|
|
|
|
* pRow <output> (int *)
|
|
|
|
|
|
* The row number.
|
|
|
|
|
|
* pCol <output> (int *)
|
|
|
|
|
|
* The column number.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2013-04-28 20:00:32 +02:00
|
|
|
|
spWhereSingular(MatrixPtr Matrix, int *pRow, int *pCol)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
2013-04-28 20:00:32 +02:00
|
|
|
|
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spWhereSingular'. */
|
|
|
|
|
|
assert( IS_SPARSE( Matrix ) );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
if (Matrix->Error == spSINGULAR || Matrix->Error == spZERO_DIAG)
|
|
|
|
|
|
{
|
|
|
|
|
|
*pRow = Matrix->SingularRow;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*pCol = Matrix->SingularCol;
|
|
|
|
|
|
}
|
|
|
|
|
|
else *pRow = *pCol = 0;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* MATRIX SIZE
|
|
|
|
|
|
*
|
|
|
|
|
|
* Returns the size of the matrix. Either the internal or external size of
|
|
|
|
|
|
* the matrix is returned.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* eMatrix <input> (void *)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* Pointer to matrix.
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* External <input> (int)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* If External is set TRUE, the external size , i.e., the value of the
|
|
|
|
|
|
* largest external row or column number encountered is returned.
|
|
|
|
|
|
* Otherwise the TRUE size of the matrix is returned. These two sizes
|
|
|
|
|
|
* may differ if the TRANSLATE option is set TRUE.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2013-04-28 20:00:32 +02:00
|
|
|
|
spGetSize(MatrixPtr Matrix, int External)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
2013-04-28 20:00:32 +02:00
|
|
|
|
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spGetSize'. */
|
|
|
|
|
|
assert( IS_SPARSE( Matrix ) );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
#if TRANSLATE
|
|
|
|
|
|
if (External)
|
|
|
|
|
|
return Matrix->ExtSize;
|
|
|
|
|
|
else
|
|
|
|
|
|
return Matrix->Size;
|
|
|
|
|
|
#else
|
|
|
|
|
|
return Matrix->Size;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* SET MATRIX COMPLEX OR REAL
|
|
|
|
|
|
*
|
|
|
|
|
|
* Forces matrix to be either real or complex.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* eMatrix <input> (void *)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* Pointer to matrix.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2010-07-23 19:33:10 +02:00
|
|
|
|
spSetReal(MatrixPtr eMatrix)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spSetReal'. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
2010-07-23 19:33:10 +02:00
|
|
|
|
assert( IS_SPARSE( eMatrix ));
|
|
|
|
|
|
eMatrix->Complex = NO;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2010-07-23 19:33:10 +02:00
|
|
|
|
spSetComplex(MatrixPtr eMatrix)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spSetComplex'. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
2010-07-23 19:33:10 +02:00
|
|
|
|
assert( IS_SPARSE( eMatrix ));
|
|
|
|
|
|
eMatrix->Complex = YES;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* ELEMENT, FILL-IN OR ORIGINAL COUNT
|
|
|
|
|
|
*
|
|
|
|
|
|
* Two functions used to return simple statistics. Either the number
|
|
|
|
|
|
* of total elements, or the number of fill-ins, or the number
|
|
|
|
|
|
* of original elements can be returned.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
* eMatrix <input> (void *)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* Pointer to matrix.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2010-07-23 19:33:10 +02:00
|
|
|
|
spFillinCount(MatrixPtr eMatrix)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spFillinCount'. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
2010-07-23 19:33:10 +02:00
|
|
|
|
assert( IS_SPARSE( eMatrix ) );
|
|
|
|
|
|
return eMatrix->Fillins;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2010-07-23 19:33:10 +02:00
|
|
|
|
spElementCount(MatrixPtr eMatrix)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spElementCount'. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
2010-07-23 19:33:10 +02:00
|
|
|
|
assert( IS_SPARSE( eMatrix ) );
|
|
|
|
|
|
return eMatrix->Elements;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2010-07-23 19:33:10 +02:00
|
|
|
|
spOriginalCount(MatrixPtr eMatrix)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
{
|
* src/include/spconfig.h: Removed spCOMPLEX,
spSEPARATED_COMPLEX_VECTORS and spCOMPATIBILITY defines. This
made including this file from src/include/spmatrix.h unnecessary.
Moved this file to src/maths/sparse/spconfig.h.
* src/include/spmatrix.h: Removed include of
src/include/spconfig.h.
* src/maths/sparse/spalloc.c, src/maths/sparse/spbuild.c,
src/maths/sparse/spcombin.c, src/maths/sparse/spdefs.h,
src/maths/sparse/spfactor.c, src/maths/sparse/spoutput.c,
src/maths/sparse/spsmp.c, src/maths/sparse/spsolve.c,
src/maths/sparse/sputils.c: The other files affected by the
removal of spCOMPLEX, spSEPARATED_COMPLEX_VECTORS and
spCOMPATIBILITY defines. Also: assertions are enabled by
default.
* src/include/smpdefs.h, src/maths/sparse/spsmp.c: SMPmatrix is
now a typedef for void, instead of char. Updated all function
declarations to match this. Also added function prototypes not
previously mentioned in src/include/smpdefs.h.
* src/include/complex.h: Updates of cast from char * to void *
2000-07-03 17:28:50 +02:00
|
|
|
|
/* Begin `spOriginalCount'. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
2010-07-23 19:33:10 +02:00
|
|
|
|
assert( IS_SPARSE( eMatrix ) );
|
|
|
|
|
|
return eMatrix->Originals;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|