2000-04-27 22:03:57 +02:00
|
|
|
|
/*
|
|
|
|
|
|
* MATRIX OUTPUT MODULE
|
|
|
|
|
|
*
|
|
|
|
|
|
* Author: Advisor:
|
|
|
|
|
|
* Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
|
|
|
|
|
|
* UC Berkeley
|
|
|
|
|
|
*
|
|
|
|
|
|
* This file contains the output-to-file and output-to-screen routines for
|
|
|
|
|
|
* the matrix package.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> User accessible functions contained in this file:
|
|
|
|
|
|
* spPrint
|
|
|
|
|
|
* spFileMatrix
|
|
|
|
|
|
* spFileVector
|
|
|
|
|
|
* spFileStats
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Other functions contained in this file:
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* 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
|
|
|
|
|
|
#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"
|
|
|
|
|
|
|
|
|
|
|
|
int Printer_Width = PRINTER_WIDTH;
|
|
|
|
|
|
|
2012-02-19 11:23:56 +01:00
|
|
|
|
#include "ngspice/config.h"
|
2013-03-23 09:54:44 +01:00
|
|
|
|
#ifdef HAS_WINGUI
|
2012-02-19 11:23:56 +01:00
|
|
|
|
#include "ngspice/wstdio.h"
|
|
|
|
|
|
#endif
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DOCUMENTATION
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* PRINT MATRIX
|
|
|
|
|
|
*
|
|
|
|
|
|
* Formats and send the matrix to standard output. Some elementary
|
|
|
|
|
|
* statistics are also output. The matrix is output in a format that is
|
|
|
|
|
|
* readable by people.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Matrix <input> (char *)
|
|
|
|
|
|
* Pointer to matrix.
|
|
|
|
|
|
* PrintReordered <input> (int)
|
|
|
|
|
|
* Indicates whether the matrix should be printed out in its original
|
|
|
|
|
|
* form, as input by the user, or whether it should be printed in its
|
|
|
|
|
|
* reordered form, as used by the matrix routines. A zero indicates that
|
|
|
|
|
|
* the matrix should be printed as inputed, a one indicates that it
|
|
|
|
|
|
* should be printed reordered.
|
|
|
|
|
|
* Data <input> (int)
|
|
|
|
|
|
* Boolean flag that when FALSE indicates that output should be
|
|
|
|
|
|
* compressed such that only the existence of an element should be
|
|
|
|
|
|
* indicated rather than giving the actual value. Thus 11 times as
|
|
|
|
|
|
* many can be printed on a row. A zero signifies that the matrix
|
|
|
|
|
|
* should be printed compressed. A one indicates that the matrix
|
|
|
|
|
|
* should be printed in all its glory.
|
|
|
|
|
|
* Header <input> (int)
|
|
|
|
|
|
* Flag indicating that extra information should be given, such as row
|
|
|
|
|
|
* and column numbers.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Local variables:
|
|
|
|
|
|
* Col (int)
|
|
|
|
|
|
* Column being printed.
|
|
|
|
|
|
* ElementCount (int)
|
|
|
|
|
|
* Variable used to count the number of nonzero elements in the matrix.
|
|
|
|
|
|
* LargestElement (RealNumber)
|
|
|
|
|
|
* The magnitude of the largest element in the matrix.
|
|
|
|
|
|
* LargestDiag (RealNumber)
|
|
|
|
|
|
* The magnitude of the largest diagonal in the matrix.
|
|
|
|
|
|
* Magnitude (RealNumber)
|
|
|
|
|
|
* The absolute value of the matrix element being printed.
|
|
|
|
|
|
* PrintOrdToIntColMap (int [])
|
|
|
|
|
|
* A translation array that maps the order that columns will be
|
|
|
|
|
|
* printed in (if not PrintReordered) to the internal column numbers.
|
|
|
|
|
|
* PrintOrdToIntRowMap (int [])
|
|
|
|
|
|
* A translation array that maps the order that rows will be
|
|
|
|
|
|
* printed in (if not PrintReordered) to the internal row numbers.
|
|
|
|
|
|
* pElement (ElementPtr)
|
|
|
|
|
|
* Pointer to the element in the matrix that is to be printed.
|
|
|
|
|
|
* pImagElements (ElementPtr [ ])
|
|
|
|
|
|
* Array of pointers to elements in the matrix. These pointers point
|
|
|
|
|
|
* to the elements whose real values have just been printed. They are
|
|
|
|
|
|
* used to quickly access those same elements so their imaginary values
|
|
|
|
|
|
* can be printed.
|
|
|
|
|
|
* Row (int)
|
|
|
|
|
|
* Row being printed.
|
|
|
|
|
|
* Size (int)
|
|
|
|
|
|
* The size of the matrix.
|
|
|
|
|
|
* SmallestDiag (RealNumber)
|
|
|
|
|
|
* The magnitude of the smallest diagonal in the matrix.
|
|
|
|
|
|
* SmallestElement (RealNumber)
|
|
|
|
|
|
* The magnitude of the smallest element in the matrix excluding zero
|
|
|
|
|
|
* elements.
|
|
|
|
|
|
* StartCol (int)
|
|
|
|
|
|
* The column number of the first column to be printed in the group of
|
|
|
|
|
|
* columns currently being printed.
|
|
|
|
|
|
* StopCol (int)
|
|
|
|
|
|
* The column number of the last column to be printed in the group of
|
|
|
|
|
|
* columns currently being printed.
|
|
|
|
|
|
* Top (int)
|
|
|
|
|
|
* The largest expected external row or column number.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2013-04-28 20:00:32 +02:00
|
|
|
|
spPrint(MatrixPtr Matrix, int PrintReordered, int Data, int Header)
|
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 J = 0;
|
|
|
|
|
|
int I, Row, Col, Size, Top;
|
|
|
|
|
|
int StartCol = 1, StopCol, Columns, ElementCount = 0;
|
2001-02-09 09:18:35 +01:00
|
|
|
|
double Magnitude;
|
|
|
|
|
|
double SmallestDiag = 0;
|
|
|
|
|
|
double SmallestElement = 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
|
|
|
|
double LargestElement = 0.0, LargestDiag = 0.0;
|
|
|
|
|
|
ElementPtr pElement, *pImagElements;
|
|
|
|
|
|
int *PrintOrdToIntRowMap, *PrintOrdToIntColMap;
|
|
|
|
|
|
|
|
|
|
|
|
/* Begin `spPrint'. */
|
|
|
|
|
|
assert( IS_SPARSE( Matrix ) );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Size = Matrix->Size;
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_CALLOC(pImagElements, ElementPtr, Printer_Width / 10 + 1);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if ( pImagElements == 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
|
|
|
|
{
|
|
|
|
|
|
Matrix->Error = spNO_MEMORY;
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_FREE(pImagElements);
|
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
|
|
|
|
/* Create a packed external to internal row and column translation
|
|
|
|
|
|
array. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
# if TRANSLATE
|
|
|
|
|
|
Top = Matrix->AllocatedExtSize;
|
|
|
|
|
|
#else
|
|
|
|
|
|
Top = Matrix->AllocatedSize;
|
|
|
|
|
|
#endif
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_CALLOC( PrintOrdToIntRowMap, int, Top + 1 );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if ( PrintOrdToIntRowMap == 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
|
|
|
|
{
|
|
|
|
|
|
Matrix->Error = spNO_MEMORY;
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_FREE(pImagElements);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_CALLOC( PrintOrdToIntColMap, int, Top + 1 );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (PrintOrdToIntColMap == 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
|
|
|
|
{
|
|
|
|
|
|
Matrix->Error = spNO_MEMORY;
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_FREE(pImagElements);
|
|
|
|
|
|
SP_FREE(PrintOrdToIntRowMap);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
for (I = 1; I <= Size; 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
|
|
|
|
{
|
|
|
|
|
|
PrintOrdToIntRowMap[ Matrix->IntToExtRowMap[I] ] = I;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
PrintOrdToIntColMap[ Matrix->IntToExtColMap[I] ] = 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
|
|
|
|
/* Pack the arrays. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
for (J = 1, I = 1; I <= Top; 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
|
|
|
|
{
|
|
|
|
|
|
if (PrintOrdToIntRowMap[I] != 0)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
PrintOrdToIntRowMap[ J++ ] = PrintOrdToIntRowMap[ I ];
|
|
|
|
|
|
}
|
|
|
|
|
|
for (J = 1, I = 1; I <= Top; 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
|
|
|
|
{
|
|
|
|
|
|
if (PrintOrdToIntColMap[I] != 0)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
PrintOrdToIntColMap[ J++ ] = PrintOrdToIntColMap[ 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
|
|
|
|
/* Print header. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Header)
|
* 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
|
|
|
|
{
|
|
|
|
|
|
printf("MATRIX SUMMARY\n\n");
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf("Size of matrix = %1d x %1d.\n", Size, Size);
|
* 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->Reordered && PrintReordered )
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf("Matrix has been reordered.\n");
|
|
|
|
|
|
putchar('\n');
|
|
|
|
|
|
|
|
|
|
|
|
if ( Matrix->Factored )
|
|
|
|
|
|
printf("Matrix after factorization:\n");
|
|
|
|
|
|
else
|
|
|
|
|
|
printf("Matrix before factorization:\n");
|
|
|
|
|
|
|
|
|
|
|
|
SmallestElement = LARGEST_REAL;
|
|
|
|
|
|
SmallestDiag = SmallestElement;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Determine how many columns to use. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Columns = Printer_Width;
|
|
|
|
|
|
if (Header) Columns -= 5;
|
|
|
|
|
|
if (Data) Columns = (Columns+1) / 10;
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Print matrix by printing groups of complete columns until all
|
|
|
|
|
|
* the columns are printed. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
J = 0;
|
|
|
|
|
|
while ( J <= Size )
|
* 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
|
|
|
|
{
|
|
|
|
|
|
/* Calculatestrchr of last column to printed in this group. */
|
|
|
|
|
|
StopCol = StartCol + Columns - 1;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (StopCol > Size)
|
|
|
|
|
|
StopCol = Size;
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Label the columns. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Header)
|
* 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 (Data)
|
|
|
|
|
|
{
|
|
|
|
|
|
printf(" ");
|
2000-04-27 22:03:57 +02:00
|
|
|
|
for (I = StartCol; I <= StopCol; 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
|
|
|
|
{
|
|
|
|
|
|
if (PrintReordered)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Col = I;
|
|
|
|
|
|
else
|
|
|
|
|
|
Col = PrintOrdToIntColMap[I];
|
|
|
|
|
|
printf(" %9d", Matrix->IntToExtColMap[ Col ]);
|
|
|
|
|
|
}
|
|
|
|
|
|
printf("\n\n");
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
* 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 (PrintReordered)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf("Columns %1d to %1d.\n",StartCol,StopCol);
|
|
|
|
|
|
else
|
* 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
|
|
|
|
{
|
|
|
|
|
|
printf("Columns %1d to %1d.\n",
|
|
|
|
|
|
Matrix->IntToExtColMap[ PrintOrdToIntColMap[StartCol] ],
|
|
|
|
|
|
Matrix->IntToExtColMap[ PrintOrdToIntColMap[StopCol] ]);
|
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
|
|
|
|
/* Print every row ... */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
for (I = 1; I <= Size; 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
|
|
|
|
{
|
|
|
|
|
|
if (PrintReordered)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Row = I;
|
|
|
|
|
|
else
|
|
|
|
|
|
Row = PrintOrdToIntRowMap[I];
|
|
|
|
|
|
|
|
|
|
|
|
if (Header)
|
* 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 (PrintReordered && !Data)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf("%4d", I);
|
|
|
|
|
|
else
|
|
|
|
|
|
printf("%4d", Matrix->IntToExtRowMap[ Row ]);
|
* 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 (!Data) putchar(' ');
|
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
|
|
|
|
/* ... in each column of the group. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
for (J = StartCol; J <= StopCol; J++)
|
* 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 (PrintReordered)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Col = J;
|
|
|
|
|
|
else
|
|
|
|
|
|
Col = PrintOrdToIntColMap[J];
|
|
|
|
|
|
|
|
|
|
|
|
pElement = Matrix->FirstInCol[Col];
|
* 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(pElement != NULL && pElement->Row != Row)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
pElement = pElement->NextInCol;
|
|
|
|
|
|
|
|
|
|
|
|
if (Data)
|
|
|
|
|
|
pImagElements[J - StartCol] = pElement;
|
|
|
|
|
|
|
|
|
|
|
|
if (pElement != 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
|
|
|
|
{
|
|
|
|
|
|
/* Case where element exists */
|
|
|
|
|
|
if (Data)
|
2013-04-28 13:50:13 +02:00
|
|
|
|
printf(" %9.3g", pElement->Real);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
else
|
|
|
|
|
|
putchar('x');
|
|
|
|
|
|
|
* 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 status variables */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if ( (Magnitude = ELEMENT_MAG(pElement)) > LargestElement )
|
|
|
|
|
|
LargestElement = Magnitude;
|
* 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 ((Magnitude < SmallestElement) && (Magnitude != 0.0))
|
2000-04-27 22:03:57 +02:00
|
|
|
|
SmallestElement = Magnitude;
|
|
|
|
|
|
ElementCount++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Case where element is structurally zero */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
else
|
* 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 (Data)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf(" ...");
|
|
|
|
|
|
else
|
|
|
|
|
|
putchar('.');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
putchar('\n');
|
|
|
|
|
|
|
* 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->Complex && Data)
|
|
|
|
|
|
{
|
|
|
|
|
|
printf(" ");
|
2000-04-27 22:03:57 +02:00
|
|
|
|
for (J = StartCol; J <= StopCol; J++)
|
* 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 (pImagElements[J - StartCol] != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
printf(" %8.2gj",
|
2013-04-28 13:50:13 +02:00
|
|
|
|
pImagElements[J-StartCol]->Imag);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
else printf(" ");
|
|
|
|
|
|
}
|
|
|
|
|
|
putchar('\n');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Calculatestrchr of first column in next group. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
StartCol = StopCol;
|
|
|
|
|
|
StartCol++;
|
|
|
|
|
|
putchar('\n');
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Header)
|
* 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
|
|
|
|
{
|
|
|
|
|
|
printf("\nLargest element in matrix = %-1.4g.\n", LargestElement);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf("Smallest element in matrix = %-1.4g.\n", SmallestElement);
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Search for largest and smallest diagonal values */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
for (I = 1; I <= Size; 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
|
|
|
|
{
|
|
|
|
|
|
if (Matrix->Diag[I] != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
Magnitude = ELEMENT_MAG( Matrix->Diag[I] );
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if ( Magnitude > LargestDiag ) LargestDiag = Magnitude;
|
|
|
|
|
|
if ( Magnitude < SmallestDiag ) SmallestDiag = Magnitude;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Print the largest and smallest diagonal values */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if ( Matrix->Factored )
|
* 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
|
|
|
|
{
|
|
|
|
|
|
printf("\nLargest diagonal element = %-1.4g.\n", LargestDiag);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf("Smallest diagonal element = %-1.4g.\n", SmallestDiag);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
* 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
|
|
|
|
{
|
|
|
|
|
|
printf("\nLargest pivot element = %-1.4g.\n", LargestDiag);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf("Smallest pivot element = %-1.4g.\n", SmallestDiag);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Calculate and print sparsity and number of fill-ins created. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf("\nDensity = %2.2f%%.\n", ((double)(ElementCount * 100)) /
|
* 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
|
|
|
|
((double)(Size * Size)));
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
|
|
|
|
|
printf("Number of originals = %1d.\n", Matrix->Originals);
|
* 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->NeedsOrdering)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
printf("Number of fill-ins = %1d.\n", Matrix->Fillins);
|
|
|
|
|
|
}
|
|
|
|
|
|
putchar('\n');
|
|
|
|
|
|
(void)fflush(stdout);
|
|
|
|
|
|
|
2010-10-24 14:51:43 +02:00
|
|
|
|
SP_FREE(PrintOrdToIntColMap);
|
|
|
|
|
|
SP_FREE(PrintOrdToIntRowMap);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* OUTPUT MATRIX TO FILE
|
|
|
|
|
|
*
|
|
|
|
|
|
* Writes matrix to file in format suitable to be read back in by the
|
|
|
|
|
|
* matrix test program.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Returns:
|
|
|
|
|
|
* One is returned if routine was successful, otherwise zero is returned.
|
|
|
|
|
|
* The calling function can query errno (the system global error variable)
|
|
|
|
|
|
* as to the reason why this routine failed.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Matrix <input> (char *)
|
|
|
|
|
|
* Pointer to matrix.
|
|
|
|
|
|
* File <input> (char *)
|
|
|
|
|
|
* Name of file into which matrix is to be written.
|
|
|
|
|
|
* Label <input> (char *)
|
|
|
|
|
|
* String that is transferred to file and is used as a label.
|
* 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
|
|
|
|
* Reordered <input> (int)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* Specifies whether matrix should be output in reordered form,
|
|
|
|
|
|
* or in original order.
|
* 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
|
|
|
|
* Data <input> (int)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* Indicates that the element values should be output along with
|
|
|
|
|
|
* the indices for each element. This parameter must be TRUE if
|
|
|
|
|
|
* matrix is to be read by the sparse test program.
|
* 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
|
|
|
|
* Header <input> (int)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* Indicates that header is desired. This parameter must be TRUE if
|
|
|
|
|
|
* matrix is to be read by the sparse test program.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Local variables:
|
|
|
|
|
|
* Col (int)
|
|
|
|
|
|
* The original column number of the element being output.
|
|
|
|
|
|
* pElement (ElementPtr)
|
|
|
|
|
|
* Pointer to an element in the matrix.
|
|
|
|
|
|
* pMatrixFile (FILE *)
|
|
|
|
|
|
* File pointer to the matrix file.
|
|
|
|
|
|
* Row (int)
|
|
|
|
|
|
* The original row number of the element being output.
|
|
|
|
|
|
* Size (int)
|
|
|
|
|
|
* The size of the matrix.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2013-04-28 20:00:32 +02:00
|
|
|
|
spFileMatrix(MatrixPtr Matrix, char *File, char *Label, int Reordered,
|
* 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 Data, int Header)
|
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, Size;
|
|
|
|
|
|
ElementPtr pElement;
|
|
|
|
|
|
int Row, Col, Err;
|
|
|
|
|
|
FILE *pMatrixFile;
|
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 `spFileMatrix'. */
|
|
|
|
|
|
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
|
|
|
|
/* Open file matrix file in write mode. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if ((pMatrixFile = fopen(File, "w")) == NULL)
|
|
|
|
|
|
return 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
|
|
|
|
/* Output header. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Size = Matrix->Size;
|
|
|
|
|
|
if (Header)
|
* 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->Factored && Data)
|
|
|
|
|
|
{
|
|
|
|
|
|
Err = fprintf(pMatrixFile,
|
|
|
|
|
|
"Warning : The following matrix is "
|
|
|
|
|
|
"factored in to LU form.\n");
|
|
|
|
|
|
if (Err < 0)
|
|
|
|
|
|
return 0;
|
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 (fprintf(pMatrixFile, "%s\n", Label) < 0)
|
|
|
|
|
|
return 0;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Err = fprintf( pMatrixFile, "%d\t%s\n", Size,
|
* 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->Complex ? "complex" : "real"));
|
|
|
|
|
|
if (Err < 0)
|
|
|
|
|
|
return 0;
|
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
|
|
|
|
/* Output matrix. */
|
|
|
|
|
|
if (!Data)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (I = 1; I <= Size; I++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pElement = Matrix->FirstInCol[I];
|
2000-04-27 22:03:57 +02:00
|
|
|
|
while (pElement != 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
|
|
|
|
{
|
|
|
|
|
|
if (Reordered)
|
|
|
|
|
|
{
|
|
|
|
|
|
Row = pElement->Row;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Col = I;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
* 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
|
|
|
|
{
|
|
|
|
|
|
Row = Matrix->IntToExtRowMap[pElement->Row];
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Col = Matrix->IntToExtColMap[I];
|
|
|
|
|
|
}
|
|
|
|
|
|
pElement = pElement->NextInCol;
|
|
|
|
|
|
if (fprintf(pMatrixFile, "%d\t%d\n", Row, Col) < 0) return 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
|
|
|
|
/* Output terminator, a line of zeros. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Header)
|
|
|
|
|
|
if (fprintf(pMatrixFile, "0\t0\n") < 0) return 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
|
|
|
|
if (Data && Matrix->Complex)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (I = 1; I <= Size; I++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pElement = Matrix->FirstInCol[I];
|
2000-04-27 22:03:57 +02:00
|
|
|
|
while (pElement != 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
|
|
|
|
{
|
|
|
|
|
|
if (Reordered)
|
|
|
|
|
|
{
|
|
|
|
|
|
Row = pElement->Row;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Col = I;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
* 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
|
|
|
|
{
|
|
|
|
|
|
Row = Matrix->IntToExtRowMap[pElement->Row];
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Col = Matrix->IntToExtColMap[I];
|
|
|
|
|
|
}
|
|
|
|
|
|
Err = fprintf
|
* 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
|
|
|
|
( pMatrixFile,"%d\t%d\t%-.15g\t%-.15g\n",
|
2013-04-28 13:50:13 +02:00
|
|
|
|
Row, Col, pElement->Real, pElement->Imag
|
* 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
|
|
|
|
);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Err < 0) return 0;
|
|
|
|
|
|
pElement = pElement->NextInCol;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
* 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
|
|
|
|
/* Output terminator, a line of zeros. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Header)
|
|
|
|
|
|
if (fprintf(pMatrixFile,"0\t0\t0.0\t0.0\n") < 0) return 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
|
|
|
|
if (Data && !Matrix->Complex)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (I = 1; I <= Size; I++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pElement = Matrix->FirstInCol[I];
|
2000-04-27 22:03:57 +02:00
|
|
|
|
while (pElement != 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
|
|
|
|
{
|
|
|
|
|
|
Row = Matrix->IntToExtRowMap[pElement->Row];
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Col = Matrix->IntToExtColMap[I];
|
|
|
|
|
|
Err = fprintf
|
* 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
|
|
|
|
( pMatrixFile,"%d\t%d\t%-.15g\n",
|
2013-04-28 13:50:13 +02:00
|
|
|
|
Row, Col, pElement->Real
|
* 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
|
|
|
|
);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Err < 0) return 0;
|
|
|
|
|
|
pElement = pElement->NextInCol;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
* 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
|
|
|
|
/* Output terminator, a line of zeros. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Header)
|
|
|
|
|
|
if (fprintf(pMatrixFile,"0\t0\t0.0\n") < 0) return 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
|
|
|
|
/* Close file. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (fclose(pMatrixFile) < 0) return 0;
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* OUTPUT SOURCE VECTOR TO FILE
|
|
|
|
|
|
*
|
|
|
|
|
|
* Writes vector to file in format suitable to be read back in by the
|
|
|
|
|
|
* matrix test program. This routine should be executed after the function
|
|
|
|
|
|
* spFileMatrix.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Returns:
|
|
|
|
|
|
* One is returned if routine was successful, otherwise zero is returned.
|
|
|
|
|
|
* The calling function can query errno (the system global error variable)
|
|
|
|
|
|
* as to the reason why this routine failed.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Matrix <input> (char *)
|
|
|
|
|
|
* Pointer to matrix.
|
|
|
|
|
|
* File <input> (char *)
|
|
|
|
|
|
* Name of file into which matrix is to be written.
|
|
|
|
|
|
* RHS <input> (RealNumber [])
|
* 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
|
|
|
|
* Right-hand side vector, real portion
|
2000-04-27 22:03:57 +02:00
|
|
|
|
* iRHS <input> (RealNumber [])
|
* 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
|
|
|
|
* Right-hand side vector, imaginary portion.
|
2000-04-27 22:03:57 +02:00
|
|
|
|
*
|
|
|
|
|
|
* >>> Local variables:
|
|
|
|
|
|
* pMatrixFile (FILE *)
|
|
|
|
|
|
* File pointer to the matrix file.
|
|
|
|
|
|
* Size (int)
|
|
|
|
|
|
* The size of the matrix.
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2013-04-28 20:00:32 +02:00
|
|
|
|
spFileVector(MatrixPtr Matrix, char *File, RealVector RHS, RealVector iRHS)
|
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, Size, Err;
|
|
|
|
|
|
FILE *pMatrixFile;
|
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 `spFileVector'. */
|
|
|
|
|
|
assert( IS_SPARSE( Matrix ) && RHS != NULL);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
|
2012-02-19 12:11:31 +01:00
|
|
|
|
if (File) {
|
|
|
|
|
|
/* Open File in append mode. */
|
|
|
|
|
|
pMatrixFile = fopen(File,"a");
|
|
|
|
|
|
if (pMatrixFile == NULL)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
pMatrixFile=stdout;
|
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
|
|
|
|
/* Output vector. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Size = Matrix->Size;
|
|
|
|
|
|
if (Matrix->Complex)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (I = 1; I <= Size; 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
|
|
|
|
{
|
|
|
|
|
|
Err = fprintf
|
|
|
|
|
|
( pMatrixFile, "%-.15g\t%-.15g\n",
|
2013-04-28 13:50:13 +02:00
|
|
|
|
RHS[I], iRHS[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
|
|
|
|
);
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if (Err < 0) return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
* 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 = 1; I <= Size; I++)
|
|
|
|
|
|
{
|
2013-04-28 13:50:13 +02:00
|
|
|
|
if (fprintf(pMatrixFile, "%-.15g\n", RHS[I]) < 0)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return 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
|
|
|
|
/* Close file. */
|
2012-02-19 12:11:31 +01:00
|
|
|
|
if (File)
|
|
|
|
|
|
if (fclose(pMatrixFile) < 0) return 0;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* OUTPUT STATISTICS TO FILE
|
|
|
|
|
|
*
|
|
|
|
|
|
* Writes useful information concerning the matrix to a file. Should be
|
|
|
|
|
|
* executed after the matrix is factored.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Returns:
|
|
|
|
|
|
* One is returned if routine was successful, otherwise zero is returned.
|
|
|
|
|
|
* The calling function can query errno (the system global error variable)
|
|
|
|
|
|
* as to the reason why this routine failed.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Arguments:
|
|
|
|
|
|
* Matrix <input> (char *)
|
|
|
|
|
|
* Pointer to matrix.
|
|
|
|
|
|
* File <input> (char *)
|
|
|
|
|
|
* Name of file into which matrix is to be written.
|
|
|
|
|
|
* Label <input> (char *)
|
|
|
|
|
|
* String that is transferred to file and is used as a label.
|
|
|
|
|
|
*
|
|
|
|
|
|
* >>> Local variables:
|
|
|
|
|
|
* Data (RealNumber)
|
|
|
|
|
|
* The value of the matrix element being output.
|
|
|
|
|
|
* LargestElement (RealNumber)
|
|
|
|
|
|
* The largest element in the matrix.
|
|
|
|
|
|
* NumberOfElements (int)
|
|
|
|
|
|
* Number of nonzero elements in the matrix.
|
|
|
|
|
|
* pElement (ElementPtr)
|
|
|
|
|
|
* Pointer to an element in the matrix.
|
|
|
|
|
|
* pStatsFile (FILE *)
|
|
|
|
|
|
* File pointer to the statistics file.
|
|
|
|
|
|
* Size (int)
|
|
|
|
|
|
* The size of the matrix.
|
|
|
|
|
|
* SmallestElement (RealNumber)
|
|
|
|
|
|
* The smallest element in the matrix excluding zero elements.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2013-04-28 20:00:32 +02:00
|
|
|
|
spFileStats(MatrixPtr Matrix, char *File, char *Label)
|
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 Size, I;
|
|
|
|
|
|
ElementPtr pElement;
|
|
|
|
|
|
int NumberOfElements;
|
|
|
|
|
|
RealNumber Data, LargestElement, SmallestElement;
|
2010-06-25 21:49:13 +02:00
|
|
|
|
FILE *pStatsFile;
|
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 `spFileStats'. */
|
|
|
|
|
|
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
|
|
|
|
/* Open File in append mode. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
if ((pStatsFile = fopen(File, "a")) == NULL)
|
|
|
|
|
|
return 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
|
|
|
|
/* Output statistics. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Size = Matrix->Size;
|
* 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->Factored)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
fprintf(pStatsFile, "Matrix has not been factored.\n");
|
|
|
|
|
|
fprintf(pStatsFile, "||| Starting new matrix |||\n");
|
|
|
|
|
|
fprintf(pStatsFile, "%s\n", Label);
|
|
|
|
|
|
if (Matrix->Complex)
|
|
|
|
|
|
fprintf(pStatsFile, "Matrix is complex.\n");
|
|
|
|
|
|
else
|
|
|
|
|
|
fprintf(pStatsFile, "Matrix is real.\n");
|
|
|
|
|
|
fprintf(pStatsFile," Size = %d\n",Size);
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Search matrix. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
NumberOfElements = 0;
|
|
|
|
|
|
LargestElement = 0.0;
|
|
|
|
|
|
SmallestElement = LARGEST_REAL;
|
|
|
|
|
|
|
|
|
|
|
|
for (I = 1; I <= Size; 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
|
|
|
|
{
|
|
|
|
|
|
pElement = Matrix->FirstInCol[I];
|
2000-04-27 22:03:57 +02:00
|
|
|
|
while (pElement != 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
|
|
|
|
{
|
|
|
|
|
|
NumberOfElements++;
|
2000-04-27 22:03:57 +02:00
|
|
|
|
Data = ELEMENT_MAG(pElement);
|
|
|
|
|
|
if (Data > LargestElement)
|
|
|
|
|
|
LargestElement = Data;
|
* 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 (Data < SmallestElement && Data != 0.0)
|
2000-04-27 22:03:57 +02:00
|
|
|
|
SmallestElement = Data;
|
|
|
|
|
|
pElement = pElement->NextInCol;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SmallestElement = MIN( SmallestElement, LargestElement );
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Output remaining statistics. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
fprintf(pStatsFile, " Initial number of elements = %d\n",
|
|
|
|
|
|
NumberOfElements - Matrix->Fillins);
|
|
|
|
|
|
fprintf(pStatsFile,
|
|
|
|
|
|
" Initial average number of elements per row = %f\n",
|
|
|
|
|
|
(double)(NumberOfElements - Matrix->Fillins) / (double)Size);
|
|
|
|
|
|
fprintf(pStatsFile, " Fill-ins = %d\n",Matrix->Fillins);
|
|
|
|
|
|
fprintf(pStatsFile, " Average number of fill-ins per row = %f%%\n",
|
|
|
|
|
|
(double)Matrix->Fillins / (double)Size);
|
|
|
|
|
|
fprintf(pStatsFile, " Total number of elements = %d\n",
|
|
|
|
|
|
NumberOfElements);
|
|
|
|
|
|
fprintf(pStatsFile, " Average number of elements per row = %f\n",
|
|
|
|
|
|
(double)NumberOfElements / (double)Size);
|
|
|
|
|
|
fprintf(pStatsFile," Density = %f%%\n",
|
|
|
|
|
|
(double)(100.0*NumberOfElements)/(double)(Size*Size));
|
|
|
|
|
|
fprintf(pStatsFile," Relative Threshold = %e\n", Matrix->RelThreshold);
|
|
|
|
|
|
fprintf(pStatsFile," Absolute Threshold = %e\n", Matrix->AbsThreshold);
|
|
|
|
|
|
fprintf(pStatsFile," Largest Element = %e\n", LargestElement);
|
|
|
|
|
|
fprintf(pStatsFile," Smallest Element = %e\n\n\n", SmallestElement);
|
|
|
|
|
|
|
* 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
|
|
|
|
/* Close file. */
|
2000-04-27 22:03:57 +02:00
|
|
|
|
(void)fclose(pStatsFile);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif /* DOCUMENTATION */
|