/** * Returns all matrix types. * * @return all matrix types */ public static Set<IndexType> getMatrixTypes() { return current().getMatrixTypes(); }
/** * Returns a delta function with specified arguments * * @param a tensor * @param b tensor * @return DiracDelta[a, b] */ public static TensorField createDiracDelta(Tensor a, Tensor b) { return CC.current().createDeltaFunction(a, b); }
/** * Returns index converter manager of current session. * * @return index converter manager of current session */ public static IndexConverterManager getIndexConverterManager() { return current().getIndexConverterManager(); }
/** * Generates a new symbol which never used before during current session. * * @return new symbol which never used before during current session */ public static SimpleTensor generateNewSymbol() { return current().generateNewSymbol(); }
/** * Returns random generator used by Redberry in current session. * * @return random generator used by Redberry in current session */ public static RandomGenerator getRandomGenerator() { return current().getRandomGenerator(); }
/** * Returns current default output format. * * @return current default output format */ public static OutputFormat getDefaultOutputFormat() { return current().getDefaultOutputFormat(); }
/** * Sets the default output format. * <p/> * <p>After this step, all expressions will be printed according to the specified output format.</p> * * @param defaultOutputFormat output format */ public static void setDefaultOutputFormat(OutputFormat defaultOutputFormat) { current().setDefaultOutputFormat(defaultOutputFormat); }
/** * Allows to parse expressions with repeated indices of the same variance (like T_aa or T_a*T^a which results in T^a_a * and T^a*T_a respactively) * * @param b allow or not to parse repeated indices with same variance */ public static void setParserAllowsSameVariance(boolean b) { current().setParserAllowsSameVariance(b); }
/** * Returns {@code true} if specified tensor is metric tensor * * @param t tensor * @return {@code true} if specified tensor is metric tensor */ public static boolean isMetric(Tensor t) { if (!(t instanceof SimpleTensor)) return false; return CC.current().isMetric((SimpleTensor) t); }
/** * Returns {@code true} if specified tensor is metric or Kronecker tensor * * @param t tensor * @return {@code true} if specified tensor is metric or Kronecker tensor */ public static boolean isKroneckerOrMetric(Tensor t) { if (!(t instanceof SimpleTensor)) return false; return CC.current().isKroneckerOrMetric((SimpleTensor) t); }
/** * Returns {@code true} if specified tensor is metric or Kronecker tensor * * @param t tensor * @return {@code true} if specified tensor is metric or Kronecker tensor */ public static boolean isKroneckerOrMetric(SimpleTensor t) { return CC.current().isKroneckerOrMetric(t); }
/** * Returns the name manager (namespace) of current session. * * @return the name manager (namespace) of current session. */ public static NameManager getNameManager() { return current().getNameManager(); }
/** * Resets all definitions. */ public static void reset() { current().reset(); }
/** * Return output port which generates new symbol via {@link #generateNewSymbol()} at each {@code take()} invocation. * * @return output port which generates new symbol via {@link #generateNewSymbol()} at each {@code take()} invocation. */ public static OutputPort<SimpleTensor> getParametersGenerator() { return current().getDefaultParametersGenerator(); }
/** * Returns whether repeated indices of the same variance are allowed to be parsed * * @return whether repeated indices of the same variance are allowed to be parsed */ public static boolean getParserAllowsSameVariance() { return current().getParserAllowsSameVariance(); } }
/** * Returns true if metric is defined for specified index type. * * @param type index type * @return true if metric is defined for specified index type */ public static boolean isMetric(byte type) { return current().isMetric(type); }
/** * Returns {@code NameDescriptor} corresponding to the specified {@code int} nameId. * * @param name integer name of tensor * @return corresponding {@code NameDescriptor} */ public static NameDescriptor getNameDescriptor(int name) { return current().getNameDescriptor(name); }
/** * Returns all metric types. * * @return all metric types */ public static Set<IndexType> getMetricTypes() { return current().getMetricTypes(); }
/** * This method resets all tensor names in the namespace. * <p/> * <p>Any tensor created before this method call becomes invalid, and * must not be used! This method is mainly used in unit tests, so * avoid invocations of this method in general computations.</p> */ public static void resetTensorNames() { current().resetTensorNames(); }
/** * Returns true if metric is defined for specified index type. * * @param type index type * @return true if metric is defined for specified index type */ public static boolean isMetric(IndexType type) { return current().isMetric(type.getType()); }