Minor doc improvements.

This commit is contained in:
Sébastien Crozet 2013-09-26 17:18:14 +02:00
parent b61d621090
commit c344be7351
5 changed files with 20 additions and 16 deletions

View File

@ -28,18 +28,10 @@ pub mod adaptors {
pub mod transform; pub mod transform;
} }
/// Traits implemented by matrices and vectors. /// Traits implemented by matrices and vectors. Re-exported by the `mat` or the `vec` module.
///
/// They should not be imported from here since all of them are re-exported by the `mat` or the
/// `vec` module.
pub mod traits { pub mod traits {
/// Traits of operations having a well-known or explicit geometric meaning.
pub mod geometry; pub mod geometry;
/// Traits giving structural informations on linear algebra objects or the space they live in.
pub mod structure; pub mod structure;
/// Low level operations on vectors and matrices.
pub mod operations; pub mod operations;
} }

View File

@ -1,3 +1,6 @@
//! Traits of operations having a well-known or explicit geometric meaning.
use traits::structure::Mat; use traits::structure::Mat;
/// Trait of object which represent a translation, and to wich new translation /// Trait of object which represent a translation, and to wich new translation
@ -105,9 +108,11 @@ pub trait Dot<N> {
/** /**
* Short-cut to compute the projection of a point on a vector, but without * Short-cut to compute the projection of a point on a vector, but without
* computing intermediate vectors. * computing intermediate vectors.
* This must be equivalent to: * The following equation must be verified:
* *
* (a - b).dot(c) * ~~~{.rust}
* a.sub_dot(b, c) == (a - b).dot(c)
* ~~~
* *
*/ */
#[inline] #[inline]

View File

@ -1,3 +1,6 @@
//! Low level operations on vectors and matrices.
/// Trait of objects having an absolute value. /// Trait of objects having an absolute value.
/// This is useful if the object does not have the same type as its absolute value. /// This is useful if the object does not have the same type as its absolute value.
pub trait Absolute<A> { pub trait Absolute<A> {
@ -34,16 +37,18 @@ pub trait Outer<V, M> {
/// Trait for computing the covariance of a set of data. /// Trait for computing the covariance of a set of data.
pub trait Cov<M> { pub trait Cov<M> {
/// Computes the covariance of the obsevations stored by `self`: /// Computes the covariance of the obsevations stored by `self`:
/// * for matrices, observations are stored in its rows. ///
/// * for vectors, observations are stored in its components (thus are 1-dimensional). /// * For matrices, observations are stored in its rows.
/// * For vectors, observations are stored in its components (thus are 1-dimensional).
fn cov(&self) -> M; fn cov(&self) -> M;
} }
/// Trait for computing the covariance of a set of data. /// Trait for computing the covariance of a set of data.
pub trait Mean<N> { pub trait Mean<N> {
/// Computes the mean of the observations stored by `self`. /// Computes the mean of the observations stored by `self`.
/// * for matrices, observations are stored in its rows. ///
/// * for vectors, observations are stored in its components (thus are 1-dimensional). /// * For matrices, observations are stored in its rows.
/// * For vectors, observations are stored in its components (thus are 1-dimensional).
fn mean(&self) -> N; fn mean(&self) -> N;
} }

View File

@ -1,3 +1,5 @@
//! Traits giving structural informations on linear algebra objects or the space they live in.
use std::num::Zero; use std::num::Zero;
use std::vec::{VecIterator, VecMutIterator}; use std::vec::{VecIterator, VecMutIterator};
use traits::operations::{RMul, LMul, ScalarAdd, ScalarSub}; use traits::operations::{RMul, LMul, ScalarAdd, ScalarSub};

View File

@ -1,6 +1,6 @@
//! Vectors with dimensions known at compile-time. //! Vectors with dimensions known at compile-time.
#[doc(hidden)]; // we hide doc to not have to document the $trhs double dispatch trait. #[allow(missing_doc)]; // we allow missing to avoid having to document the vector components.
use std::cast; use std::cast;
use std::num::{Zero, One, Algebraic, Bounded}; use std::num::{Zero, One, Algebraic, Bounded};