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

📄 equation.h

📁 circuit calculation program
💻 H
字号:
#ifndef __EQUATION_H__
#define __EQUATION_H__

typedef float coef_t;


/* an item in a polynomial */	
typedef struct item {
	int degree;
	coef_t coef;
} item_t;	
	
/* a polynomial */
typedef struct polynomial {
	int n_item;
	item_t item[1];
} polynomial_t;

polynomial_t * polynomial_mul (polynomial_t *x,polynomial_t *y );
polynomial_t * polynomial_add (polynomial_t *x,polynomial_t *y );
polynomial_t * polynomial_sub (polynomial_t *x,polynomial_t *y );

/* a fraction as coefficient */
typedef struct polynomial_t fraction_t;

#define NUMBERATOR(x)  (x)
#define DENOMINATOR(x) ((polynomial_t *)( ((char *)x)+ sizeof( item_t) * x->n_items ))

/* an equation */
typedef struct equation_item {
	struct equation_item *next;
	int var_index; 
	fraction_t coef;
} * equation_t;

int add_equation (equation_t equation); /* add a new equation */



#endif /*      __EQUATION_H__ */

⌨️ 快捷键说明

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