Documentation ¶
Index ¶
- Constants
- func AttrsToStrings(sym *expreduceapi.Attributes) []string
- func AttrsToSymList(sym *expreduceapi.Attributes) expreduceapi.ExpressionInterface
- func ComputeNumericPart(fn foldFn, e expreduceapi.ExpressionInterface) (expreduceapi.Ex, int)
- func ContainsSymbol(e expreduceapi.Ex, name string) bool
- func ExOrder(a expreduceapi.Ex, b expreduceapi.Ex) int64
- func IsSameQ(a expreduceapi.Ex, b expreduceapi.Ex) bool
- func NumberQ(e expreduceapi.Ex) bool
- func OperatorAssertion(ex expreduceapi.Ex, opHead string) (*Expression, *Expression, bool)
- func RegisterGobAtoms()
- func S(name string) expreduceapi.Ex
- func StringsToAttributes(strings []string) expreduceapi.Attributes
- type Complex
- func (cmplx *Complex) AsExpr() expreduceapi.Ex
- func (cmplx *Complex) Copy() expreduceapi.Ex
- func (cmplx *Complex) DeepCopy() expreduceapi.Ex
- func (cmplx *Complex) HasReal() bool
- func (cmplx *Complex) Hash() uint64
- func (cmplx *Complex) IsEqual(other expreduceapi.Ex) string
- func (cmplx *Complex) NeedsEval() bool
- func (cmplx *Complex) SetNeedsEval(newVal bool)
- func (cmplx *Complex) StringForm(p expreduceapi.ToStringParams) string
- type Expression
- func E(parts ...expreduceapi.Ex) *Expression
- func HeadAssertion(ex expreduceapi.Ex, head string) (*Expression, bool)
- func HeadExAssertion(ex expreduceapi.Ex, head expreduceapi.Ex, cl expreduceapi.LoggingInterface) (*Expression, bool)
- func NewEmptyExpression() *Expression
- func NewExpression(parts []expreduceapi.Ex) *Expression
- func NewHead(head string) *Expression
- func NewStringList(items []string) *Expression
- func ShallowCopy(thisExprExprInt expreduceapi.ExpressionInterface) *Expression
- func (thisExpr *Expression) AppendEx(e expreduceapi.Ex)
- func (thisExpr *Expression) AppendExArray(e []expreduceapi.Ex)
- func (thisExpr *Expression) ClearHashes()
- func (thisExpr *Expression) Copy() expreduceapi.Ex
- func (thisExpr *Expression) DeepCopy() expreduceapi.Ex
- func (thisExpr *Expression) GetPart(i int) expreduceapi.Ex
- func (thisExpr *Expression) GetParts() []expreduceapi.Ex
- func (thisExpr *Expression) Hash() uint64
- func (thisExpr *Expression) HeadStr() string
- func (thisExpr *Expression) IsEqual(otherEx expreduceapi.Ex) string
- func (thisExpr *Expression) Len() int
- func (thisExpr *Expression) Less(i, j int) bool
- func (thisExpr *Expression) NeedsEval() bool
- func (thisExpr *Expression) PropagateConditionals() (*Expression, bool)
- func (thisExpr *Expression) SetNeedsEval(newVal bool)
- func (thisExpr *Expression) SetParts(newParts []expreduceapi.Ex)
- func (thisExpr *Expression) String() string
- func (thisExpr *Expression) StringForm(params expreduceapi.ToStringParams) string
- func (thisExpr *Expression) Swap(i, j int)
- type Flt
- type Integer
- func (thisInt *Integer) Copy() expreduceapi.Ex
- func (thisInt *Integer) DeepCopy() expreduceapi.Ex
- func (thisInt *Integer) Hash() uint64
- func (thisInt *Integer) IsEqual(other expreduceapi.Ex) string
- func (thisInt *Integer) NeedsEval() bool
- func (thisInt *Integer) String() string
- func (thisInt *Integer) StringForm(params expreduceapi.ToStringParams) string
- type Rational
- func (thisRational *Rational) Copy() expreduceapi.Ex
- func (thisRational *Rational) DeepCopy() expreduceapi.Ex
- func (thisRational *Rational) Hash() uint64
- func (thisRational *Rational) IsEqual(other expreduceapi.Ex) string
- func (thisRational *Rational) MulBigI(i *big.Int)
- func (thisRational *Rational) NeedsEval() bool
- func (thisRational *Rational) SetNeedsEval(newVal bool)
- func (thisRational *Rational) StringForm(params expreduceapi.ToStringParams) string
- type String
- func (str *String) Copy() expreduceapi.Ex
- func (str *String) DeepCopy() expreduceapi.Ex
- func (str *String) GetValue() string
- func (str *String) Hash() uint64
- func (str *String) IsEqual(other expreduceapi.Ex) string
- func (str *String) NeedsEval() bool
- func (str *String) String() string
- func (str *String) StringForm(params expreduceapi.ToStringParams) string
- type Symbol
- func (sym *Symbol) Attrs(dm expreduceapi.DefinitionMap) expreduceapi.Attributes
- func (sym *Symbol) Copy() expreduceapi.Ex
- func (sym *Symbol) DeepCopy() expreduceapi.Ex
- func (sym *Symbol) Default(dm expreduceapi.DefinitionMap) expreduceapi.Ex
- func (sym *Symbol) Hash() uint64
- func (sym *Symbol) IsEqual(other expreduceapi.Ex) string
- func (sym *Symbol) NeedsEval() bool
- func (sym *Symbol) String() string
- func (sym *Symbol) StringForm(params expreduceapi.ToStringParams) string
Constants ¶
View Source
const ( // FoldFnAdd designates that values should be added. FoldFnAdd foldFn = iota // FoldFnMul designates that values should be multiplied. FoldFnMul )
Variables ¶
This section is empty.
Functions ¶
func AttrsToStrings ¶
func AttrsToStrings(sym *expreduceapi.Attributes) []string
func AttrsToSymList ¶
func AttrsToSymList(sym *expreduceapi.Attributes) expreduceapi.ExpressionInterface
func ComputeNumericPart ¶
func ComputeNumericPart(fn foldFn, e expreduceapi.ExpressionInterface) (expreduceapi.Ex, int)
func ContainsSymbol ¶
func ContainsSymbol(e expreduceapi.Ex, name string) bool
func ExOrder ¶
func ExOrder(a expreduceapi.Ex, b expreduceapi.Ex) int64
func IsSameQ ¶
func IsSameQ(a expreduceapi.Ex, b expreduceapi.Ex) bool
IsSameQ returns if two expressions are the same. It is mostly just a comparison of the hash values but it does include special handling for floats.
func NumberQ ¶
func NumberQ(e expreduceapi.Ex) bool
func OperatorAssertion ¶
func OperatorAssertion(ex expreduceapi.Ex, opHead string) (*Expression, *Expression, bool)
func RegisterGobAtoms ¶
func RegisterGobAtoms()
RegisterGobAtoms performs gob registration for the atoms package.
func S ¶
func S(name string) expreduceapi.Ex
func StringsToAttributes ¶
func StringsToAttributes(strings []string) expreduceapi.Attributes
Types ¶
type Complex ¶
type Complex struct { Re expreduceapi.Ex Im expreduceapi.Ex // contains filtered or unexported fields }
func NewComplex ¶
func NewComplex(r expreduceapi.Ex, i expreduceapi.Ex) *Complex
func (*Complex) AsExpr ¶
func (cmplx *Complex) AsExpr() expreduceapi.Ex
func (*Complex) Copy ¶
func (cmplx *Complex) Copy() expreduceapi.Ex
func (*Complex) DeepCopy ¶
func (cmplx *Complex) DeepCopy() expreduceapi.Ex
func (*Complex) SetNeedsEval ¶
func (*Complex) StringForm ¶
func (cmplx *Complex) StringForm(p expreduceapi.ToStringParams) string
type Expression ¶
type Expression struct { Parts []expreduceapi.Ex EvaledHash uint64 CachedHash uint64 // contains filtered or unexported fields }
func E ¶
func E(parts ...expreduceapi.Ex) *Expression
func HeadAssertion ¶
func HeadAssertion(ex expreduceapi.Ex, head string) (*Expression, bool)
HeadAssertion checks if the Ex is an Expression of with a head of 'head'. Deprecated in favor of headExAssertion
func HeadExAssertion ¶
func HeadExAssertion(ex expreduceapi.Ex, head expreduceapi.Ex, cl expreduceapi.LoggingInterface) (*Expression, bool)
func NewEmptyExpression ¶
func NewEmptyExpression() *Expression
func NewExpression ¶
func NewExpression(parts []expreduceapi.Ex) *Expression
func NewHead ¶
func NewHead(head string) *Expression
func NewStringList ¶
func NewStringList(items []string) *Expression
NewStringList transforms a list of strings in Go format into Expreduce format.
func ShallowCopy ¶
func ShallowCopy(thisExprExprInt expreduceapi.ExpressionInterface) *Expression
func (*Expression) AppendEx ¶
func (thisExpr *Expression) AppendEx(e expreduceapi.Ex)
func (*Expression) AppendExArray ¶
func (thisExpr *Expression) AppendExArray(e []expreduceapi.Ex)
func (*Expression) ClearHashes ¶
func (thisExpr *Expression) ClearHashes()
func (*Expression) Copy ¶
func (thisExpr *Expression) Copy() expreduceapi.Ex
func (*Expression) DeepCopy ¶
func (thisExpr *Expression) DeepCopy() expreduceapi.Ex
func (*Expression) GetPart ¶
func (thisExpr *Expression) GetPart(i int) expreduceapi.Ex
func (*Expression) GetParts ¶
func (thisExpr *Expression) GetParts() []expreduceapi.Ex
func (*Expression) Hash ¶
func (thisExpr *Expression) Hash() uint64
func (*Expression) HeadStr ¶
func (thisExpr *Expression) HeadStr() string
func (*Expression) IsEqual ¶
func (thisExpr *Expression) IsEqual(otherEx expreduceapi.Ex) string
func (*Expression) Less ¶
func (thisExpr *Expression) Less(i, j int) bool
func (*Expression) NeedsEval ¶
func (thisExpr *Expression) NeedsEval() bool
func (*Expression) PropagateConditionals ¶
func (thisExpr *Expression) PropagateConditionals() (*Expression, bool)
func (*Expression) SetNeedsEval ¶
func (thisExpr *Expression) SetNeedsEval(newVal bool)
func (*Expression) SetParts ¶
func (thisExpr *Expression) SetParts(newParts []expreduceapi.Ex)
func (*Expression) String ¶
func (thisExpr *Expression) String() string
func (*Expression) StringForm ¶
func (thisExpr *Expression) StringForm(params expreduceapi.ToStringParams) string
func (*Expression) Swap ¶
func (thisExpr *Expression) Swap(i, j int)
type Flt ¶
Flt represents a floating point number in Expreduce. The values are represented by big.Float internally.
func IntegerToFlt ¶
func RationalToFlt ¶
func (*Flt) Copy ¶
func (flt *Flt) Copy() expreduceapi.Ex
func (*Flt) DeepCopy ¶
func (flt *Flt) DeepCopy() expreduceapi.Ex
func (*Flt) StringForm ¶
func (flt *Flt) StringForm(params expreduceapi.ToStringParams) string
type Integer ¶
Integer numbers represented by big.Int
func NewInteger ¶
func (*Integer) Copy ¶
func (thisInt *Integer) Copy() expreduceapi.Ex
func (*Integer) DeepCopy ¶
func (thisInt *Integer) DeepCopy() expreduceapi.Ex
func (*Integer) StringForm ¶
func (thisInt *Integer) StringForm(params expreduceapi.ToStringParams) string
type Rational ¶
func (*Rational) Copy ¶
func (thisRational *Rational) Copy() expreduceapi.Ex
func (*Rational) DeepCopy ¶
func (thisRational *Rational) DeepCopy() expreduceapi.Ex
func (*Rational) SetNeedsEval ¶
func (*Rational) StringForm ¶
func (thisRational *Rational) StringForm(params expreduceapi.ToStringParams) string
type String ¶
type String struct {
Val string
}
func (*String) Copy ¶
func (str *String) Copy() expreduceapi.Ex
func (*String) DeepCopy ¶
func (str *String) DeepCopy() expreduceapi.Ex
func (*String) StringForm ¶
func (str *String) StringForm(params expreduceapi.ToStringParams) string
type Symbol ¶
type Symbol struct { Name string // contains filtered or unexported fields }
Symbol represents a symbol in Expreduce. Symbols are defined by a string-based name.
func (*Symbol) Attrs ¶
func (sym *Symbol) Attrs(dm expreduceapi.DefinitionMap) expreduceapi.Attributes
func (*Symbol) Copy ¶
func (sym *Symbol) Copy() expreduceapi.Ex
func (*Symbol) DeepCopy ¶
func (sym *Symbol) DeepCopy() expreduceapi.Ex
func (*Symbol) Default ¶
func (sym *Symbol) Default(dm expreduceapi.DefinitionMap) expreduceapi.Ex
func (*Symbol) StringForm ¶
func (sym *Symbol) StringForm(params expreduceapi.ToStringParams) string
Click to show internal directories.
Click to hide internal directories.