Java String Shorten ShortenVector(double[] vector, int new_length)

Here you can find the source of ShortenVector(double[] vector, int new_length)

Description

Shorten Vector

License

Open Source License

Declaration

public static double[] ShortenVector(double[] vector, int new_length) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double[] ShortenVector(double[] vector, int new_length) {
        double[] result = new double[new_length];
        for (int i = 0; i < new_length; i++) {
            result[i] = vector[i];/*from  w  ww .  j av  a  2 s  .com*/
        }
        return result;
    }
}

Related

  1. shortenTo(String string, int lenght)
  2. shortenToFirstLast(String filename)
  3. shortenType(String typeText)
  4. shortenURI(String uri)
  5. shortenUrl(String protocolHostPart, String pathPart, String queryPart, String fragmentIdentifier)
  6. shortenXPathForPropertyExpansion(String xpath, String value)