cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vctRandomFixedSizeVector.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5  Author(s): Anton Deguet
6  Created on: 2007-02-11
7 
8  (C) Copyright 2003-2014 Johns Hopkins University (JHU), All Rights Reserved.
9 
10 --- begin cisst license - do not edit ---
11 
12 This software is provided "as is" under an open source license, with
13 no warranty. The complete license can be found in license.txt and
14 http://www.cisst.org/cisst/license.txt.
15 
16 --- end cisst license ---
17 */
18 
19 #pragma once
20 #ifndef _vctRandomFixedSizeVector_h
21 #define _vctRandomFixedSizeVector_h
22 
30 
33 
46 template <vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType>
48  const _elementType min,
49  const _elementType max) {
52  const typename VectorType::iterator end = vector.end();
53  typename VectorType::iterator iter;
54  for (iter = vector.begin(); iter != end; ++iter) {
55  randomSequence.ExtractRandomValue(min, max,
56  *iter);
57  }
58 }
59 
60 #endif // _vctRandomFixedSizeVector_h
Portability across compilers and operating systems tools.
Forward declarations and #define for cisstVector.
void ExtractRandomValue(_valueType &result)
iterator begin(void)
Definition: vctFixedSizeVectorBase.h:117
void vctRandom(vctFixedSizeVectorBase< _size, _stride, _elementType, _dataPtrType > &vector, const _elementType min, const _elementType max)
Definition: vctRandomFixedSizeVector.h:47
static cmnRandomSequence & GetInstance(void)
Definition: cmnRandomSequence.h:138
iterator end(void)
Definition: vctFixedSizeVectorBase.h:130
Declaration of vctFixedSizeVector.
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeVectorBase.h:76
Randomization utilities for general use in CISST applications.
Provide an interface to a reproducible random sequence.
Definition: cmnRandomSequence.h:66