symmetry

An “asymmetric” pairwise distance matrix

我的梦境 提交于 2019-12-21 12:20:08
问题 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 provides some way to produce an asymmetric pairwise distance matrix. 回答1: No, TraMineR does not produce 'assymetric' dissimilaries precisely for the reasons stressed in Pat's comment. The main interest of computing pairwise dissimilarities between

Graphviz Dot, mix directed and undirected

我与影子孤独终老i 提交于 2019-12-18 11:41:06
问题 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 not to have double-edges; Is there a way of doing this with dot ? 回答1: digraph { A; B; C subgraph Rel1 { edge [dir=none, color=red] A -> B -> C -> A } subgraph Rel2 { edge [color=blue] B -> C C -> A } } 来源: https://stackoverflow.com/questions

String Symmetry Program

断了今生、忘了曾经 提交于 2019-12-12 01:09:22
问题 Hey I could use a little bit of help to figure out why my program isn't working. The question is to make a program using recursion that figures if it the text given is a palindrome or not after all the punctuation and white spaces are removed. While the program so far compiles, it returns every value as false. We are only allowed to change the isSymmetrical method. I could use whatever help possible trying to figure out how to make this work. Thank you. public class StringSymmetry { public

maya python iterating a big number of vertex

╄→гoц情女王★ 提交于 2019-12-11 11:20:19
问题 I am writing a script in python for maya to swap vertex position from one side to another. Since I want the flipping to be topology based I am using the topological symmetry selection tool to find the vertex correspondence. I managed to do that using filterExpand and xform. The problem is that it is quite slow on a large poly count mesh and I was wondering how this could be done using openMaya instead. import maya.cmds as cmds def flipMesh(): sel=cmds.ls(sl=1) axis={'x':0,'y':1,'z':2} reverse

Computer algebra for Clojure

删除回忆录丶 提交于 2019-12-04 10:17:01
问题 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 that satisfy r = f(x). Is there some development in computer algebra for Clojure? For (a trivial) example (defn #^{:domain #{3 4 7} :range #{0,1,2} :invariance-group :full} f [x] (- x x)) I could call (preimage f #{0}) and it would efficiently return

Programming java to determine a symmetrical word [closed]

孤街醉人 提交于 2019-12-04 07:15:45
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am new here, but I am having hard time figuring out how to write a code to determine an input of word and see if the first is matching with the end of the word. You may input abba and get answer it's evenly

An “asymmetric” pairwise distance matrix

删除回忆录丶 提交于 2019-12-04 06:00:53
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 provides some way to produce an asymmetric pairwise distance matrix. No, TraMineR does not produce 'assymetric' dissimilaries precisely for the reasons stressed in Pat's comment. The main interest of computing pairwise dissimilarities between sequences is that once we have such dissimilarities we can for instance measure the discrepancy among sequences,

How to create a symmetric matrix where each row/column is a subset of a known vector [duplicate]

☆樱花仙子☆ 提交于 2019-12-03 18:11:30
问题 This question already has an answer here : How do I generate the following matrix and vector from the given input data in MATLAB? (1 answer) Closed 2 years ago . I have a 7*1 vector a = (1:7).' . I want to form a matrix A of size 4*4 from vector a such that the elements of a form the anti-diagonals of matrix A as follows: A = [1 2 3 4; 2 3 4 5; 3 4 5 6; 4 5 6 7] I would like this to work for a general a , not just when the elements are consecutive integers. I appreciate any help. 回答1: You can

Computer algebra for Clojure

爱⌒轻易说出口 提交于 2019-12-03 05:17:10
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 that satisfy r = f(x). Is there some development in computer algebra for Clojure? For (a trivial) example (defn #^{:domain #{3 4 7} :range #{0,1,2} :invariance-group :full} f [x] (- x x)) I could call (preimage f #{0}) and it would efficiently return #{3 4 7}. Naturally, it would also be able to annotate the codomain correctly. Any suggestions? Longer

Python commutative operator override

梦想的初衷 提交于 2019-11-30 18:28:37
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, self.__class__): return self.value + other.value else: return self.value + other Then I can do: a = A(1) a + 1 But if I try: 1 + a I get an error. Is there a way to override the operator add so that 1 + a will work? Moses Koledoye Just implement an __radd__ method in your class. Once the int class can't handle the addition, the __radd__ if implemented, takes it up. class A