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

📄 evtnext_time.c

📁 ngspice又一个电子CAD仿真软件代码.功能更全
💻 C
字号:
/*============================================================================FILE    EVTnext_time.cMEMBER OF process XSPICECopyright 1991Georgia Tech Research CorporationAtlanta, Georgia 30332All Rights ReservedPROJECT A-8503AUTHORS    9/12/91  Bill KuhnMODIFICATIONS    <date> <person name> <nature of modifications>SUMMARY    This file contains function EVTnext_time which determines and    returns the time of the next scheduled event on the inst and output    queues.INTERFACES    double EVTnext_time(CKTcircuit *ckt)REFERENCED FILES    None.NON-STANDARD FEATURES    None.============================================================================*/#include <stdio.h>#include "ngspice.h"#include "cktdefs.h"//#include "util.h"#include "mif.h"#include "evt.h"#include "evtproto.h"/*EVTnext_timeGet the next event time as the minimum of the next timesin the inst and output queues.  If no next time in either,return machine infinity.*/double EVTnext_time(    CKTcircuit *ckt)   /* The circuit structure */{    double  next_time;    Evt_Inst_Queue_t    *inst_queue;    Evt_Output_Queue_t  *output_queue;    /* Initialize next time to machine infinity */    next_time = 1e30;    /* Get pointers for fast access */    inst_queue = &(ckt->evt->queue.inst);    output_queue = &(ckt->evt->queue.output);    /* If anything pending in inst queue, set next time */    /* to minimum of itself and the inst queue next time */    if(inst_queue->num_pending)        if(inst_queue->next_time < next_time)            next_time = inst_queue->next_time;    /* If anything pending in output queue, set next time */    /* to minimum of itself and the output queue next time */    if(output_queue->num_pending)        if(output_queue->next_time < next_time)            next_time = output_queue->next_time;    return(next_time);}

⌨️ 快捷键说明

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