Changeset 16692 for branches/2521_ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs
- Timestamp:
- 03/18/19 17:24:30 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs
r13361 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 45 46 array[i] = elements[i]; 46 47 } 48 public RealVector(RealVector other) : this(other.array) { } 47 49 48 50 public override IDeepCloneable Clone(Cloner cloner) { … … 78 80 } 79 81 82 public double DotProduct(RealVector other) { 83 if (other.Length != Length) throw new ArgumentException("Vectors are of unequal length."); 84 var dotProd = 0.0; 85 for (var i = 0; i < Length; i++) 86 dotProd += this[i] * other[i]; 87 return dotProd; 88 } 80 89 } 81 90 }
Note: See TracChangeset
for help on using the changeset viewer.