2000-04-27 22:03:57 +02:00
|
|
|
/*
|
|
|
|
|
* MATRIX UTILITY MODULE
|
|
|
|
|
*
|
|
|
|
|
* This file contains new routines for Spice3f
|
|
|
|
|
*
|
|
|
|
|
* >>> User accessible functions contained in this file:
|
|
|
|
|
* spConstMul
|
|
|
|
|
*
|
|
|
|
|
* >>> Other functions contained in this file:
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#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"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2010-02-13 17:01:56 +01:00
|
|
|
spConstMult(MatrixPtr matrix, double constant)
|
2000-04-27 22:03:57 +02:00
|
|
|
{
|
|
|
|
|
ElementPtr e;
|
|
|
|
|
int i;
|
|
|
|
|
int size = matrix->Size;
|
|
|
|
|
|
|
|
|
|
for (i = 1; i <= size; i++) {
|
|
|
|
|
for (e = matrix->FirstInCol[i]; e; e = e->NextInCol) {
|
|
|
|
|
e->Real *= constant;
|
|
|
|
|
e->Imag *= constant;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|