/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */ /* $Id: vctRandomFixedSizeVector.h,v 1.2 2007/04/26 19:33:58 anton Exp $ Author(s): Anton Deguet Created on: 2007-02-11 (C) Copyright 2003-2007 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst license - do not edit --- This software is provided "as is" under an open source license, with no warranty. The complete license can be found in license.txt and http://www.cisst.org/cisst/license.txt. --- end cisst license --- */ #ifndef _vctRandomFixedSizeVector_h #define _vctRandomFixedSizeVector_h #include #include #include #include /*! Define the global function vctRandom to initialize a fixed size vector with random elements. The function takes a range from which to choose random elements. \note The function uses the global instance of cmnRandomSequence to extract random values. As we have a vague plan to allow for multiple random sequence objects to coexist, these interfaces may need to be changed. */ template void vctRandom(vctFixedSizeVectorBase<_size, _stride, _elementType, _dataPtrType> & vector, const _elementType min, const _elementType max) { cmnRandomSequence & randomSequence = cmnRandomSequence::GetInstance(); const unsigned int size = vector.size(); unsigned int index; for (index = 0; index < size; ++index) { randomSequence.ExtractRandomValue(min, max, vector[index]); } } #endif // _vctRandomFixedSizeVector_h // **************************************************************************** // Change History // **************************************************************************** // // $Log: vctRandomFixedSizeVector.h,v $ // Revision 1.2 2007/04/26 19:33:58 anton // All files in libraries: Applied new license text, separate copyright and // updated dates, added standard header where missing. // // Revision 1.1 2007/02/12 03:23:37 anton // vctRandom: Split in multiple files to avoid too many inclusions and dependencies // (leads to longer compilation times, see #264). // // // ****************************************************************************