Questions tagged [strassen]

Set of algorithms (co)created by Volker Strassen for speeding up number (Schönhage–Strassen algorithm) and matrix (Strassen Algorithm) multiplications.

Strassen Algorithm

  • it subdivides square matrices to 4 quadrants
  • and handle them in way similar to Karatsuba multiplication
  • it is only slightly faster then standard matrix multiplication (and only for big matrices)

Schönhage–Strassen algorithm

  • it uses FFT/NTT convolution (of digits) to compute number multiplication
  • it is fast only for very big numbers
  • it handle number as polynomial of digits and digit base

Homepage: http://www.math.uni-konstanz.de/~strassen

73 questions
1
vote
1 answer

Strassen matrix multiplication to store linear equations

One of the questions I've come across in my textbook is: In Computer Graphics transformations are applied on many vertices on the screen. Translation, Rotations and Scaling. Assume you’re operating on a vertex with 3 values (X, Y, 1). X, Y being the…
April Crude
  • 117
  • 7
1
vote
1 answer

Strassen's multiplication in C

Please have a look in the following code: #include #include int **divide(int **Matrix,int n,int position) { int i,j; int **Partition=malloc(sizeof(*Partition)*n); for(i=0;i
Tneiliser
  • 41
  • 10
1
vote
1 answer

Subproblem size w.r.t Strassen's Matrix Multiplication algorithm

I've recently watched a video lecture on Strassen's recursive algorithm for multiplying 2 n x n matrices. The lecture also brought up the Master Method for computing the time complexity of this algorithm. However, when discussing the coefficient b -…
1
vote
1 answer

How to multiply matrices of degree other than powers of 2, using Strassen's Algorithm?

I was doing an Algorithm's Course. While, covering divide and conquer, I came across Strassen's Algorithm. So, the issue is how do we multiply matrices with odd degrees, or even degrees which are not powers of 2? Also, how do we apply Strassen's…
gkpani97
  • 97
  • 2
  • 8
1
vote
1 answer

node 10.15.0: unable to create a large matrix

I'm going through an algorithm course and just learned about Strassen's algorithm for multiplying matrices. I have implemented this in node and it works with small matrices. I want to test on a very large matrix but node core dumps when I try to…
Mr Wannabe
  • 143
  • 10
1
vote
0 answers

How can I make Strassen algorithm(matrix multifly) more efficiently?

The result is Strassen() : 27 sec and muliply_mat() : 5 sec how can I make more shorter than multiply_mat()?? I Guess the problem is new_mat function in strassen function. what should i do to reduce the time using strassen function. def…
jiwonYun
  • 11
  • 2
1
vote
1 answer

Incorrect output matrix using Strassen's algorithm with numpy matrices

I am attempting to implement Strassen's matrix multiplication algorithm as described in CLRS using Python 3 and numpy matrices. The issue is that the output matrix C is returned as a zero matrix instead of the correct product. I am not sure why my…
user8390325
1
vote
1 answer

calling a cxxfunction itself recursion

I have a problem with my cxxfunction in R. And I would like to call this itself, unfortunately, the compiler gives me this error message: 'Matmult2' is not declared in this scope The Problem is also to call Matmult2 in a cxxfunction. My original…
RCPP
  • 13
  • 2
1
vote
1 answer

Trouble With Implementing Strassen's Algorithm for Matrix Multiplication

I've been trying to implement Strassen's algorithm for matrix multiplication for the past couple of hours and have had trouble getting the correct product. I think one of the my helper functions (helpSub,createProd, helpProduct) may be the issue or…
Will
  • 143
  • 2
  • 13
1
vote
1 answer

Memory management for Strassen's matrix multiplication

As a part of an assignment, I am trying to find out the crossover point for Strassen's matrix multiplication and naive multiplication algorithms. But for the same, I am unable to proceed when matrix becomes 256x256. Can someone please suggest me the…
Neha
  • 325
  • 4
  • 14
1
vote
1 answer

how to split matrix into 4 quadrants in python using numpy

I'm new to Python. I'm trying to implement Strassen's Algorithm. The size of the matrix will always be a power of 2 in my implementation. So, how do I divide the matrix into 4 equal sized quadrants? Thanks
so908
  • 25
  • 1
  • 6
1
vote
0 answers

Strassen algorithm - is it possible to do pxq matrix multiplication?

I am trying to find a pxq matrix multiplication implementation in c using the Strassen algorithm. I am not sure it is possible. In wikipedia the algorithm is written like this: M1 = (A + D) * (E + H) = AE + AH + DE + DH M2 = (A + B) * H = AH +…
1
vote
2 answers

Strassen Matrix Multiplication -- close, but still with bugs

I'm trying to implement Strassen Matrix multiplication in Python. I've got it working somewhat. Here's my code: a = [[1,1,1,1],[2,2,2,2],[3,3,3,3],[4,4,4,4]] b = [[5,5,5,5],[6,6,6,6],[7,7,7,7],[8,8,8,8]] def new_m(p, q): # create a matrix filled…
benwiz
  • 2,167
  • 3
  • 22
  • 33
1
vote
1 answer

Matrix Partition for Strassen Algorithm

Let's say I have a NxN matrix full of random integers in the range of one to ten. Now, I want to call PROC(A(1:n/2, 1:n/2)+A(n/2+1:n, n/2+1:n)... where n is the size of the matrix. In other words, I want to make a submatrix starting at the first row…
Linell
  • 750
  • 3
  • 9
  • 27
0
votes
1 answer

Strassen matrix multiplication in python

def matrix_addition(A, B): # Check if matrices have the same size if len(A) != len(B) or len(A[0]) != len(B[0]): raise ValueError("Matrices must have the same size") # Initialize result matrix with zeros result = [[0 for col…