⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nireinit.c

📁 支持数字元件仿真的SPICE插件
💻 C
字号:
/* * Copyright (c) 1985 Thomas L. Quarles */    /* NIreinit(ckt)     *  Perform reinitialization necessary for the numerical iteration     *  package - the matrix has now been fully accessed once, so we know     *  how big it is, so allocate RHS vector     */#include "prefix.h"#include "CKTdefs.h"#include <stdio.h>#include "util.h"#include "SMPdefs.h"#include "SPerror.h"#include "suffix.h"RCSID("NIreinit.c $Revision: 1.1 $ on $Date: 91/04/02 11:47:34 $ ")#define CKALLOC(ptr,size,type) if(( ckt->ptr =\    (type *) MALLOC((size)*sizeof(type))) == NULL) return(E_NOMEM);intNIreinit(ckt)    register CKTcircuit *ckt;{    register int size;    register int i;    size = SMPmatSize(ckt->CKTmatrix);    CKALLOC(CKTrhs,size+1,double);    CKALLOC(CKTrhsOld,size+1,double);    CKALLOC(CKTrhsSpare,size+1,double);    CKALLOC(CKTirhs,size+1,double);    CKALLOC(CKTirhsOld,size+1,double);    CKALLOC(CKTirhsSpare,size+1,double);#ifdef PREDICTOR    CKALLOC(CKTpred,size+1,double);    for(i=0;i<8;i++) {        CKALLOC(CKTsols[i],size+1,double);    }#endif /* PREDICTOR */    ckt->CKTniState = NISHOULDREORDER | NIACSHOULDREORDER | NIPZSHOULDREORDER;    return(0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -