Questions tagged [symmetry]

is used in its general meaning, from symmetric matrices to Git. As a result you should probably use at least one more tag to describe your case better.

78 questions
44
votes
4 answers

Are merges in Git symmetric?

Lets say we have two branches (B and C) that have diverged from a common ancestor A. Will merging from B to C produce the same result as merging from C to B? A | / \ B C To clarify- I'm assuming that any manual merge conflict resolutions…
Eyal
  • 3,412
  • 1
  • 44
  • 60
43
votes
2 answers

Graphviz Dot, mix directed and undirected

For my application I need to represent simultaneously (on the same graph) two relations: one is simmetric, the other is not. Targets: Ideally the two relation should result in edges having different colors; For the symmetric relation I would like…
Dacav
  • 13,590
  • 11
  • 60
  • 87
22
votes
2 answers

Making a Read instance in Haskell

I have a data type data Time = Time {hour :: Int, minute :: Int } for which i have defined the instance of Show as being instance Show Time where show (Time hour minute) = (if hour > 10 …
Magnap
  • 275
  • 1
  • 2
  • 8
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
15
votes
3 answers

Computer algebra for Clojure

Short version: I am interested in some Clojure code which will allow me to specify the transformations of x (e.g. permutations, rotations) under which the value of a function f(x) is invariant, so that I can efficiently generate a sequence of x's…
13
votes
2 answers

Unicode characters having asymmetric upper/lower case. Why?

Why do the following three characters have not symmetric toLower, toUpper results /** * Written in the Scala programming language, typed into the Scala REPL. * Results commented accordingly. */ /* Unicode Character 'LATIN CAPITAL LETTER SHARP…
Tim Friske
  • 2,012
  • 1
  • 18
  • 28
13
votes
1 answer

Python commutative operator override

Hi I was wondering if there is a way to do a symmetric operator override in Python. For example, let's say I have a class: class A: def __init__(self, value): self.value = value def __add__(self, other): if isinstance(other,…
Bob Sacamano
  • 699
  • 15
  • 39
9
votes
2 answers

N-Queens Symmetry Breaking Google OR Tools

One of the samples for the Google or-tools is a solver for the n-queens problem. At the bottom it says that the implementation can be improved by adding symmetry breaking constraints to the constraint solver. Looking around the internet, I found…
Nick Larsen
  • 18,631
  • 6
  • 67
  • 96
7
votes
2 answers

3D symmetry search algorithm

This may be more appropriate for math overflow, but nevertheless: Given a 3D structure (for example, a molecule), what is a good approach/algorithm to find symmetry (rotational/reflection/inversion/etc.)? I came up with brute force naïve algorithm,…
Anycorn
  • 50,217
  • 42
  • 167
  • 261
6
votes
2 answers

Permutation group implementation in Java

In my experience in programming, I often face with different tasks related to permutation group: enumerate all possible products of given permutations or just count them, test whether one permutation can be represented as a combination of given…
Stanislav Poslavsky
  • 2,398
  • 2
  • 24
  • 36
6
votes
1 answer

Detection of symmetries in Python

I want to detect symmetries (rotation, translation, etc) of a simple figure or a shape in a image. That is, if I find one symmetry I want to replicate my original figure with it. Are there any function or module? I have thought in python-opencv, but…
kshipuden
  • 93
  • 1
  • 4
6
votes
1 answer

An "asymmetric" pairwise distance matrix

Suppose there are three sequences to be compared: a, b, and c. Traditionally, the resulting 3-by-3 pairwise distance matrix is symmetric, indicating that the distance from a to b is equal to the distance from b to a. I am wondering if TraMineR…
POTENZA
  • 1,377
  • 3
  • 17
  • 20
5
votes
1 answer

How to represent Symmetry relationships in database modeling

If there is a symmetry relationship in a table, how to represent it in a elegant way? For example, there is a table called Friend, in which should contain user ID of two users. If we use UID1 and UID2 in this table, when we want to find out if A_uid…
Ovilia
  • 7,066
  • 12
  • 47
  • 70
5
votes
1 answer

How to exploit permutational symmetry in this loop?

I have a scalar function f(a,b,c,d) that has the following permutational symmetry f(a,b,c,d) = f(c,d,a,b) = -f(b,a,d,c) = -f(d,c,b,a) I'm using it to fully populate a 4D array. This code (using python/NumPy) below works: A = np.zeros((N,N,N,N)) for…
jjgoings
  • 225
  • 2
  • 6
5
votes
1 answer

Is ptr = free(ptr), NULL safe?

I'm writing code like this: #include int main(void) { void *kilobyte; kilobyte = malloc(1024); kilobyte = NULL, free(kilobyte); return 0; } for symmetry, which is nice. But I've never seen anyone else using this idiom…
user2933244
1
2 3 4 5 6