Package space.kscience.kmath.ast.rendering

Types

Binary
Link copied to clipboard
common
abstract class Binary(operations: Collection<String>?) : FeaturedMathRenderer.RenderFeature
Abstract printing of unary operations that discards MST if their operation is not in operations or its type is not MST.Binary.
BinaryMinus
Link copied to clipboard
common
class BinaryMinus(operations: Collection<String>?) : Binary
Handles binary nodes by producing BinaryMinusSyntax.
BinaryMinusSyntax
Link copied to clipboard
common
data class BinaryMinusSyntax(operation: String, left: OperandSyntax, right: OperandSyntax) : BinarySyntax
Represents binary, infix subtraction (42 &minus; 42).
BinaryOperator
Link copied to clipboard
common
class BinaryOperator(operations: Collection<String>?) : Binary
Handles binary nodes by producing BinaryOperatorSyntax.
BinaryOperatorSyntax
Link copied to clipboard
common
data class BinaryOperatorSyntax(operation: String, prefix: MathSyntax, left: MathSyntax, right: MathSyntax) : BinarySyntax
Represents binary, prefix operator syntax (like f(a, b)).
BinaryPlus
Link copied to clipboard
common
class BinaryPlus(operations: Collection<String>?) : Binary
Handles binary nodes by producing BinaryPlusSyntax.
BinaryPlusSyntax
Link copied to clipboard
common
data class BinaryPlusSyntax(operation: String, left: OperandSyntax, right: OperandSyntax) : BinarySyntax
Represents binary, infix addition (42 + 42).
BinarySyntax
Link copied to clipboard
common
sealed class BinarySyntax : OperationSyntax
Binary node, which has only two children.
Exponent
Link copied to clipboard
common
class Exponent(operations: Collection<String>?) : Unary
Handles unary nodes by producing ExponentSyntax.
ExponentSyntax
Link copied to clipboard
common
data class ExponentSyntax(operation: String, operand: OperandSyntax, useOperatorForm: Boolean) : UnarySyntax
Represents exponential function.
FeaturedMathRenderer
Link copied to clipboard
common
open class FeaturedMathRenderer(features: List<FeaturedMathRenderer.RenderFeature>) : MathRenderer
Implements MST render process with sequence of features.
FeaturedMathRendererWithPostProcess
Link copied to clipboard
Fraction
Link copied to clipboard
common
class Fraction(operations: Collection<String>?) : Binary
Handles binary nodes by producing FractionSyntax.
FractionSyntax
Link copied to clipboard
common
data class FractionSyntax(operation: String, left: OperandSyntax, right: OperandSyntax, infix: Boolean) : BinarySyntax
Represents fraction with numerator and denominator.
InverseHyperbolicOperations
Link copied to clipboard
common
class InverseHyperbolicOperations(operations: Collection<String>?) : Unary
Handles binary nodes by producing inverse UnaryOperatorSyntax with ar prefix instead of a.
InverseTrigonometricOperations
Link copied to clipboard
common
class InverseTrigonometricOperations(operations: Collection<String>?) : Unary
Handles binary nodes by producing inverse UnaryOperatorSyntax with arc prefix instead of a.
LatexSyntaxRenderer
Link copied to clipboard
common
object LatexSyntaxRenderer : SyntaxRenderer
SyntaxRenderer implementation for LaTeX.
MathMLSyntaxRenderer
Link copied to clipboard
common
object MathMLSyntaxRenderer : SyntaxRenderer
SyntaxRenderer implementation for MathML.
MathRenderer
Link copied to clipboard
common
fun fun interface MathRenderer
Renders MST to MathSyntax.
MathSyntax
Link copied to clipboard
common
sealed class MathSyntax
Syntax node for mathematical typography.
Multiplication
Link copied to clipboard
common
class Multiplication(operations: Collection<String>?) : Binary
Handles binary nodes by producing MultiplicationSyntax.
MultiplicationSyntax
Link copied to clipboard
common
data class MultiplicationSyntax(operation: String, left: OperandSyntax, right: OperandSyntax, times: Boolean) : BinarySyntax
Represents binary, infix multiplication in the form of coefficient (2 x) or with operator (x &times; 2).
NumberSyntax
Link copied to clipboard
common
data class NumberSyntax(string: String) : TerminalSyntax
Represents a number.
OperandSyntax
Link copied to clipboard
common
data class OperandSyntax(operand: MathSyntax, parentheses: Boolean) : MathSyntax
Represents operand of a certain operator wrapped with parentheses or not.
OperationSyntax
Link copied to clipboard
common
sealed class OperationSyntax : MathSyntax
Node containing a certain operation.
OperatorNameSyntax
Link copied to clipboard
common
data class OperatorNameSyntax(name: String) : TerminalSyntax
Represents special typing for operator name.
Power
Link copied to clipboard
common
class Power(operations: Collection<String>?) : Binary
Handles binary nodes by producing SuperscriptSyntax.
PrettyPrintFloats
Link copied to clipboard
common
class PrettyPrintFloats(types: Set<KClass<out Number>>) : FeaturedMathRenderer.RenderFeature
Special printing for numeric types that are printed in form of ('-'?
PrettyPrintIntegers
Link copied to clipboard
common
class PrettyPrintIntegers(types: Set<KClass<out Number>>) : FeaturedMathRenderer.RenderFeature
Special printing for numeric types that are printed in form of '-'?
PrettyPrintPi
Link copied to clipboard
common
class PrettyPrintPi(symbols: Set<String>) : FeaturedMathRenderer.RenderFeature
Special printing for symbols meaning Pi.
RadicalSyntax
Link copied to clipboard
common
data class RadicalSyntax(operation: String, operand: MathSyntax) : UnarySyntax
Represents radical with a node inside it (&radic;x).
RadicalWithIndexSyntax
Link copied to clipboard
common
data class RadicalWithIndexSyntax(operation: String, left: MathSyntax, right: MathSyntax) : BinarySyntax
Represents radical syntax with index (3&radic;x).
SimplifyParentheses
Link copied to clipboard
common
class SimplifyParentheses(precedenceFunction: (MathSyntax) -> Int) : FeaturedMathRendererWithPostProcess.PostProcessPhase
Removes unnecessary parentheses from OperandSyntax.
SpecialSymbolSyntax
Link copied to clipboard
common
data class SpecialSymbolSyntax(kind: SpecialSymbolSyntax.Kind) : TerminalSyntax
Represents a usage of special symbols (e.g.
SquareRoot
Link copied to clipboard
common
class SquareRoot(operations: Collection<String>?) : Unary
Handles binary nodes by producing RadicalSyntax with no index.
SubscriptSyntax
Link copied to clipboard
common
data class SubscriptSyntax(operation: String, left: MathSyntax, right: MathSyntax) : BinarySyntax
Represents a syntax node with subscript (xi).
SuperscriptSyntax
Link copied to clipboard
common
data class SuperscriptSyntax(operation: String, left: MathSyntax, right: MathSyntax) : BinarySyntax
Represents a syntax node with superscript (x2).
SymbolSyntax
Link copied to clipboard
common
data class SymbolSyntax(string: String) : TerminalSyntax
Represents a symbol.
SyntaxRenderer
Link copied to clipboard
common
fun fun interface SyntaxRenderer
Abstraction of writing MathSyntax as a string of an actual markup language.
TerminalSyntax
Link copied to clipboard
common
sealed class TerminalSyntax : MathSyntax
Terminal node, which should not have any children nodes.
Unary
Link copied to clipboard
common
abstract class Unary(operations: Collection<String>?) : FeaturedMathRenderer.RenderFeature
Abstract printing of unary operations that discards MST if their operation is not in operations or its type is not MST.Unary.
UnaryMinus
Link copied to clipboard
common
class UnaryMinus(operations: Collection<String>?) : Unary
Handles binary nodes by producing UnaryMinusSyntax.
UnaryMinusSyntax
Link copied to clipboard
common
data class UnaryMinusSyntax(operation: String, operand: OperandSyntax) : UnarySyntax
Represents prefix, unary minus operator (-x).
UnaryOperator
Link copied to clipboard
common
class UnaryOperator(operations: Collection<String>?) : Unary
Handles unary nodes by producing UnaryOperatorSyntax.
UnaryOperatorSyntax
Link copied to clipboard
common
data class UnaryOperatorSyntax(operation: String, prefix: MathSyntax, operand: OperandSyntax) : UnarySyntax
Represents unary, prefix operator syntax (like f(x)).
UnaryPlus
Link copied to clipboard
common
class UnaryPlus(operations: Collection<String>?) : Unary
Handles unary nodes by producing UnaryPlusSyntax.
UnaryPlusSyntax
Link copied to clipboard
common
data class UnaryPlusSyntax(operation: String, operand: OperandSyntax) : UnarySyntax
Represents prefix, unary plus operator (+x).
UnarySyntax
Link copied to clipboard
common
sealed class UnarySyntax : OperationSyntax
Unary node, which has only one child.

Functions

renderWithStringBuilder
Link copied to clipboard
common
Calls SyntaxRenderer.render with given node and a new StringBuilder instance, and returns its content.

Properties

BetterExponent
Link copied to clipboard
common
Applies ExponentSyntax.useOperatorForm to ExponentSyntax when the operand contains a fraction, a superscript or a subscript to improve readability.
BetterFraction
Link copied to clipboard
common
Chooses FractionSyntax.infix depending on the context.
BetterMultiplication
Link copied to clipboard
common
Removes unnecessary times (&times;) symbols from MultiplicationSyntax.
PrintNumeric
Link copied to clipboard
common
Prints any MST.Numeric as a NumberSyntax containing the Any.toString result of it.
PrintSymbol
Link copied to clipboard
common
Prints any Symbol as a SymbolSyntax containing the Symbol.identity of it.