资源简介
网络上的Matrix运算库繁多,但有很多功能不够完整,或缺少注释,给使用者带来不少麻烦。该函数库是我搜集到的比较全面的矩阵运算库,而且附带引自清华大学bbs上的函数功能注释,使用方便。
内容包括:
Matrix.cpp 执行文件
Matrix.h 头文件
【matrix头文件声明注释】.txt 函数注释说明文件
亲测vs2010下可用
如果涉及到大型稀疏矩阵的运算可以参照我的另一个suitesparse资源

代码片段和文件信息
// Matrix.cpp: implementation of the CMatrix class.
//
//////////////////////////////////////////////////////////////////////
//#include “stdafx.h“
//#include “ldi.h“
#include
#include “Matrix.h“
#include
using namespace std;
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
// 基本构造函数
//////////////////////////////////////////////////////////////////////
CMatrix::CMatrix()
{
m_nNumColumns = 1;
m_nNumRows = 1;
m_pData = NULL;
BOOL bSuccess = Init(m_nNumRows m_nNumColumns);
ASSERT(bSuccess);
}
//////////////////////////////////////////////////////////////////////
// 指定行列构造函数
//
// 参数:
// 1. int nRows - 指定的矩阵行数
// 2. int nCols - 指定的矩阵列数
//////////////////////////////////////////////////////////////////////
CMatrix::CMatrix(int nRows int nCols)
{
m_nNumRows = nRows;
m_nNumColumns = nCols;
m_pData = NULL;
BOOL bSuccess = Init(m_nNumRows m_nNumColumns);
ASSERT(bSuccess);
}
//////////////////////////////////////////////////////////////////////
// 指定值构造函数
//
// 参数:
// 1. int nRows - 指定的矩阵行数
// 2. int nCols - 指定的矩阵列数
// 3. double value[] - 一维数组,长度为nRows*nCols,存储矩阵各元素的值
//////////////////////////////////////////////////////////////////////
CMatrix::CMatrix(int nRows int nCols double value[])
{
m_nNumRows = nRows;
m_nNumColumns = nCols;
m_pData = NULL;
BOOL bSuccess = Init(m_nNumRows m_nNumColumns);
ASSERT(bSuccess);
SetData(value);
}
//////////////////////////////////////////////////////////////////////
// 方阵构造函数
//
// 参数:
// 1. int nSize - 方阵行列数
//////////////////////////////////////////////////////////////////////
CMatrix::CMatrix(int nSize)
{
m_nNumRows = nSize;
m_nNumColumns = nSize;
m_pData = NULL;
BOOL bSuccess = Init(nSize nSize);
ASSERT (bSuccess);
}
//////////////////////////////////////////////////////////////////////
// 方阵构造函数
//
// 参数:
// 1. int nSize - 方阵行列数
// 2. double value[] - 一维数组,长度为nRows*nRows,存储方阵各元素的值
//////////////////////////////////////////////////////////////////////
CMatrix::CMatrix(int nSize double value[])
{
m_nNumRows = nSize;
m_nNumColumns = nSize;
m_pData = NULL;
BOOL bSuccess = Init(nSize nSize);
ASSERT (bSuccess);
SetData(value);
}
//////////////////////////////////////////////////////////////////////
// 拷贝构造函数
//
// 参数:
// 1. const CMatrix& other - 源矩阵
//////////////////////////////////////////////////////////////////////
CMatrix::CMatrix(const CMatrix& other)
{
m_nNumColumns = other.GetNumColumns();
m_nNumRows = other.GetNumRows();
m_pData = NULL;
BOOL bSuccess = Init(m_nNumRows m_nNumColumns);
ASSERT(bSuccess);
// copy the pointer
memcpy(m_pData ot
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8664 2013-07-09 13:04 【matrix头文件声明注释】.txt
文件 75980 2013-04-28 14:05 Matrix.cpp
文件 3231 2013-04-28 14:10 Matrix.h
----------- --------- ---------- ----- ----
87875 3
相关资源
- 基于VSCode和CMake实现C++开发
- c++开发http服务端+客户端
- c/c++开发网络验证和本地验证
- Visual C++开发大全 提高卷
- C++开发KTV点歌系统
- C++写的商店管理系统
- Visual C++开发基于SNMP的网络管理软件
- 车牌识别系统VC++开发
- VC++开发IE ActiveX控件
- QT5.9_c++开发指南——随书[源码]
- MongoDB C/C++开发使用案例Demo
- QT小项目-电子词典
- WIndow下使用QT C++开发生成带Logo的二维
- VC++开发实战1200例界面换肤模块
- VC++开发的斗地主的网络游戏源码
- 矩阵运算程序VC++矩阵运算程序
- c++开发的人工神经网络做人脸识别
- 完成矩阵基本运算的C++程序
- Visual C++开发基于SNMP网络管理软件书上
- c++开发ocx入门实践三--基于opencv的简易
- Visual.Assist.X助手及其注册码 VC++
- Visual+C++开发基于SNMP的网络管理软件(
- armadillo C++矩阵运算函数库
- ComplexMatrixMathLab(C++复数矩阵数学库,
- openssl C++开发包(含debug和release,3
- c++开发视频播放器(可以播放所有的
- 一个C++开发的服务驻留程序源代码
- Visual+C++开发基于SNMP网络管理软件配套
- MFC教师住房管理系统和矩阵运算以及
- Visual C++开发基于SNMP的网络管理软件
评论
共有 条评论