示例#1
0
        public override bool IsSameType(MathObject other, IDictionary <string, MathObject> parameters)
        {
            var x = this.ToString();

            if (this.IsVariable())
            {
                if (x.Length == 3 && x[2] == '?')
                {
                    return(IsSameTypeMain(other, parameters, x.Substring(0, 2)));
                }
                else
                {
                    return(IsSameTypeMain(other, parameters, x));
                }
            }
            else
            {
                return(other is MathToken && this.Main.Equals(other.Main));
            }
        }
示例#2
0
 /// <summary>
 /// MathObjectが同じ「型」であるかを調べる
 /// </summary>
 /// <param name="other">#1, #2, …, #9を含まないMathObject</param>
 /// <param name="parameters">#1, #2, …, #9に対応するパラメーターを取得し格納する辞書</param>
 /// <returns>同じ型ならtrue</returns>
 public abstract bool IsSameType(MathObject other, IDictionary <string, MathObject> parameters);
示例#3
0
 /// <summary>
 /// 指定したMathObjectで二つに分割する(全てのパターンを返す)(添え字がある場合は何も返さない)
 /// </summary>
 /// <param name="center">分割で使用するMathObject</param>
 /// <returns>left: 左のMathObject  center: 指定したMathObject  right: 右のMathObject</returns>
 public abstract IEnumerable <(MathObject left, MathObject center, MathObject right)> Divide(MathObject center);
示例#4
0
 /// <summary>
 /// 添え字を付ける
 /// </summary>
 /// <param name="supOrSub">^ もしくは _ を表すToken</param>
 /// <param name="left">左側の括弧となるToken</param>
 /// <param name="math">添え字となるMathObject</param>
 /// <param name="right">右側の括弧となるToken</param>
 /// <returns>付けた後のMathSequence</returns>
 public abstract MathSequence SetScript(Token supOrSub, Token left, MathObject math, Token right);
示例#5
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="nodeName">対象のnode name</param>
 /// <param name="mathText">対象を表す数式</param>
 private TikZNode(string nodeName, MathObject math)
 {
     NodeName   = nodeName;
     MathObject = math;
 }
示例#6
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="name">射の名前を表すSequence</param>
 /// <param name="source">domainのnode name</param>
 /// <param name="target">codomainのnode name</param>
 private TikZArrow(MathObject name, string source, string target)
 {
     MathObject     = name;
     SourceNodeName = source;
     TargetNodeName = target;
 }
示例#7
0
 public override MathSequence SetScript(Token supOrSub, Token left, MathObject math, Token right)
 {
     return(new MathSequence(this, supOrSub, left, math, right));
 }
示例#8
0
 public Functor(MathObject name, MathObject functor)
 {
     Name     = name;
     _functor = functor;
 }
示例#9
0
 public override IEnumerable <(MathObject left, MathObject center, MathObject right)> Divide(MathObject center)
 {
     yield break;
 }
示例#10
0
 public Morphism(MathObject math, string source, string target, MorphismType type)
     : this(math, source, target, type, Array.Empty <Morphism>())
 {
 }
示例#11
0
 public Morphism(MathObject math, string source, string target, MorphismType type, IEnumerable <Morphism> defMorphismList)
     : this(math, new MathObjectFactory(source).CreateSingle(), new MathObjectFactory(target).CreateSingle(), type, defMorphismList)
 {
 }
示例#12
0
 public Morphism(MathObject math, MathObject source, MathObject target, MorphismType type, int defLine)
     : this(math, source, target, type, Array.Empty <Morphism>())
 {
     _defLine = defLine;
 }