Here you can find the source of ShortenVector(double[] vector, int new_length)
public static double[] ShortenVector(double[] vector, int new_length)
//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; } }