• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

Recent Posts

Matrix Multiplication: 2020 Update

Matrix Multiplication: 2020 Update

In 2012 I wrote a series of articles about matrix multiplication. Now I'm preparing a course about speeding up Python. For this reason I need an example of code that is fairly simple to understand and can be optimized. So let's update the results of my old articles 🙂 The code … Read More »
Part III: Matrix multiplication on multiple cores in Python, Java and C++

Part III: Matrix multiplication on multiple cores in Python, Java and C++

This is Part III of my matrix multiplication series. Part I was about simple matrix multiplication algorithms and Part II was about the Strassen algorithm. Part III is about parallel matrix multiplication. We got some pretty interesting results for matrix multiplication so far. Now, I would like to get to … Read More »
Part IV: How to multiply matrix with its transpose in Python and C++

Part IV: How to multiply matrix with its transpose in Python and C++

This is Part IV of my matrix multiplication series. Part I was about simple implementations and libraries: Performance of Matrix multiplication in Python, Java and C++, Part II was about multiplication with the Strassen algorithm and Part III will be about parallel matrix multiplication (I didn't write it yet). You … Read More »
Maps in C++

Maps in C++

Maps are one of the most useful datastructures in C++ and there is no excuse for not knowing it. Here is a basic example that shows how you can use it: #include // cout #include #include using namespace std; int main() { map phonebook; // Put some stuff … Read More »
How do hash functions work?

How do hash functions work?

Everybody who has written a noticeable amount of Java code should know the method hashCode(). But most beginners have difficulties to understand the significance of this little method. The following article gives you one small example with some impressions how much hash functions influence execution time. Connect four Connect Four … Read More »
Google Code Jam Templates

Google Code Jam Templates

Here are some templates that are a good start for Google Code Jam. C++ #include #include #include using namespace std; int main(void) { /* number of test cases */ unsigned short int testcases; cin >> t; for(int i=1; i <= t; i++) { //loops for each case for (int … Read More »
What does volatile mean?

What does volatile mean?

You might have read the variable modifier volatile in C, C++ or in Java. But do you know what it means? C Programming Language The C Programming language by Kerninghan and Ritchie (second edition) contains this keyword only 13 times. Here are the most important ones: [...] declaring it volatile announces … Read More »
C Puzzle #3

C Puzzle #3

What is the output of the following programm? #include int main() { printf("%i\n", -13>>1); } . . . . . . . . . . . . . . . . . . . Short answer -7 Long answer Signed integers are two’s complement binary values that can be used to represent both positive and negative integer values. Source: Intels IA-32 Architectures Software Developer's Manuals … Read More »
Check File Systems maximum path depth

Check File Systems maximum path depth

Today, I've wondered how deep a path could be at maximum. I've guessed the file system may be limiting that, but perhaps also some tools that I use for basic operations like listing a folders contents would fail before. So I've created the following C-Snippet to test it: #include Read More »
Part II: The Strassen algorithm in Python, Java and C++

Part II: The Strassen algorithm in Python, Java and C++

This is Part II of my matrix multiplication series. Part I was about simple matrix multiplication algorithms and Part II was about the Strassen algorithm. Part III is about parallel matrix multiplication. The usual matrix multiplication of two $n \times n$ matrices has a time-complexity of $\mathcal{O}(n^3 … Read More »
  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor