C++
C#
VB
JScript
All

# generate

Copyright (C) 2005 IENT-RWTH Aachen

template<class G, class F> Vector<G> &generate(Vector<G> &X, const F &f)
template<class G, class F> Matrix<G> &generate(Matrix<G> &X, const F &f)

Initalizes an array with a function

Remarks

The function f is called for each position of X

- for vectors

      X[i]   = f(i);

- for matrices

      X(i,j) = f(i,j);

See Also

dense_vector_generate, dense_matrix_generate