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
39
votes
7 answers

Creating a symmetric matrix in R

I have a matrix in R that is supposed to be symmetric, however, due to machine precision the matrix is never symmetric (the values differ by around 10^-16). Since I know the matrix is symmetric I have been doing this so far to get around the…
user2005253
37
votes
3 answers

Is JavaScript's double equals (==) always symmetric?

There are many cases in which JavaScript's type-coercing equality operator is not transitive. For example, see "JavaScript equality transitivity is weird." However, are there any cases in which == isn't symmetric? That is, where a == b is true and b…
Trevor Burnham
  • 76,828
  • 33
  • 160
  • 196
16
votes
3 answers

Eliminating symmetry from graphs

I have an algorithmic problem in which I have derived a transfer matrix between a lot of states. The next step is to exponentiate it, but it is very large, so I need to do some reductions on it. Specifically it contains a lot of symmetry. Below are…
Thomas Ahle
  • 30,774
  • 21
  • 92
  • 114
11
votes
1 answer

How to force tensorflow tensors to be symmetric?

I have a set of MxM symmetric matrix Variables in a graph whose values I'd like to optimize. Is there a way to enforce the symmetric condition? I've thought about adding a term to the loss function to enforce it, but this seems awkward and…
Mark Borgerding
  • 8,117
  • 4
  • 30
  • 51
11
votes
4 answers

FFT of a real symmetric vector is not real and symmetric

I am having a hard time understanding what should be a simple concept. I have constructed a vector in MATLAB that is real and symmetric. When I take the FFT in MATLAB, the result has a significant imaginary component, even though the symmetry rules…
craigim
  • 3,884
  • 1
  • 22
  • 42
9
votes
4 answers

How to generate symmetric random matrix?

I want to generate a random matrix which should be symmetric. I have tried this: matrix(sample(0:1, 25, TRUE), 5, 5) but it is not necessarily symmetric. How can I do that?
Majid
  • 13,853
  • 15
  • 77
  • 113
7
votes
2 answers

How to generate a random real symmetric square matrix with uniformly distributed entries

I would like to generate a random real symmetric square matrix with entries uniformly distributed between 0 and 1. My attempt is: a = rand(5); b = a + a.' My worry is that whilst matrix a is uniformly distributed according to the documentation…
Aina
  • 653
  • 2
  • 9
  • 22
7
votes
3 answers

Efficiently construct a square matrix with unique numbers in each row

A matrix of size nxn needs to be constructed with the desired properties. n is even. (given as input to the algorithm) Matrix should contain integers from 0 to n-1 Main diagonal should contain only zeroes and matrix should be symmetric. All…
A. Sam
  • 893
  • 9
  • 23
6
votes
4 answers

C++ Symmetric Binary Operators with Different Types

I am learning C++ and I was wondering if I could gain some insight into the preferred way of creating binary operators that work on instances of two different types. Here is an example that I've made to illustrate my concerns: class A; class…
Scott
6
votes
3 answers

Check if a polygon is symmetric

Given a polygon (not necessary convex) in the Cartesian coordinate, i wonder if there are any way to check the symmetricalness of that polygon? I can think of an O(N) solution: using rotating calipers to check if each pair of opposite edge is…
Chan Le
  • 2,184
  • 3
  • 23
  • 33
6
votes
1 answer

Huge symmetric matrix - how to store and use it cleverly - Python

I have a symmetric matrix. Now,the problem is that I need to fill such a matrix of dimensions (32**3) x (32**3). The reason why I need to fill the matrix is because in my program I am then using it for various calculations: I am inverting it, I am…
johnhenry
  • 1,293
  • 5
  • 21
  • 43
5
votes
2 answers

Reference for lowest order complexity of sparse symmetric matrix premultiplying full vector

In a paper I'm writing I make use of an n x n matrix multiplying a dense vector of dimension n. In its natural form, this matrix has O(n^2) space complexity and the multiplication takes time O(n^2). However, it is known that the matrix is symmetric,…
KomodoDave
  • 7,239
  • 10
  • 60
  • 92
5
votes
6 answers

null and the symmetry of equals

Equality is supposed to be symmetric, right? Object someObject = new Object(); Object NULL = null; NULL.equals(someObject) => NullPointerException someObject.equals(NULL) => false What is the rationale for not having the second form throw a…
fredoverflow
  • 256,549
  • 94
  • 388
  • 662
5
votes
1 answer

U-boot to load two images on separate cores

I have NXP/Free-scale Imx6 sabre lite development board. My task is to flash two OS kernels (Linux and RTOS)in such a way that linux runs on core0 and RTOS on core1. I have 1GB DDR3 in which i have to allocate first 128MB for RTOS and rest for LINUX…
5
votes
2 answers

Prolog repeating solutions on symmetric relations

Consider this small program: married(bill, hillary). spouse(X, Y) :- married(X, Y); married(Y, X). likes(X, Y) :- spouse(X, Y). Now I want to evaluate a goal ?- likes(X, Y). X = bill Y = hillary ?; X = hillary Y = bill yes Is there a way to…
tcigler
  • 126
  • 8
1
2 3
11 12