码迷,mamicode.com
首页 >  
搜索关键字:mat    ( 14954个结果
矩阵快速幂
矩阵快速幂可认为是快速幂算法的扩展。有一种借助于 typedef 的较为方便的写法。1 #define MAX_D 1002 #define mod 10000000073 4 typedef long long ll;5 typedef ll mat[MAX_D][MAX_D];6 typedef...
分类:其他好文   时间:2015-07-28 22:50:24    阅读次数:136
Python 层次聚类中发现的一处 Bug
闲话少说先上代码 # 读方式打开文件 myfile=h5py.File('arr.mat','r') arr = myfile['arr'][:] myfile.close() slt = 'ward' while clust_model = sklearn.cluster.AgglomerativeClustering(linkage=slt, affinity="euclidean", n...
分类:编程语言   时间:2015-07-28 18:33:11    阅读次数:418
hdu2807 矩阵乘法+floyd
网上有优化的方法 就是乘上一个一维的矩阵;现在还没有想通。想通了不上代码;我用的就是普通的矩阵,压着时间过;只是多了一个判断条件,不加这个条件就超时;#include#include#define INF 99999999#define maxn 85struct Mat{ int mat[m...
分类:其他好文   时间:2015-07-28 17:44:59    阅读次数:104
OpenCV
输入/输出 图片 从文件中读入图片:Mat img = imread(filename);如果读入的图片是jpg文件,默认为三通道的图像(RGB),如果你想要灰度图像,使用:Mat img = imread(filename, 0);注:图片文件的格式由文件内容(头几个字节)决定。 保存图片到文件:...
分类:其他好文   时间:2015-07-28 17:28:13    阅读次数:292
hdu 1181 变形课 (bfs)
#include#include#include#include#include#includeusing namespace std;char str[100];int mat[30][30];int vis[30][30];int ok;bool isok(int now,int next){ ...
分类:其他好文   时间:2015-07-28 06:34:35    阅读次数:94
numpy函数库中一些常用函数的记录
numpy函数库中一些常用函数的记录最近才开始接触python,python中为我们提供了大量的库,不太熟悉,因此在《机器学习实战》的学习中,对遇到的一些函数的用法进行记录。(1)mat( )numpy函数库中存在两种不同的数据类型(矩阵matrix和数组array),都可以用于处理行列表示的数字元素。虽然他们看起来很相似,但是在这两个数据类型上执行相同的数学运算可以得到不同的结果,其中numpy函...
分类:其他好文   时间:2015-07-27 21:00:14    阅读次数:128
求矩阵的模n^3logn
#include #include #include #include using namespace std;typedef __int64 lld;const int MOD = 998244353;const int N = 20;struct Mat { lld a[N][N]; ...
分类:其他好文   时间:2015-07-27 20:55:38    阅读次数:135
HDU 1010 Tempter of the Bone (dfs)
#include#include#include#include#include#includeusing namespace std;int n,m,t;int sx,sy;int ex,ey;int ok;char mat[10][10];int vis[10][10];int op[4][2]...
分类:其他好文   时间:2015-07-27 00:08:34    阅读次数:192
POJ 2251 Dungeon Master (bfs)
#include#include#include#include#includeusing namespace std;char mat[50][50][50];int vis[50][50][50];int op[6][3]={0,-1,0, 0,1,0, 1,0,0, -1,0,0 ,0,0,1...
分类:其他好文   时间:2015-07-27 00:01:55    阅读次数:315
POJ 1753 Flip Game (bfs)
#include#include#include#include#includeusing namespace std;int ch[20];int op[4][2]={1,0, -1,0, 0,1, 0,-1};int mat[200000];int vis[200000];void init_c...
分类:其他好文   时间:2015-07-26 23:59:33    阅读次数:394
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!