Examples of product()


Examples of com.numb3r3.common.math.Matrix.product()

        System.out.println("ONES: " + ones.dialog());
        System.out.println("SUB: " + ones.sub(InMemoryJBlasMatrix.eye(3)));
        System.out.println("EYE" + InMemoryJBlasMatrix.eye(5));

        Matrix m = InMemoryJBlasMatrix.rand(5, null);
        m = m.product(m.transpose());
        System.out.println(m + "\n");


        System.out.println(m.dialog());
        System.out.println(m.diag());
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Expr.product()

    private Expr parseType(XMLNode node) throws IOException, Err {
        Expr expr = null;
        if (!node.is("types")) throw new IOException("<types>...</type> expected");
        for(XMLNode n:node) if (n.is("type")) {
            Sig sig=parseSig(n.getAttribute("ID"), 0);
            if (expr==null) expr=sig; else expr=expr.product(sig);
        }
        if (expr==null) throw new IOException("<type ID=../> expected");
        return expr;
    }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Expr.product()

         } else {
            Expr mask = null;
            List<AlloyType> types = new ArrayList<AlloyType>(ps.size());
            for(int i=0; i<ps.size(); i++) {
               types.add(sig(ps.get(i)));
               if (mask==null) mask=ps.get(i); else mask=mask.product(ps.get(i));
            }
            AlloyRelation rel = makeRel(label, isPrivate, isMeta, types);
            Set<AlloyTuple> ts = new LinkedHashSet<AlloyTuple>();
            for(A4Tuple tp: (A4TupleSet)(sol.eval(expr.intersect(mask)))) {
               AlloyAtom[] atoms = new AlloyAtom[tp.arity()];
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Type.product()

                    Type t=kv2typepos(decl.variable()).a;
                    if (t==Type.EMPTY) return;
                    for(int i=(predecl==null ? -1 : predecl.size()-1); i>=0; i--) {
                        Type pp=kv2typepos(predecl.get(i).variable()).a;
                        if (pp==Type.EMPTY) return;
                        t=pp.product(t);
                    }
                    kr2type(skolem, t);
                } catch(Throwable ex) { } // Exception here is not fatal
            }
            @Override public void solvingCNF(int primaryVars, int vars, int clauses) {
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Type.product()

    public int arity() { return tuple.arity(); }

    /** Returns the type constructed by taking the product for each sig in this tuple. */
    public Type type() {
        Type ans = null;
        for(int i=0; i<tuple.arity(); i++) if (ans==null) ans=sig(0).type(); else ans=ans.product(sig(i).type());
        return ans;
    }

    /** Returns the i-th atom in this Tuple. */
    public String atom(int i) { return sol.atom2name(tuple.atom(i)); }
View Full Code Here

Examples of kodkod.ast.Expression.product()

                Type t = f.returnDecl.type();
                if (t.is_bool) return Formula.FALSE;
                if (t.is_int) return IntConstant.constant(0);
                int i = t.arity();
                Expression ans = Expression.NONE;
                while(i>1) { ans = ans.product(Expression.NONE); i--; }
                return ans;
            }
            maxRecursion--;
        }
        Env<ExprVar,Object> newenv = new Env<ExprVar,Object>();
View Full Code Here

Examples of kodkod.ast.Expression.product()

            case SOME_ARROW_ANY: case SOME_ARROW_SOME: case SOME_ARROW_ONE: case SOME_ARROW_LONE:
            case ONE_ARROW_ANY: case ONE_ARROW_SOME: case ONE_ARROW_ONE: case ONE_ARROW_LONE:
            case LONE_ARROW_ANY: case LONE_ARROW_SOME: case LONE_ARROW_ONE: case LONE_ARROW_LONE:
            case ISSEQ_ARROW_LONE:
            case ARROW:
                s=cset(a); return s.product(cset(b));
            case JOIN:
                a=a.deNOP(); s=cset(a); s2=cset(b);
                if (a instanceof Sig && ((Sig)a).isOne!=null && s2 instanceof BinaryExpression) {
                    BinaryExpression bin = (BinaryExpression)s2;
                    if (bin.op()==ExprOperator.PRODUCT && bin.left()==s) return bin.right();
View Full Code Here

Examples of kodkod.ast.Expression.product()

                else { s=(Expression)obj; f=s.eq(cset(b)).not(); }
                return k2pos(f,x);
            case DOMAIN:
                s=cset(a);
                s2=cset(b);
                for(int j=s2.arity(); j>1; j--) s=s.product(Expression.UNIV);
                return s.intersection(s2);
            case RANGE:
                s=cset(a);
                s2=cset(b);
                for(int j=s.arity(); j>1; j--) s2=Expression.UNIV.product(s2);
View Full Code Here

Examples of kodkod.ast.Expression.product()

        Expression atuple=null, ar=r;
        for(int i=a.arity(); i>0; i--) {
           Variable v=Variable.unary("");
           if (a.arity()==1) d=v.oneOf(a); else if (d==null) d=v.oneOf(Relation.UNIV); else d=v.oneOf(Relation.UNIV).and(d);
           ar=v.join(ar);
           if (atuple==null) atuple=v; else atuple=atuple.product(v);
        }
        ans1=isIn(ar, ab.right);
        switch(ab.op) {
           case ISSEQ_ARROW_LONE:
           case ANY_ARROW_LONE: case SOME_ARROW_LONE: case ONE_ARROW_LONE: case LONE_ARROW_LONE: ans1=ar.lone().and(ans1); break;
View Full Code Here

Examples of kodkod.ast.Variable.product()

        Expression btuple=null, rb=r;
        for(int i=b.arity(); i>0; i--) {
           Variable v=Variable.unary("");
           if (b.arity()==1) d2=v.oneOf(b); else if (d2==null) d2=v.oneOf(Relation.UNIV); else d2=v.oneOf(Relation.UNIV).and(d2);
           rb=rb.join(v);
           if (btuple==null) btuple=v; else btuple=v.product(btuple);
        }
        ans2=isIn(rb, ab.left);
        switch(ab.op) {
           case LONE_ARROW_ANY: case LONE_ARROW_SOME: case LONE_ARROW_ONE: case LONE_ARROW_LONE: ans2=rb.lone().and(ans2); break;
           case ONE_ARROW_ANY:  case ONE_ARROW_SOME:  case ONE_ARROW_ONE:  case ONE_ARROW_LONE:  ans2=rb.one().and(ans2)break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.