workaround, make the opaque struct MatrixElement partially visible
this struct is private to the `sparse' world, and lives in "maths/sparse/spdefs.h" which can't be included here, because it is incompatible to the rest of ngspice. this is the same problem as in ciderlib/oned/oneprint.c ciderlib/twod/twoprint.c
This commit is contained in:
parent
f4241ef7ea
commit
ff0ed666a0
|
|
@ -17,6 +17,22 @@ Author: 1985 Thomas L. Quarles
|
||||||
#include "ngspice/trandefs.h"
|
#include "ngspice/trandefs.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
|
// #include "../maths/sparse/spdefs.h"
|
||||||
|
//
|
||||||
|
// this include file from `sparse' is incompatible
|
||||||
|
// with the rest of ngspice
|
||||||
|
// so we can unfortunatly not include here
|
||||||
|
// instead we cheat a bit and
|
||||||
|
// introduce the opaque struct MatrixElement here
|
||||||
|
// (only the first struct members which are of importance to us)
|
||||||
|
|
||||||
|
|
||||||
|
struct MatrixElement
|
||||||
|
{
|
||||||
|
double Real;
|
||||||
|
double Imag;
|
||||||
|
// ...
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
CKTsenComp(CKTcircuit *ckt)
|
CKTsenComp(CKTcircuit *ckt)
|
||||||
|
|
@ -28,8 +44,7 @@ CKTsenComp(CKTcircuit *ckt)
|
||||||
|
|
||||||
#ifdef SENSDEBUG
|
#ifdef SENSDEBUG
|
||||||
char *rowe;
|
char *rowe;
|
||||||
// SMPelement *elt;
|
SMPelement *elt;
|
||||||
double *elt;
|
|
||||||
/*
|
/*
|
||||||
in smpdefs.h steht:
|
in smpdefs.h steht:
|
||||||
typedef struct MatrixElement SMPelement;
|
typedef struct MatrixElement SMPelement;
|
||||||
|
|
@ -108,10 +123,8 @@ typedef struct MatrixElement *ElementPtr;
|
||||||
printf(" Jacobian matrix :\n");
|
printf(" Jacobian matrix :\n");
|
||||||
for (row = 1; row <= size; row++) {
|
for (row = 1; row <= size; row++) {
|
||||||
for (col = 1; col <= size; col++)
|
for (col = 1; col <= size; col++)
|
||||||
if ((elt = (double *)SMPfindElt(ckt->CKTmatrix, row , col , 0)))
|
if ((elt = SMPfindElt(ckt->CKTmatrix, row , col , 0)))
|
||||||
// printf("%.7e ", elt->SMPvalue); ------> gibts nicht
|
printf("%.7e ", elt->Real);
|
||||||
// printf("%.7e ", elt->Real); ------> gibts auch nicht
|
|
||||||
printf("%.7e ", *elt); // ------> geht aber nur für real Werte
|
|
||||||
else
|
else
|
||||||
printf("0.0000000e+00 ");
|
printf("0.0000000e+00 ");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
@ -175,11 +188,9 @@ typedef struct MatrixElement *ElementPtr;
|
||||||
printf(" Jacobian matrix for AC :\n");
|
printf(" Jacobian matrix for AC :\n");
|
||||||
for (row = 1; row <= size; row++) {
|
for (row = 1; row <= size; row++) {
|
||||||
for (col = 1; col <= size; col++) {
|
for (col = 1; col <= size; col++) {
|
||||||
if ((elt = (double *)SMPfindElt(ckt->CKTmatrix, row , col , 0))) {
|
if ((elt = SMPfindElt(ckt->CKTmatrix, row , col , 0))) {
|
||||||
// printf("%.7e ", elt->SMPvalue);
|
printf("%.7e ", elt->Real);
|
||||||
// printf("+j%.7e\t", elt->SMPiValue);
|
printf("+j%.7e\t", elt->Imag);
|
||||||
printf("%.7e ", *elt);
|
|
||||||
printf("+j%.7e\t", *elt+1);
|
|
||||||
} else{
|
} else{
|
||||||
printf("0.0000000e+00 ");
|
printf("0.0000000e+00 ");
|
||||||
printf("+j0.0000000e+00\t");
|
printf("+j0.0000000e+00\t");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue