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
0
votes
0 answers

How to perform constant space matrix multiplication?

I need to multiply two matrix using constant space. Note that the result should be stored at one of the matrix after operation. Printing the result without storing is trivial. Normally any standard algorithm defines a new matrix of the same size…
user559150
  • 11
  • 1
0
votes
1 answer

Strassen's multiplication--> TypeError: 'int' object has no attribute '__getitem__'

I'm writing a program for Strassen's matrix multiplication and I'm getting the following error: Traceback (most recent call last): File "StrassensMult_v01.py", line 130, in cMatrix = matrixMul(aMatrix, bMatrix) File…
Bumble Bee
  • 133
  • 6
0
votes
2 answers

"Splitting" a matrix in constant time

I am trying to implement Strassen's algorithm for matrix multiplication in C++, and I want to find a way to split two matrices into four parts each in constant time. Here is the current way I am doing so: for(int i = 0; i < n; i++){ for(int j =…
user3483203
  • 50,081
  • 9
  • 65
  • 94
0
votes
1 answer

Algorithm to multiply 2 numbers with n bits using Strassen's algorithm

Design and analyze an algorithm to multiply 2 numbers A and B, each n bits longs, but partitioning them into 3 equal sized pieces each and using the Strassen's algorithm. What is the best running time you can get? I have two numbers that are n…
o.o
  • 3,563
  • 9
  • 42
  • 71
0
votes
1 answer

Segmentation Fault - Strassen's Matrix Multiplication

I'm a newbie and I have tried to implement Strassen's algorithm to multiply two NxN matrices. I'm currently working on even dimensions. I'm getting a segmentation fault for values of N greater than 4. After debugging I figured that the segmentation…
Ranganatha Rao
  • 375
  • 1
  • 2
  • 9
0
votes
1 answer

Difficulty in implementing Strassen's algorithm in Python

I don't understand how to call my code recursively. Here is my code so far: import numpy B = [[5,5,5,5,5,5,5,5],[6,6,6,6,6,6,6,6],[7,7,7,7,7,7,7,7],[8,8,8,8,8,8,8,8], [9,9,9,9,9,9,9,9], [10,10,10,10,10,10,10,10],[11,11,11,11,11,11,11,11], …
so908
  • 25
  • 1
  • 6
0
votes
0 answers

Strassen Algorithm Parallel implementation in java

I am trying to implement Strassen matrix multiplication algorithm in both sequential and parallel. I want the following code to run parallel but I have no experience with parallel programming. int[][] M1 = multiply(add(A11, A22), add(B11,…
0
votes
2 answers

matrix blocking gives a segmentation fault

I am trying to implement the Strassen algorithm in C++. I want to partition the square matrix 'hA' into 4 equal blocks. // Initialize matrices on the host float hA[N][N],ha11[N / 2][N / 2], ha12[N / 2][N / 2], ha21[N / 2][N / 2], ha22[N /…
Maddy
  • 2,114
  • 7
  • 30
  • 50
0
votes
4 answers

strassen matrix multiplication

Well, it's a question from 《introduction to algorithms》 whose number is 4.2-6. It's described like this: How quickly can you multiply a kn*n matrix by an n*kn matrix, using Strassen's algorithm as a subroutine? I'm thinking of expending both two…
tuan long
  • 605
  • 1
  • 9
  • 18
-1
votes
1 answer

Understanding the recursive algorithm for strassen's method

So, I am trying to figure out strassen's method for matrix multiplication, I am using C++, but it could be any language. Right now, it is looking like: typedef vector ROW; typedef vector MATRIX; void getQuad(const MATRIX& IN,…
basil
  • 690
  • 2
  • 11
  • 30
-3
votes
1 answer

Why doesn't my strassen algorithm work for 3x3 matrices?

I have implemented the following code for the strassen algorithm http://www.sanfoundry.com/java-program-strassen-algorithm/. It works for most matrices including 2x2 and 4x4 matrices but fails for 3x3 matrices. Any ideas why and how can I fix it?
Shaheem Khan
  • 113
  • 2
  • 6
-4
votes
2 answers

why vector use less memory than pointers in this code?

I wrote paralell program based on a Strassen multiplication algorithm using pointers. this program return the result of multiplication of two matrices that are the same size. when the size is 256 , program fill about 1 GB of ram, and when it is 512…
Nastaran Hakimi
  • 695
  • 1
  • 16
  • 36
-5
votes
1 answer

Algorithm to beat Strassen's Algorithm

Professor Caesar wishes to develop a matrix-multiplication algorithm that is asymptotically faster than Strassen’s algorithm. His algorithm will use the divide and-conquer method, dividing each matrix into pieces of size n/4 x n/4, and the divide…
1 2 3 4
5