Minor documentation fixes.

Fix #174.
This commit is contained in:
Sébastien Crozet 2016-03-31 21:30:23 +02:00
parent 35ae97dc29
commit 20bb99c312
2 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ impl<N: Clone + Copy> DMat<N> {
} }
impl<N> DMat<N> { impl<N> DMat<N> {
/// Builds a matrix using an initialization function. /// Builds a matrix filled with the results of a function applied to each of its component coordinates.
#[inline(always)] #[inline(always)]
pub fn from_fn<F: FnMut(usize, usize) -> N>(nrows: usize, ncols: usize, mut f: F) -> DMat<N> { pub fn from_fn<F: FnMut(usize, usize) -> N>(nrows: usize, ncols: usize, mut f: F) -> DMat<N> {
DMat { DMat {

View File

@ -54,7 +54,7 @@ impl<N: Clone> DVec<N> {
} }
impl<N> DVec<N> { impl<N> DVec<N> {
/// Builds a vector filled with the result of a function. /// Builds a vector filled with the results of a function applied to each of its component coordinates.
#[inline(always)] #[inline(always)]
pub fn from_fn<F: FnMut(usize) -> N>(dim: usize, mut f: F) -> DVec<N> { pub fn from_fn<F: FnMut(usize) -> N>(dim: usize, mut f: F) -> DVec<N> {
DVec { at: (0..dim).map(|i| f(i)).collect() } DVec { at: (0..dim).map(|i| f(i)).collect() }