Math2mat

/home/ythoma/docs/math2mat/svn/wp1/framework/m2mGUI/src/m2m/backend/structure/SQRT.java

Go to the documentation of this file.
00001 /******************************************************************************
00002  *                                                                                      SQRT
00003  ******************************************************************************
00004  * Auteur               : Trolliet Gregory
00005  * Date                 : 29 avr. 2009
00006  * Description :
00007  ******************************************************************************/
00008 package m2m.backend.structure;
00009 
00017 public class SQRT extends Operation {
00018 
00019         final static String OPNAME="sqrt";
00020         
00021         public SQRT() {
00022                 super(OPNAME);
00023         }
00024 
00025         @Override
00026         public void copyTo(Element e,Function newFunc) {
00027                 SQRT newElement=(SQRT)e;
00028                 super.copyTo(newElement,newFunc);
00029         }
00030         
00031         @Override
00032         public Element copy(Function newFunc) {
00033                 SQRT newElement=new SQRT();
00034                 this.copyTo(newElement,newFunc);
00035                 return newElement;
00036         }
00037         
00038         @Override
00039         public String getOpSymbol() {
00040                 return "sqrt";
00041         }
00042 
00043         @Override
00044         public String toOctave(int level) {
00045                 String sOctave = new String();
00046                 sOctave += tab(level) + this.input.firstElement().getName();
00047                 if (this.output.firstElement() instanceof Variable) {
00048                         if (this.output.firstElement().getName().isEmpty()) {
00049                                 sOctave += "\t= sqrt(" + ((Variable)this.output.firstElement()).getVal() + ")";
00050                         } else {
00051                                 sOctave += "\t= sqrt(" + this.output.firstElement().getName() + ")";
00052                         }
00053                 }
00054                 return sOctave;
00055         }
00056 }
 All Classes Namespaces Files Functions Variables Enumerations