 |
- Timestamp:
- 10/27/10 09:44:08
(2 years ago)
- Author:
- fawzi
- Message:
* fixes bugs in uniformR2Distribution
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5539 |
r5588 |
|
| 979 | 979 | RandomG r; |
|---|
| 980 | 980 | /// initializes the probability distribution |
|---|
| 981 | | static UniformRDistribution create(RandomG r,T from, T to){ |
|---|
| 982 | | UniformRDistribution res; |
|---|
| | 981 | static UniformR2Distribution create(RandomG r,T from, T to){ |
|---|
| | 982 | UniformR2Distribution res; |
|---|
| 983 | 983 | res.r=r; |
|---|
| 984 | 984 | res.from=from; |
|---|
| … | … | |
| 987 | 987 | } |
|---|
| 988 | 988 | /// chainable call style initialization of variables (thorugh a call to randomize) |
|---|
| 989 | | UniformRDistribution opCall(U,S...)(ref U a,S args){ |
|---|
| | 989 | UniformR2Distribution opCall(U,S...)(ref U a,S args){ |
|---|
| 990 | 990 | randomize(a,args); |
|---|
| 991 | 991 | return *this; |
|---|
| … | … | |
| 996 | 996 | } |
|---|
| 997 | 997 | /// initialize a |
|---|
| 998 | | U randomize(ref U a){ |
|---|
| | 998 | U randomize(U)(ref U a){ |
|---|
| 999 | 999 | return r.randomizeUniformR2!(U,T,T,boundCheck)(a,from,to); |
|---|
| 1000 | 1000 | } |
|---|
| … | … | |
| 1141 | 1141 | return UniformRSymmDistribution!(T,false,isFloat!(T)).create(this,to); |
|---|
| 1142 | 1142 | } |
|---|
| 1143 | | /// uniform distribution [from;to) fro ints and (from;to) for reals |
|---|
| | 1143 | /// uniform distribution [from;to) for ints and (from;to) for reals |
|---|
| 1144 | 1144 | UniformR2Distribution!(T,true) uniformR2D(T)(T from, T to){ |
|---|
| 1145 | 1145 | return UniformR2Distribution!(T,true).create(this,from,to); |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2012 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic