Optimizing Matrix Multiplication One time consuming task is multiplying large matrices. In this post we'll look at ways to improve the speed of this process. We'll be using a square matrix, but with simple modifications the code can be adapted to any type of matrix. The straight forward way to multiply a matrix is: [code]for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { for (int k = 0; k < N; k++) { C[i,j] += A[i,k] * B[k,j]; } } }[/code] Now it's not important to us in which …

Member Avatar
Member Avatar
+7 forum 11

I am trying to create a File Searching Utility that finds all Files with a given Name which searches all Folders (Sub Directories, and Sub Directories of Sub Directories) in a given Directory. I was thinking of a way to use For Loops, or For Each, but that would mean I would need a For Loop or a For Each, for each sub directory. Basically output a line for each file found. Example: Input File Name: Hello.txt Input Inital Directory: C:/Users/GeoDoX/Documents/ File: Hello.txt Path: C:\Users\GeoDoX\Documents\ C:\Users\GeoDoX\Documents\Hello.txt C:\Users\GeoDoX\Documents\Test\Hello.txt C:\Users\GeoDoX\Documents\Test\Hello\Hello.txt Obviously there is some recursion, and I can't think of where to …

Member Avatar
Member Avatar
+0 forum 6

Hi, I'm new to Python and have a task of reading a user input text file that is tab-delimited and contains 4 columns in each line: Authors, Year, Title and Journal. I currently am just able to open a file, and now I don't know how to begin parsing the data. The recommended way of sorting the data is to use the following three lists (which I set as): [CODE] authorsList = [] journalsList = [] papersList = [] [/CODE] In the papersList, each paper's entry is its title, year published, the index of each author(s) and the index of …

Member Avatar
Member Avatar
+0 forum 10

I need to create a 2D array that holds the number of family members by the highest numbe of titles of one of the family members, and they input on one line. However, I am having trouble when I call the class in my other code in the main method. It says java.nullpointerexception at setTitles, and I know it has something to do with my arrays, but I don't know how to store the user input in the 2d array for my for loops afterwards, because they are based on the size of my 2D array. public class Geneology { …

Member Avatar
Member Avatar
+0 forum 2

I'm writing a program where the settings of a spreadsheet-like field of textboxes are changed using two for loops, and I can't for the life of me figure out why it's not working.I have tried declaring the txt variable and name variable in different orders using different methods, but nothing seems to work. With this code, I get the error, "Object reference not set to an instance of an object." Can somebody help me? Thank you. ' For loop repeats for each row For i As Integer = 1 To rows Step +1 ' Creates unicode character code for row …

Member Avatar
Member Avatar
+0 forum 16

**This is intented for learning purposes, feel free to study the code** Create a drawing that looks like this (pyramid) The number should be incremented with the modulus.

Member Avatar
Member Avatar
-1 forum 7

So I am working on a simple assignment for my C class that reads a formatted file and prints information about the file based on the format. The file format looks like this: #Domain Alexa Rank Site Name #------------ ----- ------- --------- amazon.com 13 1177136 Amazon.com google.com 1 4533883 Google youtube.com 3 3637788 YouTube plus a lot more lines. I am almost done, but variable scope (I think) is causing me some problems with my program giving the correct output. Here is my code, minus a bunch of stuff that doesn't apply to my problem (pardon me if the readability …

Member Avatar
Member Avatar
+0 forum 2

I have a python code that reads several csv files and writes teh data to a single file but every time it loops back around to the next file it prints the headers again. Is there a way to stop this I can post my code if it is nessisary.

Member Avatar
Member Avatar
+0 forum 4

I have a C++ application that I want to make more flexible and user-friendly. It currently contains seven nested for-loops, and part of the new flexibility is that this number will become variable (between two and twenty, say). What is the easiest way to achieve this?

Member Avatar
Member Avatar
+0 forum 2

The End.