资源简介
实现了矩阵中的各种操作, 包括矩阵相加,相减,矩阵乘法,矩阵转秩,余子式,求行列式的值,求矩阵特征值,LU 分解,QR 分解,求现行方程组的解等等。
是任何做科学计算工作者必备的类库。
此类库也是C++初学者极好的参考资料。类库的实现运用了运算符重载,友元,异常处理,文件输入输出,函数重载,指针,动态分配内存等一系列C++技术。
此类库是我在美国研究生阶段的一个Term Project.品质保证。

代码片段和文件信息
#include “general.h“
//general.cpp
//Dr. Mengjiao Yu
//Date: Dec 2 2004
//
//general purposed function
//Please take a look at the input.dat file
//1. The purpose here is to provide a funcition that can bypass the white spaces and comments...
// That way it makes the input file more readable.
//2. Standard istream operator >> can NOT take care of strings with whit spaces
// ReadAString(istream& ) is then provided to read a string in a ““ pair.
//
//BypassComment is a function for processing input file. It can be used to
//skip the comments (start with a ‘#‘) and white spaces.
//
void BypassComment(istream& ins)
{
ins>>ws;//skip white space....
if (ins.eof()) return;//end of file?
//then skip comments...
while( (ins.peek()==‘#‘ || ins.peek()==‘\n‘) && (!ins.eof()) )
{
string tmp=““; //used only for display purpose..
char c;
do
{
ins.get(c);//
tmp+=c;//for display purpose only
}while (c!=‘\n‘ && !ins.eof());//repeatedly
cout<<“Skipped: “< if (ins.eof()) return;//end of file?
ins>>ws;//skip white spaces....
}
};
//Since the standard istream cannot take care strings with whitespace we need something to do this
string ReadAString(istream& ins)
{
string tmp=““;
ins>>ws;//skip white space.....
if (ins.peek()!=‘“‘) //not a string within a ““ pair
{
ins>>tmp;
}
else
{
char c;
//The implementation is not quite efficient. You may use getline() with delim set as ‘“‘...
//But not a big deal here.
ins>>c;//skip “
do{
ins>>noskipws>>c;//read a char do NOT skip any white spaces!!!
if(c!=‘“‘) tmp+=c;//add it into the string if it is not the terminator “
}while (c!=‘“‘ && !ins.eof());//
};
try
{
ins>>ws;//skip white spaces
}catch(...)
{
//if eof just return.
}
//cout<<“Read the following string: “< return tmp;
}
//launch an external program
//BOOL LaunchApplication(LPCTSTR pCmdLine PROCESS_INFORMATION *pProcessInfo)
//{
// STARTUPINFO stStartUpInfo;
// memset(&stStartUpInfo 0 sizeof(STARTUPINFO));
// stStartUpInfo.cb = sizeof(STARTUPINFO);
// stStartUpInfo.dwFlags = STARTF_USESHOWWINDOW;
// stStartUpInfo.wShowWindow = SW_SHOWDEFAULT;
// stStartUpInfo.wShowWindow = SW_SHOW;//SW_HIDE;
// //stStartUpInfo.wShowWindow = SW_SHOW;
// /*
// return CreateProcess(NULL (LPTSTR)pCmdLine NULL NULL FALSE
// //IDLE_PRIORITY_CLASS
// NORMAL_PRIORITY_CLASS
// NULL
// NULL &stStartUpInfo pProcessInfo);
// */
// return CreateProcess(NULL (LPSTR)pCmdLine NULL NULL FALSE
// //IDLE_PRIORITY_CLASS
// NORMAL_PRIORITY_CLASS
// //JobPriority //priority...
// NULL
// NULL &stStartUpInfo pProcessInfo);
//}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 843 2011-02-28 13:20 矩阵操作\.svn\all-wcprops
文件 1522 2011-02-28 13:20 矩阵操作\.svn\entries
文件 2 2011-02-19 11:27 矩阵操作\.svn\format
文件 53 2011-02-19 11:27 矩阵操作\.svn\prop-ba
文件 34 2011-02-27 22:48 矩阵操作\.svn\text-ba
文件 33 2011-02-21 17:38 矩阵操作\.svn\text-ba
文件 2765 2011-02-19 11:27 矩阵操作\.svn\text-ba
文件 1016 2011-02-19 11:27 矩阵操作\.svn\text-ba
文件 39424 2011-02-19 11:27 矩阵操作\.svn\text-ba
文件 4535 2011-02-19 15:52 矩阵操作\.svn\text-ba
文件 22681 2011-02-28 13:20 矩阵操作\.svn\text-ba
文件 2850 2011-02-27 17:27 矩阵操作\.svn\text-ba
文件 2565 2011-02-28 12:34 矩阵操作\.svn\text-ba
文件 23 2011-02-27 17:36 矩阵操作\3.data
文件 33 2011-02-27 17:37 矩阵操作\4.data
文件 34 2011-02-27 18:16 矩阵操作\a.data
文件 130 2011-02-27 00:00 矩阵操作\aaa.data
文件 130 2011-02-26 23:56 矩阵操作\aRes.data
文件 33 2011-02-20 12:33 矩阵操作\b.data
文件 2864 2011-02-19 11:27 矩阵操作\general.cpp
文件 33 2011-02-19 15:28 矩阵操作\general.d
文件 1059 2011-02-19 11:27 矩阵操作\general.h
文件 5448 2011-02-19 15:28 矩阵操作\general.o
文件 39777 2011-02-28 13:20 矩阵操作\hw3
文件 24 2011-02-27 00:07 矩阵操作\L.output
文件 22 2011-02-27 14:02 矩阵操作\L.result
文件 22 2011-02-27 14:03 矩阵操作\LL.result
文件 16 2011-02-27 13:43 矩阵操作\LU.data
文件 4535 2011-02-19 15:48 矩阵操作\Makefile
文件 23568 2011-02-28 13:20 矩阵操作\Matrix.cpp
............此处省略22个文件信息
相关资源
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
评论
共有 条评论