Category "matrix"

How to exclude coordinates which overflow matrix

The task is to write a function that returns all its neighbors for an element. Diagonal elements are not considered neighbors. In general, the problem is solved

Multiples transformations matrix on SVG, get cursor point

This question is probably more related to math than svg itself. Inside a main svg, got multiples transformed svg, (from different events), by a viewBox attrib

Imposing constraints on all (numbered) diagonals in CVXPY

I am looking to implement a constraint on an optimization on all diagonals of a matrix using CVXPY. The diag function in CVXPY only returns the main diagonal.

How to find the weight of the heaviest path of an undirected, unweighted graph (M(d) of the graph), using adjacency matrix

In the image A-L is the longest path, but L-M is the heaviest The heaviest path of the graph is the path with the most edges connected to it, for this current c

Double lexicographic sorting of binary (0-1) matrices

I want to sort a binary matrix so that its columns and rows are both in lexicographical order by switching rows and columns. In other words, I need a double-lex

Intersect float rows in two numpy matrices with precision

I'm looking for rows in B which are close to any of the rows in A example: eps = 0.1 A = [[1.22, 1.33], [1.45, 1.66]] B = [[1.25, 1.34], [1.77, 1.66], [1.44, 1.

How do I fill Matrix4 with translation, skew and scale values in flutter?

Suppose, I have these values for a container of height 200 and width 300: scaleX = 0.9198 scaleY = 0.9198 skewX = -0.3923 skewY = 0.3923 translateX = 150 transl

Pythonic way to get both diagonals passing through a matrix entry (i,j)

What is the Pythonic way to get a list of diagonal elements in a matrix passing through entry (i,j)? For e.g., given a matrix like: [1 2 3 4 5] [6 7 8

Run time error assigning cv::Mat element value using cv::Mat::at

In the following code I would like to assign a values to elements of a Mat variable in a loop. I get the runtime error below. pair<Mat, Mat> meshgrid(vect

Maya, turn off Segment Scale Compensate and keep pose unchanged in python?

I have already make many animations using Segment Scale Compensate, I need to import these animations to Unity, unfortunately, while SSC is enabled, animations

create cosine similarity matrix numpy

Suppose I have a numpy matrix like the following: array([array([ 0.0072427 , 0.00669255, 0.00785213, 0.00845336, 0.01042869]), array([ 0.00710799, 0.00

Finding a specific element in a matrix with set parameters

I created a code for financial options and there is one last thing missing to finish it. I want my code to find the implied volatility for a specific option. My

Using a matrix plot (matplot) as map and positions as locations

I'm interested in using a matrix plot as a field map and certain locations in matrix as specific plants (locations within field). I'm using this data: Field<

How to implement outer product of two vectors in Scheme?

I want to define a function in Scheme that will compute the outer product of two vectors. for example: (outerProduct '(1 2 3) '(4 5)) the output is supposed to

How can I apply fisher.test in R to a large matrix, and extract p-values to a new matrix?

I have a large matrix (12 rows, 53 columns) with counts of how many times genes in my clusters "A", "B", "C", etc. overlap with clusters created by someone else

Python Numpy - Treat really small numbers as zero

I want to calculate the Determinant of a Singular Matrix (which has a 0 determinant) with Numpy and when I print the determinant it shows a really small number

Why is numpy.linalg.pinv() preferred over numpy.linalg.inv() for creating inverse of a matrix in linear regression

If we want to search for the optimal parameters theta for a linear regression model by using the normal equation with: theta = inv(X^T * X) * X^T * y one step

How to create an origin-destination matrix from two vectors (in R or Stata)

I have a dataset of commuting by individuals, like this: id Origin Destination 1 1 3 2 1 4 3 2

jblas 2-d matrix multiplication

I want to compute 2d matrix-matrix multiplication using the Jblas library. But I failed every time to compute. Please help me to do this by giving an example w

Counting number of co-occurrences of words for a specified vocabulary and within a specified radius?

I have a vocabulary V = ["anarchism", "originated", "term", "abuse"], and list of words test = ['anarchism', 'originated', 'as', 'a', 'term', 'of', 'abuse', 'fi