Search in sources :

Example 6 with IASTMutable

use of org.matheclipse.core.interfaces.IASTMutable in project symja_android_library by axkr.

the class ASTAssociation method keySort.

@Override
public IAssociation keySort(Comparator<IExpr> comparator) {
    IASTMutable list = keys();
    if (comparator == null) {
        EvalAttributes.sort(list);
    } else {
        EvalAttributes.sort(list, comparator);
    }
    ASTAssociation assoc = new ASTAssociation();
    for (int i = 1; i < list.size(); i++) {
        IExpr key = list.get(i);
        int value = getInt(key);
        assoc.appendRule(getRule(value));
    }
    return assoc;
}
Also used : IASTMutable(org.matheclipse.core.interfaces.IASTMutable) IExpr(org.matheclipse.core.interfaces.IExpr)

Example 7 with IASTMutable

use of org.matheclipse.core.interfaces.IASTMutable in project symja_android_library by axkr.

the class ASTRealMatrix method setAtCopy.

@Override
public IASTMutable setAtCopy(int i, IExpr expr) {
    if (expr instanceof ASTRealVector) {
        IASTMutable ast = copy();
        ast.set(i, expr);
        return ast;
    }
    IASTAppendable ast = copyAppendable();
    ast.set(i, expr);
    return ast;
}
Also used : IASTAppendable(org.matheclipse.core.interfaces.IASTAppendable) IASTMutable(org.matheclipse.core.interfaces.IASTMutable)

Example 8 with IASTMutable

use of org.matheclipse.core.interfaces.IASTMutable in project symja_android_library by axkr.

the class B2 method setAtCopy.

@Override
public IASTMutable setAtCopy(int i, IExpr expr) {
    if (i == 0) {
        return new AST2(expr, arg1(), arg2());
    }
    IASTMutable ast = copy();
    ast.set(i, expr);
    return ast;
}
Also used : IASTMutable(org.matheclipse.core.interfaces.IASTMutable)

Example 9 with IASTMutable

use of org.matheclipse.core.interfaces.IASTMutable in project symja_android_library by axkr.

the class B1 method setAtCopy.

@Override
public IASTMutable setAtCopy(int i, IExpr expr) {
    if (i == 0) {
        return new AST1(expr, arg1());
    }
    IASTMutable ast = copy();
    ast.set(i, expr);
    return ast;
}
Also used : IASTMutable(org.matheclipse.core.interfaces.IASTMutable)

Example 10 with IASTMutable

use of org.matheclipse.core.interfaces.IASTMutable in project symja_android_library by axkr.

the class ASTRRBTree method setAtCopy.

@Override
public IASTMutable setAtCopy(int i, IExpr expr) {
    IASTMutable ast = copy();
    ast.set(i, expr);
    return ast;
}
Also used : IASTMutable(org.matheclipse.core.interfaces.IASTMutable)

Aggregations

IASTMutable (org.matheclipse.core.interfaces.IASTMutable)92 IExpr (org.matheclipse.core.interfaces.IExpr)60 IAST (org.matheclipse.core.interfaces.IAST)34 IASTAppendable (org.matheclipse.core.interfaces.IASTAppendable)26 ISymbol (org.matheclipse.core.interfaces.ISymbol)12 IInteger (org.matheclipse.core.interfaces.IInteger)5 Map (java.util.Map)4 IComplex (org.matheclipse.core.interfaces.IComplex)4 IRational (org.matheclipse.core.interfaces.IRational)4 ArrayList (java.util.ArrayList)3 TreeMap (java.util.TreeMap)3 EvalEngine (org.matheclipse.core.eval.EvalEngine)3 JASConversionException (org.matheclipse.core.eval.exception.JASConversionException)3 ValidateException (org.matheclipse.core.eval.exception.ValidateException)3 INumber (org.matheclipse.core.interfaces.INumber)3 IPatternObject (org.matheclipse.core.interfaces.IPatternObject)3 ISparseArray (org.matheclipse.core.interfaces.ISparseArray)3 ASTNode (org.matheclipse.parser.client.ast.ASTNode)3 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)2 AST2Expr (org.matheclipse.core.convert.AST2Expr)2