码迷,mamicode.com
首页 >  
搜索关键字:matrix factorization    ( 4370个结果
hdu 1757 A Simple Math Problem (矩阵快速幂)
和这一题构造的矩阵的方法相同。 需要注意的是,题目中a0~a9 与矩阵相乘的顺序。 #include #include #include #include #include #define N 10 using namespace std; int mod; typedef long long LL; struct matrix { LL a[10][10]; }...
分类:其他好文   时间:2014-06-16 12:06:07    阅读次数:231
Rotate Image
题目 You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 方法 矩阵坐标的转换,循环替换。 public voi...
分类:其他好文   时间:2014-06-16 11:28:03    阅读次数:199
[matlab]改变矩阵的大小并保存到txt文件
要完成的任务是,加载一个保存在txt文件中的矩阵, 并把它扩大10倍,并且要再次保存回去 %加载txt文件 >load(‘Matrix.txt’); %扩大10倍 repmat(Matrix,row column) % 这里的matrix 参数是要对其进行修改的matrix, 其中row是要新建的一...
分类:其他好文   时间:2014-06-15 22:02:20    阅读次数:756
poj 3233 Matrix Power Series(等比矩阵求和)
http://poj.org/problem?id=3233 ps转: 用二分方法求等比数列前n项和:即   原理:   (1)若n==0   (2)若n%2==0     (3)若n%2==1 代码如下: LL sum(LL p,LL n) { if(n==0) return 1; i...
分类:其他好文   时间:2014-06-15 20:01:44    阅读次数:210
【Leetcode】Search a 2D Matrix
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right.The first integer of each...
分类:其他好文   时间:2014-06-15 14:12:44    阅读次数:238
【Leetcode】Rotate Image
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 思路:第一种思路是一层一层的进行旋转,比较直观,但是花费的时间要久一些;第二种思路则比较取巧,首先沿着...
分类:其他好文   时间:2014-06-15 08:46:26    阅读次数:170
Leetcode:Spiral Matrix 螺旋矩阵
Spiral Matrix:Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:...
分类:其他好文   时间:2014-06-14 21:42:10    阅读次数:309
剑指offer (20) 打印螺旋矩阵
题目描述:输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字class Solution {public: vector spiralOrder(vector > &matrix) { vector result; int nRows = matrix.s...
分类:其他好文   时间:2014-06-14 21:27:53    阅读次数:156
android矩阵详解
android中矩阵的使用介绍,以及matrix中的主要函数的介绍...
分类:移动开发   时间:2014-06-14 14:16:33    阅读次数:255
矩阵快速幂
复杂度为o(n^3logk) /* 求 a^k % mod,其中a是n*n的矩阵 */ const int mod = 10000; const int maxn = 2; _LL k; int n; struct matrix { _LL mat[maxn][maxn]; } a,res; matrix mul(matrix x, matrix y) { matrix tmp...
分类:其他好文   时间:2014-06-14 07:46:19    阅读次数:206
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!