Multiplies the vector by another.

@param vec The other vector
@return the same vector
183701
public Vector multiply(Vector vec) {
        x *= vec.x;
        y *= vec.y;
        z *= vec.z;
        return this;
    }
719612
public Vector3d add(Vector3fc v, Vector3d dest) {
        dest.x = x + v.x();
        dest.y = y + v.y();
        dest.z = z + v.z();
        return dest;
    }
497612
public Vector2i mul(Vector2ic v, Vector2i dest) {
        dest.x = x * v.x();
        dest.y = y * v.y();
        return dest;
    }
792741
def copy(self):
        """"""
        new_vec = Vector2()
        new_vec.X = self.X
        new_vec.Y = self.Y
        return new_vec
917555
public static double sum (double[] vector) {
        // Declare and initialize the accumulator:
        double total = 0.0;

        // Iterate over the vector:
        for (int i = 0; i < vector.length; i++) {
            total += vector[i];
        }

        // Done, return:
        return total;
    }
155880
public Vector3d add(Vector3dc v, Vector3d dest) {
        dest.x = x + v.x();
        dest.y = y + v.y();
        dest.z = z + v.z();
        return dest;
    }
729055
public Vector3d mul(double scalar, Vector3d dest) {
        dest.x = x * scalar;
        dest.y = y * scalar;
        dest.z = z * scalar;
        return dest;
    }
1094104
public Vector3d transform(Vector3d vec){
        return transform(vec.x, vec.y, vec.z, vec);
    }
594221
function(m){
        return new Vec3(
            this.x*m[0][0]+this.y*m[0][1]+this.z*m[0][2],
            this.x*m[1][0]+this.y*m[1][1]+this.z*m[1][2],
            this.x*m[2][0]+this.y*m[2][1]+this.z*m[2][2]
        );
    }
91366
public Vector2i mul(int x, int y, Vector2i dest) {
        dest.x = this.x * x;
        dest.y = this.y * y;
        return dest;
    }
547550
public void addAll(StringArrayList vec) {
        int i;
        int max;

        max = vec.size();
        for (i = 0; i < max; i++) {
            add(vec.get(i));
        }
    }
592983
def rotate_vec(self, vec):
        
        xyz = Vec3(self.x, self.y, self.z)
        return add_v3(vec, scale_v3(
            xyz.cross(xyz.cross(vec) + scale_v3(vec, self.w)), 2.0))
117984
function(returnNew) {
      var x = Math.abs(this.x), y = Math.abs(this.y);

      if (returnNew) {
        return new Vec2(x, y);
      } else {
        return this.set(x, y);
      }
    }
912815
void add_vector(SparseVector vec)
    {

        for (Map.Entry<Integer, Double> entry : vec.entrySet())
        {
            Double v = get(entry.getKey());
            if (v == null)
                v = 0.;
            put(entry.getKey(), v + entry.getValue());
        }
    }
417270
public void mul(double b, IVector result) {
        if (result.size != size) result.reshape(size);

        int i;
        for (i = 0; i < size; i++) {
            result.realvector[i] = realvector[i] * b;
            result.imagvector[i] = imagvector[i] * b;
        }
    }
609587
public Vector copy(Vector vec) {
        x = vec.x;
        y = vec.y;
        z = vec.z;
        return this;
    }
1301520
public double dot(Vector v)
	{
		return (x * v.x) + (y * v.y) + (z * v.z);
	}