Examples of Algorithm


Examples of algorithms.core.Algorithm

    }
   
    public void pathCalculation() {
        AlgorithmFactory algorithmFactory =
                Factories.createFactory(currAlgorithm);
        Algorithm algorithm =
                algorithmFactory.getAlgorithm(colorSquareArr);
        algorithm.calculate();
        pathCoordArr = algorithm.getPath();
    }
View Full Code Here

Examples of com.cedarsoft.crypt.Algorithm

  @Nonnull
  @Override
  public Hash deserialize( @Nonnull JsonParser deserializeFrom, @Nonnull Version formatVersion ) throws VersionException, IOException, JsonProcessingException {
    nextFieldValue( deserializeFrom, PROPERTY_ALGORITHM );
    Algorithm algorithm = Algorithm.getAlgorithm( deserializeFrom.getText() );

    nextFieldValue( deserializeFrom, PROPERTY_VALUE );
    String hex = deserializeFrom.getText();

    closeObject( deserializeFrom );
View Full Code Here

Examples of com.nimbusds.jose.Algorithm

  private SignedAuthRequestUrlBuilder urlBuilder = new SignedAuthRequestUrlBuilder();

  @Before
  public void prepare() throws NoSuchAlgorithmException, InvalidKeySpecException {

    RSAKey key = new RSAKey(new Base64URL(n), new Base64URL(e), new Base64URL(d), KeyUse.SIGNATURE, null, new Algorithm(alg), kid, null, null, null);
    Map<String, JWK> keys = Maps.newHashMap();
    keys.put("client", key);

    signingAndValidationService = new DefaultJwtSigningAndValidationService(keys);
    signingAndValidationService.setDefaultSignerKeyId("client");
View Full Code Here

Examples of cu.repsystestbed.algorithms.Algorithm

      if(!(lastItem instanceof Graph))
      {
        throw new WorkflowException("Last item was not a graph.");
      }
     
      Algorithm alg = (Algorithm) item;
     
      if(!alg.assertGraph2ListenType((Graph) lastItem))
      {
        throw new WorkflowException("Failed preconditions: assertGraph2ListenType()");
      }
     
      alg.setGraph2Listen((Graph) lastItem);
     
      ((Graph) lastItem).addObserver(alg);
     
     
      if(item instanceof EvaluationAlgorithm)
View Full Code Here

Examples of de.timefinder.algo.Algorithm

    protected void doOnce() {
        ApplicationWindow aw = getApplicationWindow();
        aw.getStatusBar().clear();

        // inject via spring and using the same optimizer command class?
        final Algorithm algorithm = new UniTimeOptimization();
        ((UniTimeOptimization) algorithm).setInitialAssignment(true);

        // TODO make seconds editable via GUI
        int sec = 5 * 60;
        algorithm.setCondition(new AlgorithmConditionTime(sec));
        String msg = tr.get(ID + ".startTask", sec / 60.0f);

        aw.getStatusBar().getProgressMonitor().taskStarted(msg, -1);
        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
                algorithm.setDataPoolSettings(settings);
                algorithm.setDataPool(dataPool);
                algorithm.setStatusBar(new StatusBarBridge(getApplicationWindow().getStatusBar()));
                algorithm.doWork();
            }
        };
        sw.execute();
    }
View Full Code Here

Examples of edu.ucla.sspace.matrix.SVD.Algorithm

     * @return a matrix builder to be used in creating a matrix for use with the
     *         {@link SVD} class
     */   
    @Deprecated
    public static MatrixBuilder getMatrixBuilderForSVD(boolean transpose) {
        Algorithm fastest = SVD.getFastestAvailableAlgorithm();
        // In the unlikely case that this is called when no SVD support is
        // available, return a default instance rather than error out.  This
        // enables programs that call this method without invoking the SVD (or
        // those that do so optionally) to continue working without error.
        if (fastest == null) {
View Full Code Here

Examples of main.Algorithm

     * Inicia la solucion del diseño
     * Prepara los parametros necesarios y los introduce al algoritmo para obtener una solucion.    
     */
    public boolean solveProblem(Stack<AuxiliarElement> futureObjects){
        Stack<AuxiliarElement> auxiliar;
        Algorithm alg;
        Solution sol;       
        int ret;
        auxiliar = (Stack)futureObjects.clone();
        if((x*y) < (areaOc*2)/3){           
            return false;
        }
        alg = new Algorithm();
        sol = new Solution(x, y, auxiliar);
        sol.setIdRoom(idRoom);
        int ndoors = 0;
        for(int i = 0; i < posDoor.length; i++){
            if(posDoor[i][0]==0){
                sol.placeDoor(posDoor[i][1]+20, 0, 50, 50, auxiliar.size()+(i+1));
            }else if(posDoor[i][1]==0){
                int stride = posDoor[i][0]+50;
                sol.placeDoor(stride, 3, 50, 50, auxiliar.size()+(i+1));
            }else if((posDoor[i][1]+50)==y){
                sol.placeDoor(posDoor[i][0]+20, 1, 50, 50, auxiliar.size()+(i+1));
            }else if((posDoor[i][0]+50)==x){
                int stride = posDoor[i][1]+50;
                sol.placeDoor(stride+20, 2, 50, 50, auxiliar.size()+(i+1));
            }
            ndoors = (i+1);
        }
        for(int i = 0; i < posWindow.length; i++){
            if(posWindow[i][0]==0){
                sol.placeWindow(posWindow[i][1], 0, 50, 50, auxiliar.size()+(i+ndoors+1));
            }else if(posWindow[i][1]==0){
                int stride = posWindow[i][0]+50;
                sol.placeWindow(stride, 3, 50, 50, auxiliar.size()+(i+ndoors+1));
            }else if((posWindow[i][1]+50)==y){
                sol.placeWindow(posWindow[i][0], 1, 50, 50, auxiliar.size()+(i+ndoors+1));
            }else if((posWindow[i][0]+50)==x){
                int stride = posWindow[i][1]+50;
                sol.placeWindow(stride, 2, 50, 50, auxiliar.size()+(i+ndoors+1));
            }
        }
        ret = alg.forwardCheck(futureObjects, sol,this.configurationController.getCjtRestrictionsController());
        futureObjects = (Stack)auxiliar.clone();       
        if (ret == 0){           
            alg.backtracking(futureObjects, sol, this.configurationController.getCjtRestrictionsController());
        }       
        actualElements = (Stack)auxiliar.clone();        
       
        return !sol.isFail();
    }
View Full Code Here

Examples of org.apache.giraph.Algorithm

    List<Class<?>> classes = AnnotationUtils.getAnnotatedClasses(
      Algorithm.class, "org.apache.giraph");
    System.out.print("  Supported algorithms:\n");
    for (Class<?> clazz : classes) {
      if (Vertex.class.isAssignableFrom(clazz)) {
        Algorithm algorithm = clazz.getAnnotation(Algorithm.class);
        StringBuilder sb = new StringBuilder();
        sb.append(algorithm.name()).append(" - ").append(clazz.getName())
            .append("\n");
        if (!algorithm.description().equals("")) {
          sb.append("    ").append(algorithm.description()).append("\n");
        }
        System.out.print(sb.toString());
      }
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.compress.Compression.Algorithm

    final long maxsize = conf.getLong(HConstants.HREGION_MAX_FILESIZE,
        HConstants.DEFAULT_MAX_FILE_SIZE);
    // Invented config.  Add to hbase-*.xml if other than default compression.
    final String defaultCompressionStr = conf.get("hfile.compression",
        Compression.Algorithm.NONE.getName());
    final Algorithm defaultCompression = AbstractHFileWriter
        .compressionByName(defaultCompressionStr);
    final boolean compactionExclude = conf.getBoolean(
        "hbase.mapreduce.hfileoutputformat.compaction.exclude", false);

    // create a map from column family to the compression algorithm
    final Map<byte[], Algorithm> compressionMap = createFamilyCompressionMap(conf);
    final Map<byte[], BloomType> bloomTypeMap = createFamilyBloomTypeMap(conf);
    final Map<byte[], Integer> blockSizeMap = createFamilyBlockSizeMap(conf);

    String dataBlockEncodingStr = conf.get(DATABLOCK_ENCODING_OVERRIDE_CONF_KEY);
    final Map<byte[], DataBlockEncoding> datablockEncodingMap
        = createFamilyDataBlockEncodingMap(conf);
    final DataBlockEncoding overriddenEncoding;
    if (dataBlockEncodingStr != null) {
      overriddenEncoding = DataBlockEncoding.valueOf(dataBlockEncodingStr);
    } else {
      overriddenEncoding = null;
    }

    return new RecordWriter<ImmutableBytesWritable, KeyValue>() {
      // Map of families to writers and how much has been output on the writer.
      private final Map<byte [], WriterLength> writers =
        new TreeMap<byte [], WriterLength>(Bytes.BYTES_COMPARATOR);
      private byte [] previousRow = HConstants.EMPTY_BYTE_ARRAY;
      private final byte [] now = Bytes.toBytes(System.currentTimeMillis());
      private boolean rollRequested = false;

      public void write(ImmutableBytesWritable row, KeyValue kv)
      throws IOException {
        // null input == user explicitly wants to flush
        if (row == null && kv == null) {
          rollWriters();
          return;
        }

        byte [] rowKey = kv.getRow();
        long length = kv.getLength();
        byte [] family = kv.getFamily();
        WriterLength wl = this.writers.get(family);

        // If this is a new column family, verify that the directory exists
        if (wl == null) {
          fs.mkdirs(new Path(outputdir, Bytes.toString(family)));
        }

        // If any of the HFiles for the column families has reached
        // maxsize, we need to roll all the writers
        if (wl != null && wl.written + length >= maxsize) {
          this.rollRequested = true;
        }

        // This can only happen once a row is finished though
        if (rollRequested && Bytes.compareTo(this.previousRow, rowKey) != 0) {
          rollWriters();
        }

        // create a new HLog writer, if necessary
        if (wl == null || wl.writer == null) {
          wl = getNewWriter(family, conf);
        }

        // we now have the proper HLog writer. full steam ahead
        kv.updateLatestStamp(this.now);
        wl.writer.append(kv);
        wl.written += length;

        // Copy the row so we know when a row transition.
        this.previousRow = rowKey;
      }

      private void rollWriters() throws IOException {
        for (WriterLength wl : this.writers.values()) {
          if (wl.writer != null) {
            LOG.info("Writer=" + wl.writer.getPath() +
                ((wl.written == 0)? "": ", wrote=" + wl.written));
            close(wl.writer);
          }
          wl.writer = null;
          wl.written = 0;
        }
        this.rollRequested = false;
      }

      /* Create a new StoreFile.Writer.
       * @param family
       * @return A WriterLength, containing a new StoreFile.Writer.
       * @throws IOException
       */
      private WriterLength getNewWriter(byte[] family, Configuration conf)
          throws IOException {
        WriterLength wl = new WriterLength();
        Path familydir = new Path(outputdir, Bytes.toString(family));
        Algorithm compression = compressionMap.get(family);
        compression = compression == null ? defaultCompression : compression;
        BloomType bloomType = bloomTypeMap.get(family);
        bloomType = bloomType == null ? BloomType.NONE : bloomType;
        Integer blockSize = blockSizeMap.get(family);
        blockSize = blockSize == null ? HConstants.DEFAULT_BLOCKSIZE : blockSize;
View Full Code Here

Examples of org.apache.hadoop.hbase.io.compress.Compression.Algorithm

    Map<byte[], String> stringMap = createFamilyConfValueMap(conf,
        COMPRESSION_FAMILIES_CONF_KEY);
    Map<byte[], Algorithm> compressionMap = new TreeMap<byte[],
        Algorithm>(Bytes.BYTES_COMPARATOR);
    for (Map.Entry<byte[], String> e : stringMap.entrySet()) {
      Algorithm algorithm = AbstractHFileWriter.compressionByName
          (e.getValue());
      compressionMap.put(e.getKey(), algorithm);
    }
    return compressionMap;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.