Java ArrayList Sum sumVector(ArrayList v1, ArrayList v2)

Here you can find the source of sumVector(ArrayList v1, ArrayList v2)

Description

sum Vector

License

Apache License

Declaration

public static ArrayList<Double> sumVector(ArrayList<Double> v1, ArrayList<Double> v2) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

public class Main {
    public static ArrayList<Double> sumVector(ArrayList<Double> v1, ArrayList<Double> v2) {
        ArrayList<Double> sumV = new ArrayList<Double>();
        for (int i = 0; i < v1.size(); i++) {
            sumV.add(v1.get(i) + v2.get(i));
        }//w  w  w  .  j av  a2 s .c om
        return sumV;
    }
}

Related

  1. sum(ArrayList values)
  2. sum(ArrayList values)
  3. Sum(ArrayList values)
  4. sum(ArrayList a)
  5. sumInColumns(ArrayList lines)