Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangDouble


    @Override
    public void dump(OtpErlangObject arg, StringBuffer resultHolder) {
      assert (arg instanceof OtpErlangDouble)
          || (arg instanceof OtpErlangFloat);
      if (arg instanceof OtpErlangDouble) {
        OtpErlangDouble doubleValue = (OtpErlangDouble) arg;
        resultHolder.append(doubleValue.doubleValue());
      } else if (arg instanceof OtpErlangFloat) {
        OtpErlangDouble doubleValue = (OtpErlangDouble) arg;
        resultHolder.append(doubleValue.doubleValue());
      }
    }
View Full Code Here


    if (attributes.arity() != 0) throw new IllegalArgumentException("FloatSignature does not accept attributes");
  }
 
  @Override
  public OtpErlangObject instantiate() {
    return new OtpErlangDouble(96.);
  }
View Full Code Here

  /** Converts the supplied array to the corresponding Erlang representation. */
  private static OtpErlangList serialiseDoubleArray(double []array)
  {
    if (array == null)
      return new OtpErlangList();// empty list
    OtpErlangDouble convertedArray[] = new OtpErlangDouble[array.length];for(int i=0;i<array.length;++i) convertedArray[i]=new OtpErlangDouble(array[i]);
    return new OtpErlangList(convertedArray);
  }
View Full Code Here

      // For Markov, we do not need to learn anything at all - our Markov matrix contains enough information to classify paths and hence compare it to the reference graph.
      ConfusionMatrix mat = DiffExperiments.classifyAgainstMarkov(testSet, referenceGraph, m);
      DifferenceToReferenceLanguageBCR differenceBCRMarkov = new DifferenceToReferenceLanguageBCR(mat);
     
      return new OtpErlangTuple(new OtpErlangObject[]{
          new OtpErlangDouble(differenceStructural.getValue()),new OtpErlangDouble(differenceBCRlearnt.getValue()),new OtpErlangDouble(differenceBCRMarkov.getValue())
      });
    }
View Full Code Here

    return term instanceof OtpErlangFloat || term instanceof OtpErlangDouble;
  }

  @Override
  public List<OtpErlangObject> instantiateAllAlts() {
    return Collections.singletonList((OtpErlangObject)new OtpErlangDouble(96.63));

  }
View Full Code Here

  /** Converts the supplied array to the corresponding Erlang representation. */
  private static OtpErlangList serialiseDoubleArray(double []array)
  {
    if (array == null)
      return new OtpErlangList();// empty list
    OtpErlangDouble convertedArray[] = new OtpErlangDouble[array.length];for(int i=0;i<array.length;++i) convertedArray[i]=new OtpErlangDouble(array[i]);
    return new OtpErlangList(convertedArray);
  }
View Full Code Here

  /** Converts the supplied array to the corresponding Erlang representation. */
  private static OtpErlangList serialiseDoubleArray(double []array)
  {
    if (array == null)
      return new OtpErlangList();// empty list
    OtpErlangDouble convertedArray[] = new OtpErlangDouble[array.length];for(int i=0;i<array.length;++i) convertedArray[i]=new OtpErlangDouble(array[i]);
    return new OtpErlangList(convertedArray);
  }
View Full Code Here

          OtpErlangObject value = null;
          if (outcome.getClass().equals(Boolean.class))
            value = new OtpErlangBoolean(
                ((Boolean) outcome).booleanValue());
          else if (outcome.getClass().equals(Double.class))
            value = new OtpErlangDouble(
                ((Double) outcome).doubleValue());
          else if (outcome.getClass().equals(String.class))
            value = new OtpErlangAtom((String) outcome);
          else if (outcome.getClass().equals(Integer.class))
            value = new OtpErlangInt(((Integer) outcome).intValue());
View Full Code Here

        double parsingResult = Double.parseDouble(textToParse);
        if (Double.isInfinite(parsingResult)
            || Double.isNaN(parsingResult))
          throw new IllegalArgumentException(
              "the number parsed cannot be represented as a double");
        result = new OtpErlangDouble(parsingResult);

      }
      return result;
    }
View Full Code Here

    @Override
    public void dump(OtpErlangObject arg, StringBuffer resultHolder) {
      assert (arg instanceof OtpErlangDouble)
          || (arg instanceof OtpErlangFloat);
      if (arg instanceof OtpErlangDouble) {
        OtpErlangDouble doubleValue = (OtpErlangDouble) arg;
        resultHolder.append(doubleValue.doubleValue());
      } else if (arg instanceof OtpErlangFloat) {
        OtpErlangDouble doubleValue = (OtpErlangDouble) arg;
        resultHolder.append(doubleValue.doubleValue());
      }
    }
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangDouble

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.