- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Random/3.3/NormalDistributedRandom.cs
r4477 r4722 450 450 451 451 /// <summary> 452 /// Used by HeuristicLab.Persistence to initialize new instances during deserialization. 453 /// </summary> 454 /// <param name="deserializing">true, if the constructor is called during deserialization.</param> 455 [StorableConstructor] 456 private NormalDistributedRandom(bool deserializing) : base(deserializing) { } 457 458 /// <summary> 459 /// Initializes a new instance from an existing one (copy constructor). 460 /// </summary> 461 /// <param name="original">The original <see cref="NormalDistributedRandom"/> instance which is used to initialize the new instance.</param> 462 /// <param name="cloner">A <see cref="Cloner"/> which is used to track all already cloned objects in order to avoid cycles.</param> 463 private NormalDistributedRandom(NormalDistributedRandom original, Cloner cloner) 464 : base(original, cloner) { 465 uniform = cloner.Clone(original.uniform); 466 mu = original.mu; 467 sigma = original.sigma; 468 } 469 470 /// <summary> 452 471 /// Initializes a new instance of <see cref="NormalDistributedRandom"/> with µ = 0 and sigma = 1 453 472 /// and a new random number generator. … … 471 490 this.uniform = uniformRandom; 472 491 } 473 /// <summary>474 /// Used by HeuristicLab.Persistence to initialize new instances during deserialization.475 /// </summary>476 /// <param name="deserializing">true, if the constructor is called during deserialization.</param>477 [StorableConstructor]478 private NormalDistributedRandom(bool deserializing) : base(deserializing) { }479 492 480 493 #region IRandom Members … … 529 542 /// <returns>The cloned object as <see cref="NormalDistributedRandom"/>.</returns> 530 543 public override IDeepCloneable Clone(Cloner cloner) { 531 NormalDistributedRandom clone = (NormalDistributedRandom)base.Clone(cloner); 532 clone.uniform = (IRandom)cloner.Clone(uniform); 533 clone.mu = mu; 534 clone.sigma = sigma; 535 return clone; 544 return new NormalDistributedRandom(this, cloner); 536 545 } 537 546
Note: See TracChangeset
for help on using the changeset viewer.