Questions tagged [matrix]

In mathematics, a matrix (plural matrices) is a rectangular array of numbers, symbols, or expressions, arranged in rows and columns. The individual items in a matrix are called its elements or entries.

553 questions
Filter by
Sorted by
Tagged with
1k views

Capture the notion of invertible functions

I find sometimes it is useful to capture the notion of invertible functions. The idea is that if two functions f :: a -> b and ...
3k views

A grid and a menu walked into a program

A program that creates a grid 10x10 and assigns a random number in each tile. It then asks you if you want to: create a new grid view the current one count how many of each number there are in the ...
8k views

SIMD matrix multiplication

I recently started toying with SIMD and came up with the following code for matrix multiplication. First I attempted to implement it using SIMD the same way I did in SISD, just using SIMD for things ...
5k views

2048 merge function

From: Principles of Computing Part 1 Course on Coursera I got -2 pts on my OWLTEST which uses Pylint for style guide. The error states: Too many branches (17/12) function "merge", line 7 ...
1k views

The grid looked at the menu and said “Something with class, please”

This is a follow up on my previous question: A grid and a menu walked into a program I integrated classes into the mix. The program now asks how big you want the grid to be. ...
2k views

Enter the Matrix

I've semi-often been frustrated at the lack of a proper Matrix data structure in VBA. A multi-dimensional array is obviously the right way to handle it, but there is so much missing... for example, ...
593 views

Remapping and interpolating 255x1024 array

I have a function that accepts a $255\times1024$ array and remaps it to another array in order to account for some hardware related distortion (lines that should be straight are curved by the lens). ...
2k views

Code to multiply matrices together

I've got a short algorithm used in my code to multiply two matrices and put them into a destination Matrix. I decided to use the temporary array t_elements, which ...
2k views

Matrix class in C#

I've been learning C# during my free time in the past months; before that, I was mostly writing Java, so the transition hasn't been too hard, but I've never had my code reviewed or read by someone ...
6k views

Finding a zero crossing in a matrix

I am trying create an algorithm for finding the zero crossing (check that the signs of all the entries around the entry of interest are not the same) in a two dimensional matrix, as part of ...
1k views

A library to do maths with matrices written from scratch

Background Some time ago I've encountered some very good articles about neural networks that represented an ANN as a set of matrices, so everything was done using matrix operations. These articles ...
7k views

Count the one islands in the matrix

What is an island? A group of connected 1s forms an island. For example, the below matrix contains 5 islands: ...
9k views

Set matrix zeros

I solved this problem in about 11 minutes (with all 50+ test cases passed). I think most of you already know me by now, and I truly appreciate your advice, but please be brutal and judge me as if I ...
4k views

Enter my Matrix

Here is my next Java assignment: create a Matrix class that can add and multiply two matrices together. I was given some code as a skeleton and then fleshed it out ...
1k views

4k views

Symmetric Square

I was given an assignment to ensure that a list was symmetric. I built it in a way that worked and it passed the tests. But I wanted to see if it could've been written more efficiently and still ...
2k views

Efficient extraction of patch features over an image

Input: data - a matrix of size n*m*3*3 (complex values) indices - a list of coordinates (x,y), where x < n and y < m fp - a feature parameter which is a tuple of ((fp11, fp12), (fp21, fp22)), ...
511 views

Transpose function [closed]

I wanted to write a transpose function for N*N mat without it getting literals or #define values and I want it to compile with ...
2k views

Read matrix from file, the C++11/14 way

I am trying to get acquainted with C++11/14, so please tell me if the code below could be written in a more "modern" way. Or, of course, if it could be improved in any way. The function ...
621 views

Short square matrix class in C++ using an array

I'm a novice at C++ in comparison with other languages, so as an exercise I wrote a square Matrix class that doesn't use STL. ...
15k views

Basic Matrix Class in C++

I've made a simple Matrix class to learn C++. It doesn't use Templates so it only works with int. I made it this way to really understand how to work with objects ...
2k views

Converting Data in Rows and Columns to Rows in VBA for Excel

I have a working VBA script for Excel that converts a matrix of data with multiple records in per row to multiple rows with one record per row. A StackOverflow user told me that the code could use ...
376 views

Parsing equations from stdin

The program should read equations from stdin, parse them and generate a matrix of the coefficient which represents the system. Example: ...
278 views

Computing a Discrete Cosine Transform matrix

I'm learning Haskell and I needed to work with discrete cosine transform matrices, so I made a program that generates text (usable in WolframAlpha) containing the generated matrix. The elements of ...