== Parameters:
 c1,c2,c3::
   c1 and c2 are the coeficiens of the homothetie. c3 is optional
10351
def homothétie c1, c2, c3=1.0
      if c1 == nil or c2 == nil
        Error.call "Coefficients are invalids"
      end

      s = Matrix.new [[c1.to_f, 0, 0], [0, c2.to_f, 0], [0, 0, c3.to_f]]
      @matrix_op = s
      cpy = self
      cpy.z = 1.0

      puts "homothétie de rapports #{c1.to_f}, #{c2.to_f}" if @verbose

      return (s * cpy.to_matrix).to_vector
    end
499146
def calculate_mrcas(self, c1 : ClassId, c2 : ClassId) -> Set[ClassId]:
        
        G = self.G
        # reflexive ancestors
        ancs1 = self._ancestors(c1) | {c1}
        ancs2 = self._ancestors(c2) | {c2}
        common_ancestors = ancs1 & ancs2
        redundant = set()
        for a in common_ancestors:
            redundant = redundant | nx.ancestors(G, a)
        return common_ancestors - redundant
495871
def p2s(self, p=None):
        """"""
        if not p: p = [0, 0]

        s = self.p2c(p)
        return self.c2s(s)
517046
def c2f(r, i, ctype_name):
    

    ftype = c2f_dict[ctype_name]
    return np.typeDict[ctype_name](ftype(r) + 1j * ftype(i))
263888
def _complement(d1,d2):
    '''
        
    '''
    u = _union(d1,d2)
    c = _diff(u,d1)
    return(c)
721539
private ORCLUSCluster union(Relation<V> relation, ORCLUSCluster c1, ORCLUSCluster c2, int dim) {
    ORCLUSCluster c = new ORCLUSCluster();
    c.objectIDs = DBIDUtil.newHashSet(c1.objectIDs);
    c.objectIDs.addDBIDs(c2.objectIDs);
    c.objectIDs = DBIDUtil.newArray(c.objectIDs);

    if(c.objectIDs.size() > 0) {
      c.centroid = Centroid.make(relation, c.objectIDs).getArrayRef();
      c.basis = findBasis(relation, c, dim);
    }
    else {
      c.centroid = timesEquals(plusEquals(c1.centroid, c2.centroid), .5);
      c.basis = identity(dim, c.centroid.length);
    }
    return c;
  }
297773
public static double distance(Coordinate c1, Coordinate c2, Coordinate c3) {
		LineSegment ls = new LineSegment(c1, c2);
		return ls.distance(c3);
	}
301421
def EQ(classical_reg1, classical_reg2, classical_reg3):
    
    classical_reg1, classical_reg2, classical_reg3 = prepare_ternary_operands(classical_reg1,
                                                                              classical_reg2,
                                                                              classical_reg3)

    return ClassicalEqual(classical_reg1, classical_reg2, classical_reg3)
1294996
def _matcher(self, other):
        
        if isinstance(other, MoleculeContainer):
            return GraphMatcher(other, self, lambda x, y: y == x, lambda x, y: y == x)
        elif isinstance(other, (QueryContainer, QueryCGRContainer)):
            return GraphMatcher(other, self, lambda x, y: x == y, lambda x, y: x == y)
        raise TypeError('only query-molecule, query-query or query-cgr_query possible')
952905
def symmetric_difference(other)
      if other.is_a?(RelativeComplement)
        # A ⊖ ~B = (A ∖ ¬B) | (¬B ∖ A)
        #        = (A ∩ B)  | (¬B ∩ ¬A)
        #        = (B ∖ ¬A) | (¬A ∖ B)
        #        = ~A ⊖ B
        intersection(other.complement).
          union(other.intersection(complement))
      else
        # A ⊖ B = (A ∖ B) | (B ∖ A)
        #       = (A ∪ B) - (A ∩ B)
        other = Cantor.build(other)

        if other.empty?
          self
        else
          union(other).difference(intersection(other))
        end
      end
    end
1059114
def compatible(self, a, b):
        """"""
        return len(set([a] + self.descendants(a))
                   .intersection([b] + self.descendants(b))) > 0
161567
def _theorem6p3():
    
    pruning_set3 = set()

    def _prune3(x, as_list, b):
        for a in as_list:
            key = (tuple(x), a, b)  # (s,a,b) with (s,a) explored
            if key in pruning_set3:
                return True
        return False

    def _explored3(x, a, as_list):
        for b in as_list:
            prunable = (tuple(x), a, b)  # (s,a,b) with (s,a) explored
            pruning_set3.add(prunable)

    return _prune3, _explored3
1328780
function compit(ca,cb,aa,ab) {
            return (ca*aa + cb*ab * (1-aa)) / (aa+ab*(1-aa));
        }
1158273
def small_phi_ces_distance(C1, C2):
    """"""
    return sum(c.phi for c in C1) - sum(c.phi for c in C2)
395046
def c2ln(c,l1,l2,n):
    ""
    c = c + n
    l1, l2 = U32(0), U32(0)

    f = 0
    if n == 8:
        l2 = l2 | (U32(c[7]) << 24)
        f = 1
    if f or (n == 7):
        l2 = l2 | (U32(c[6]) << 16)
        f = 1
    if f or (n == 6):
        l2 = l2 | (U32(c[5]) << 8)
        f = 1
    if f or (n == 5):
        l2 = l2 | U32(c[4])
        f = 1
    if f or (n == 4):
        l1 = l1 | (U32(c[3]) << 24)
        f = 1
    if f or (n == 3):
        l1 = l1 | (U32(c[2]) << 16)
        f = 1
    if f or (n == 2):
        l1 = l1 | (U32(c[1]) << 8)
        f = 1
    if f or (n == 1):
        l1 = l1 | U32(c[0])
    return (l1, l2)
351186
def pair(p,q):
    
    # Check types
    assertType(p, G1Element)
    assertType(q, G2Element)

    result = GtElement()
    librelic.pc_map_abi(byref(result), byref(p), byref(q))
    return result
731304
private float weight(int c1, int c2) {
		float w;
		float pc1 = wordProb.get(c1);
		float pc2 = wordProb.get(c2);
		if (c1==c2) {
			float pcc = getProb(c1,c1);
			w =  clacW(pcc,pc1,pc2);
		} else {
			float pcc1 = getProb(c1, c2);			
			float p1= clacW(pcc1,pc1,pc2);			

			float pcc2 = getProb(c2, c1);			
			float p2 = clacW(pcc2,pc2,pc1);			
			w =  p1 + p2;
		}
		setweight(c1, c2, w);
		return w;
	}