cisst-saw
Loading...
Searching...
No Matches
vctRandomDynamicMatrix.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-2026 Johns Hopkins University (JHU), All Rights Reserved.
9
10--- begin cisst license - do not edit ---
11
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19#pragma once
20#ifndef _vctRandomDynamicMatrix_h
21#define _vctRandomDynamicMatrix_h
22
27
30
33
46template <class _matrixOwnerType, typename _elementType>
50{
53 const typename MatrixType::iterator end = matrix.end();
54 typename MatrixType::iterator iter;
55 for (iter = matrix.begin(); iter != end; ++iter) {
56 randomSequence.ExtractRandomValue(min, max,
57 *iter);
58 }
59}
60
61template <typename _elementType>
65{
66 typename vctDynamicMatrixRef<_elementType>::BaseType & base = matrix;
67 vctRandom(base, min, max);
68}
69
70#endif // _vctRandomDynamicMatrix_h
Provide an interface to a reproducible random sequence.
Definition cmnRandomSequence.h:67
static cmnRandomSequence & GetInstance(void)
Definition cmnRandomSequence.h:138
void ExtractRandomValue(_valueType &result)
Definition vctDynamicMatrixBase.h:43
iterator begin(void)
Definition vctDynamicMatrixBase.h:77
iterator end(void)
Definition vctDynamicMatrixBase.h:83
Dynamic matrix referencing existing memory.
Definition vctDynamicMatrixRef.h:75
vctDynamicMatrixBase< vctDynamicMatrixRefOwner< _elementType >, _elementType > BaseType
Definition vctDynamicMatrixRef.h:84
Portability across compilers and operating systems tools.
Randomization utilities for general use in CISST applications.
void vctRandom(vctDynamicMatrixBase< _matrixOwnerType, _elementType > &matrix, const typename vctDynamicMatrixBase< _matrixOwnerType, _elementType >::value_type min, const typename vctDynamicMatrixBase< _matrixOwnerType, _elementType >::value_type max)
Definition vctRandomDynamicMatrix.h:47
const_iterator end(void) const
Definition vctDynamicConstMatrixBase.h:209
Declaration of vctDynamicMatrix.
Forward declarations and #define for cisstVector.