(int count, Random rand)
| 207 | } |
| 208 | |
| 209 | public List<Vec> sample(int count, Random rand) |
| 210 | { |
| 211 | List<Vec> samples = new ArrayList<Vec>(count); |
| 212 | Vec Z = new DenseVector(L.rows()); |
| 213 | |
| 214 | for(int i = 0; i < count; i++) |
| 215 | { |
| 216 | for(int j = 0; j < Z.length(); j++) |
| 217 | Z.set(j, rand.nextGaussian()); |
| 218 | Vec sample = L.multiply(Z); |
| 219 | sample.mutableAdd(mean); |
| 220 | samples.add(sample); |
| 221 | } |
| 222 | |
| 223 | return samples; |
| 224 | } |
| 225 | } |