Questions tagged [symmetric]

is used in its general meaning, so you are encouraged to use one or more tags in addition to this tag, to describe your case better.

An example of Symmetric would be a Symmetric Key, which is used in both the sides of an algorithm in cryptography.

170 questions
2
votes
0 answers

Numpy - Matrix multiplication faster with many zero-entries?

Problem: In numpy, I have a matrix M1 that I am multiplying with another matrix M2. I know that I can spare half of the values in M1 because the resulting matrix will be symmetric and I only need the top k values. So I am thinking to use numpy.tril…
2
votes
1 answer

Is there any possibility to invert a symmetric banded (7 diagonals) matrix in linear time?

I need to invert a p x p symmetric banded hessian matrix H, which has 7 diagonals. p may be very high (=1000 or 10000). H^{-1} can be considered as banded, and thus, I do not need to compute the complete inverse matrix, but rather its approximation.…
0spirit0
  • 83
  • 4
2
votes
1 answer

"Symmetric" GROUP BY on multiple columns

I have a table like that: _id sender_id receiver_id text 1 1 2 xxx 2 2 1 yyy 3 1 2 xyz 4 3 1 abc I need to do a GROUP BY on both the sender_id and receiver_id columns,…
Alessandro
  • 3,666
  • 2
  • 28
  • 41
2
votes
1 answer

Symmetric matrix is not symmetric

I have recently written code for finite element method. Since my algorithm is generating a symmetric matrix, after gathering data for each element the resulting matrix should be symmetric. However, after I run loop over element, the resulting global…
Dohyun
  • 642
  • 4
  • 15
2
votes
3 answers

Django symmetrical relation

I was trying to solve a simple problem with a site where a Person model has a married_to field as Foreign Key. To maintain this when a user (PersonA) changes who he/she is married to the following should happen: The previous Person that PersonA was…
Daniel Wedlund
  • 804
  • 7
  • 18
2
votes
1 answer

Prolog - true if binary relation is symmetric

I have binary relations and I want to get result true if all binary relations are symmetric, otherwise false. So far I have this: married(mary, tom). married(sam, linda). married(linda, sam). spouse(X, Y) :- married(X, Y), married(Y, X). Where the…
Jaroslav Klimčík
  • 4,548
  • 12
  • 39
  • 58
2
votes
2 answers

R / Index lower triangle vector by pairwise indices

I am looking for a way to index a lower triangle vector of a symmetric matrix by pairwise indices in the language R. Here is some explanatory code: Background M is an n times n pairwise matrix, here with random data (just to show): n <-…
setempler
  • 1,681
  • 12
  • 20
2
votes
1 answer

R - Combinations of a list WITH duplicates?

How can I get all the combinations of a list with duplicates. By duplicates I mean an element with itself. I am building a symmetric matrix. names.list<-c("A","B","C") as.data.frame(t(combn(names.list,2))) Result is: V1 V2 1 A B 2 A C 3…
Travis Liew
  • 787
  • 1
  • 11
  • 34
2
votes
2 answers

R get all combinations for columns and perform a function on them returning a Symmetric matrix?

I have a matrix mat that looks like: A B C D E F 1 0.74 1.19 0.01 1.21 16000 0.02 2 0.76 1.17 0.01 1.21 15500 0.02 3 0.79 1.16 0.01 1.17 15625 0.02 4 0.75 1.17 0.01 1.17 15600 0.02 5 0.80 1.19 …
Travis Liew
  • 787
  • 1
  • 11
  • 34
2
votes
1 answer

For a 3x3 only symmetric and positive definite linear system, is Cholesky still faster than Householder?

I am trying to solve a linear system Ax=b where A is 3x3 symmetric positive definite. Though it is low in scale, I will have to repeat it for different As millions of times. So efficiency is still important. There are many solvers for linear systems…
LCFactorization
  • 1,652
  • 1
  • 25
  • 35
1
vote
2 answers

Compute symmetric matrix of a large file size using awk

I have an OD matrix (origin-destination matrix) written in list form, like this inputfile.csv: "origin_id","destination_id","trips" "0","0","20" "0","1","12" "0","2","8" "1","0","23" "1","1","50" "1","2","6" "2","1","9" "2","2","33" Which reads…
ElTitoFranki
  • 375
  • 1
  • 7
1
vote
2 answers

Convert a vector to a symmetric hollow matrix in Matlab

I would like to convert a vector to a symmetric hollow matrix but I am not really familiar with Matlab. For example: r2 = randi(10,276,1); and convert it into a symmetric hollow matrix, so a symmetric matrix about a diagonal of zeros (see image…
labgeek
  • 45
  • 7
1
vote
1 answer

I there a possibility to limit the values needed, in list comprehension for my function "isSymmetric", which determines if relations are symmetric?

I have a problem in the code for my function isSymmetric, which tests if a relation is symmetric. In the following, I am going to describe my problem further. It is important to mention that I am only allowed to use list comprehension and the any-or…
user20480905
1
vote
2 answers

Symmetric django model

I want to create a model, which is symmetric on two fields. Let's call the model Balance: class Balance (models.Model): payer = models.ForeignKey(auth.User, ...) payee = models.ForeignKey(auth.User, ...) amount =…
koPytok
  • 3,453
  • 1
  • 14
  • 29
1
vote
1 answer

Calculating center of symmetry between zones in a image in Matlab

I have images such as below (I am pasting only a sketch here) where I want to calculate the center of symmetry and the displacement between the 2 marked zones in the image(Marked in Red and blue). Could anyone suggest a simple algorithm for this?…
iyer
  • 11
  • 3