Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<double[]> toListTuple(double [] array){
- double [] sublist = null;
- for(int i = 0;i<array.length;i++){
- if(i%3==0)
- sublist = new double[3];
- sublist[i%3] = array[i];
- }
- }
- List<double[]> list = new ArrayList<>();
- for(int i = 0; i < values.length; i += 3) {
- double[] d = new double[3];
- d[0] = values[i];
- d[1] = values[i+1];
- d[2] = values[i+2];
- list.add(d);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement