element.cpp

来自「各种矩阵运算的实现」· C++ 代码 · 共 51 行

CPP
51
字号
// Element.cpp: implementation of the CElement class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Element.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CElement::CElement(const double& item,CElement* previtem/*=NULL*/,CElement* nextitem/*=NULL*/)
{
	cell=item;
	prev=previtem;
	next=nextitem; 
}
//默认已存在的元素是零
CElement::CElement(CElement *previtem/*=NULL*/, CElement *nextitem/*=NULL*/)
{
	cell=0;
	prev=previtem;
	next=nextitem; 
}

CElement::~CElement()
{

}

double CElement::Cell()
{
	return cell;
}

void CElement::Set(double item/*=0*/)
{
	cell=item;
}

void CElement::operator =(CElement &_c_)
{
	if(this==&_c_) return ;
	cell=_c_.Cell();
}

⌨️ 快捷键说明

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