[BACK]Return to CMO_MONOMIAL32.java CVS log [TXT][DIR] Up to [local] / OpenXM / src / OpenMath / ORG / openxm / tam

Annotation of OpenXM/src/OpenMath/ORG/openxm/tam/CMO_MONOMIAL32.java, Revision 1.3

1.1       tam         1: /**
1.3     ! ohara       2:  * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/CMO_MONOMIAL32.java,v 1.2 2000/09/13 06:32:42 tam Exp $
1.1       tam         3:  */
                      4: package ORG.openxm.tam;
                      5:
                      6: import java.io.*;
                      7: import java.math.BigInteger;
                      8:
                      9: /**
                     10:  * CMO $B7A<0$N(B MONOMIAL32 $B7?$rI=$7$^$9(B.
                     11:  * $B$3$N%/%i%9$OC19`<0$rI=8=$7$^$9(B.
                     12:  */
                     13: final public class CMO_MONOMIAL32 extends CMO{
                     14:   private int[] degree;
                     15:   private CMO coefficient;
                     16:
                     17:   /**
                     18:    * $B78?t(B coefficient, $B<!?t(B degree[] $B$H$9$k(B MONOMIAL32 $B$r:n@.$7$^$9(B.
                     19:    */
                     20:   public CMO_MONOMIAL32(int[] degree,CMO coefficient){
                     21:     this.degree = degree;
                     22:     this.coefficient = coefficient;
                     23:   }
                     24:
                     25:   public int DISCRIMINATOR(){
                     26:     return CMO.MONOMIAL32;
                     27:   }
1.3     ! ohara      28:
        !            29:     public boolean allowQ (int[] datacap) {
        !            30:                return CMO.allowQ_tag(datacap, DISCRIMINATOR())
        !            31:                        && coefficient.allowQ(datacap);
        !            32:     }
1.1       tam        33:
1.2       tam        34:   public void sendByObject(OpenXMstream os)
1.1       tam        35:        throws IOException,MathcapViolation{
                     36:     os.writeInt(degree.length);
                     37:     for(int i=0;i<degree.length;i++){
                     38:       os.writeInt(degree[i]);
                     39:     }
                     40:     coefficient.write(os);
                     41:   }
                     42:
1.2       tam        43:   static protected CMO receive(OpenXMstream is) throws IOException{
1.1       tam        44:     int n;
                     45:     int[] degree;
                     46:     CMO coefficient;
                     47:
                     48:     n = is.readInt();
                     49:     degree = new int[n];
                     50:
                     51:     for(int i=0;i<n;i++){
                     52:       degree[i] = is.readInt();
                     53:     }
                     54:
                     55:     coefficient = CMO.receive(is);
                     56:
                     57:     return new CMO_MONOMIAL32(degree,coefficient);
                     58:   }
                     59:
                     60:   public String toCMOexpressionByObject(){
                     61:     String ret;
                     62:
                     63:     ret = "CMO_MONOMIAL32,"+ degree.length;
                     64:
                     65:     for(int i=0;i<degree.length;i++){
                     66:       ret += ","+ degree[i] ;
                     67:     }
                     68:
                     69:     return ret +","+ coefficient.toCMOexpression();
                     70:   }
                     71:
                     72:   /**
                     73:    * $B78?t$rF@$^$9(B.
                     74:    */
                     75:   public CMO getCoefficient(){
                     76:     return coefficient;
                     77:   }
                     78:
                     79:   /**
                     80:    * $B<!?t$rF@$^$9(B.
                     81:    */
                     82:   public int[] getDegree(){
                     83:     return degree;
                     84:   }
                     85: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>