Category "matrix"

Hadamard matrix in Ruby is not unitary although it should be?

Even when trying to define Hadamard matrix in Ruby by using rational numbers (which helps us sometimes to keep good precision) the result is that Hadamard matri

C++: How to do a matrix multiplication with pointers? Error: argument of type int is incompatible with parameter of type int**

I need to multiply two matrices, I have a header file where the function product is, and I need to call it in main. I am not very familiar with pointers, so I d

Pointer to sliced Eigen matrix

I have a function which takes a pointer to an Eigen matrix. I need to slice this matrix to several pieces and pass a portion of the matrix to the function. I wa

matrix with nodes that refer to which openings/connections they have

I would like some help on a problem that has been stressing me for a while now It revolves around recurdive backtracking maze generation, but should reurn a mat

What is fundamentally wrong in the choice of data structure in this matrix addition code?

Section 2.2.4 here contains the following: 2.2.4 Totally Inappropriate Data Structures Some might find this example hard to believe. This really occurred in so

How to represent sparse matrix (including zero elements) in C using linked list?

I want a code that represents a sparse matrix including zero elements using linked list, I basically want the output to be like this: 1 0 0 0 0 6 1 0

How to solve Matrix Riccati ODE in python

I want to solve the following Matrix Riccati ODE. My Matrix Riccati ODE After searching on the Internet, I found that there is something called continuous-time

how to write an ARM assembly program in Keil to check whether an N N matrix is a magic square? [closed]

how to write an ARM assembly program in Keil to check whether an N   N matrix is a magic square? Defining the matrix Generalizing Rows

Avoiding double traversal in outputting a L-shaped matrix [closed]

I am trying to traverse a list of Lists in L Shape. For example: lShapedTraverse [[1,2,3],[4,5,6],[7,8,9]] will result in [[1,2,3,6,9],[4,5,8

Assertion `argc >= 2' failed. Abandon (core dumped)

I'm traying to calculat the multiplication of tow matrix using OPENCL with C: ` #include <CL/cl.h> # include <stdio.h> # include <math.h> # in

Convert image in list of coordinates in Julia

I have this short code img_lab = rand(Lab, 10, 10) where I just have created an image of random colored pixels. Probably this question is trivial but how do I c

Converting Graph weights to Matrix in python

I have data in the form of: A=B=11 A=C=6 A=D=5 B=C=19 B=D=17 C=D=6 But I'd like to convert this into this format: graph= [[ 0, 10, 15, 20 ], [ 10,

R: create diagonal from 1 to 10 in matrix -> returns only last value

I need to modify a matrix filled with random numbers so that the resulting matrix has a diagonal with the numbers 1 to 10 and everywhere else there are supposed

r behaves strangely copying eigenvectors to a matrix in a for i loop

I'm a bit confused. A matrix A has 8 eigenvalues, some of them are complex, some are real. I want to copy only the eigenvectors that correspond to the real eige

How to pass python 2d matrix to C function ctypes

I tried to pass my matrix from python to C++ based on ctypes to multiply by 2 but I could not get the result that I want because it says inf instead. C code (DL

An up-to-date method for plotting a transition probability matrix?

I'm trying to find an easy, up-to-date way to plot transition matrices. Could someone please recommend a method or package? I found advice on Stack, but the pos

Error finding the simplest row form of a matrix

This problem was discovered when I was solving this second order differential equation by matlab syms x(t) diff(x,t,2)+k*diff(x,t)+b*x==0 I transform i

Optimizing gpu allocation/transfer of matrix tiles

I am working with very large matrices (>1GB) but imagine that I have the following matrix: A = [1 1 2 2; 1 1 2 2; 3 3 4 4; 3 3 4 4] I need to

Spiral Iteration

I need an Algorithm that I will use to scan pixels out from the center. Problem is with different lengths and sizes, it sometimes can't get to the position (See

Printing a matrix in spiral order but getting an additional element

#include<bits/stdc++.h> using namespace std; // Printing a matrix in spiral Order int main() { int n, m; cin>>n>>m; int arr[n][