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

📄 mynode_imp.cpp

📁 支持简单的公式推导
💻 CPP
字号:
#include "stdafx.h"
#include "mynode.h"



Node::Node(const string& name):expression_(name),is_const_(false),value_(0)
{}

Node::Node(double c):value_(c),is_const_(true),expression_("")
{
	//cout<<"c->Node called\n";
}

Node::Node(const Operand& o)
:value_(o.GetSingleValue()),expression_(o.GetExpression()),is_const_(o.IsConst())
{}

Node::~Node()
{}

bool Node::operator<(const Node& in)const
{      
	
/*	if (IsConst()) // i am a const
	{
		if (in.IsConst())
			return GetResult() < in.GetResult();
		// c - c
		else
			return true;
		//c - f 
	}
	else  // i am factor
	{
		if (!in.IsConst())               
			return GetExpression() < in.GetExpression();
		// f - f
		else
			return false;
		// f - c
	}*/
	return expression_ < in.expression_;
	//认为所有的常数是相等的
	//居然在这里出现了bug!!!!!!!!!!!
}






⌨️ 快捷键说明

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