矩阵运算程序VC++矩阵运算程序


矩阵运算程序矩阵运算程序矩阵运算程序矩阵运算程序
资源截图
代码片段和文件信息
// ArrayMatrix.cpp: implementation of the CArrayMatrix class.
//
//////////////////////////////////////////////////////////////////////

#include “stdafx.h“
#include “Matrix.h“
#include “ArrayMatrix.h“

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CArrayMatrix Cobject 1)



CArrayMatrix::CArrayMatrix()
{
m_Name=_T(““);
m_wCon=0;
m_wRow=0;
}

CArrayMatrix::~CArrayMatrix()
{

}

void CArrayMatrix::Serialize(CArchive &ar)
{
Cobject::Serialize(ar);
    if(ar.IsStoring())
{
ar< }
    else
    {
ar>>m_Name>>m_wRow>>m_wCon;
}
m_Array.Serialize(ar);
}

CArrayMatrix::CArrayMatrix(const CArrayMatrix & m)
{
m_Name=m.m_Name;
m_wRow=m.m_wRow;
m_wCon=m.m_wCon;
m_Array.SetSize(m_wRow*m_wCon);
for(int i=0;i {
m_Array[i]=m.m_Array[i];
}
}

CArrayMatrix CArrayMatrix::operator +(const CArrayMatrix & m)
{
CArrayMatrix temp;
temp.m_wCon=m_wCon;
temp.m_wRow=m_wRow;
temp.m_Array.SetSize(m_wCon*m_wRow);
for(int i=0;i {
temp.m_Array[i]=m_Array[i]+m.m_Array[i];
}
return temp;
}



BOOL CArrayMatrix::ProcessInput(CString DataString)
{
//获得等号右边的字符串
CString RightString=DataString;
if(!SetStringName(RightStringm_Name)) return FALSE; //获得变量名称,存储到m_Name中去
ProcString(RightString);
int tipnum=0;
int len=lstrlen(RightString);
if(len==0) return FALSE;//表示矩阵没有数据
if(!InputRow(RightString)) return FALSE;
CString * SPtBuffer=NULL;//指向矩阵每行字符串CString的指针
if(!InputCon(RightStringSPtBuffer)) return FALSE;
m_Array.SetSize(m_wCon*m_wRow);
for(int i=0;i<(int)m_wRow;i++)
{
for(int j=0;j<(int)m_wCon;j++)
{
float temp=0.0;
if(!ConvertToNum(SPtBuffer[i]jtemp)) return FALSE;
m_Array[i*m_wCon+j]=temp;
}
}
if(SPtBuffer!=NULL) delete []SPtBuffer;
return true;
}

void CArrayMatrix::ProcStringBlank(CString & sHead)
{
int len=lstrlen(sHead);
if(len==0) return;
CString m_temp=sHead;
sHead.GetBufferSetLength(len+1);
int j=0;
for(int i=0;i {
if(m_temp[i]==TCHAR(‘ ‘)) 
{
if((i+1)!=len&&m_temp[i+1]==TCHAR(‘ ‘)) continue;
else 
{
sHead.SetAt(jsHead[i]);
j++;
}
}
else {sHead.SetAt(jm_temp[i]);j++;}
}
sHead.SetAt(jTCHAR(‘‘));
j=lstrlen(sHead);
sHead.GetBufferSetLength(j);
sHead.Replace(“ 
““
“);
sHead.Replace(“
 ““
“);
}

void CArrayMatrix::ProcStringComma(CString & sHead)
{
sHead.Replace(‘‘‘ ‘);
sHead.Replace(‘;‘‘
‘);
}

void CArrayMatrix::ProcStringEnter(CString & sHead)
{
CString m_temp=sHead;
int len=lstrlen(sHead);
sHead.GetBufferSetLength(len+1);
int j=0;
for(int i=0;i {
if(m_temp[i]==TCHAR(‘
‘)) 
{
if((i+1)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      12129  2001-05-31 23:33  矩阵运算程序ArrayMatrix.cpp

     文件       2161  2002-06-08 20:38  矩阵运算程序ArrayMatrix.h

     文件       2511  2009-10-30 19:49  矩阵运算程序MainFrm.cpp

     文件       1637  2002-11-06 08:43  矩阵运算程序MainFrm.h

     文件      27876  2009-10-30 19:48  矩阵运算程序Matrix.aps

     文件       2202  2009-10-30 19:50  矩阵运算程序Matrix.clw

     文件       4260  2001-05-17 18:14  矩阵运算程序Matrix.cpp

     文件       4938  2001-05-28 00:12  矩阵运算程序Matrix.dsp

     文件        537  2001-05-17 18:14  矩阵运算程序Matrix.dsw

     文件       1356  2001-05-17 18:14  矩阵运算程序Matrix.h

     文件     148480  2009-10-30 19:50  矩阵运算程序Matrix.ncb

     文件      58880  2009-10-30 19:50  矩阵运算程序Matrix.opt

     文件        248  2009-10-30 19:49  矩阵运算程序Matrix.plg

     文件      10908  2002-11-06 08:43  矩阵运算程序Matrix.rc

     文件        680  2001-05-18 19:24  矩阵运算程序Matrix.reg

     文件      15995  2001-05-31 23:03  矩阵运算程序MatrixDoc.cpp

     文件       2215  2001-05-30 16:40  矩阵运算程序MatrixDoc.h

     文件       3297  2001-05-30 17:28  矩阵运算程序MatrixView.cpp

     文件       1663  2001-05-28 14:15  矩阵运算程序MatrixView.h

     文件      42656  2001-05-17 18:16  矩阵运算程序MFM1992

     文件       4601  2001-05-17 18:14  矩阵运算程序ReadMe.txt

     文件      43136  2009-10-30 19:49  矩阵运算程序ReleaseArrayMatrix.obj

     文件      12786  2009-10-30 19:49  矩阵运算程序ReleaseMainFrm.obj

     文件      53248  2009-10-30 19:49  矩阵运算程序ReleaseMatrix.exe

     文件      16267  2009-10-30 19:49  矩阵运算程序ReleaseMatrix.obj

     文件    5692484  2009-10-30 19:49  矩阵运算程序ReleaseMatrix.pch

     文件       6948  2009-10-30 19:49  矩阵运算程序ReleaseMatrix.res

     文件      49103  2009-10-30 19:49  矩阵运算程序ReleaseMatrixDoc.obj

     文件      14838  2009-10-30 19:49  矩阵运算程序ReleaseMatrixView.obj

     文件        750  2009-10-30 19:49  矩阵运算程序ReleaseStdAfx.obj

............此处省略18个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)