/// <summary> /// Create a OclBruteForce Matcher using the specific distance type /// </summary> /// <param name="distanceType">The distance type</param> public OclBruteForceMatcher(DistanceType distanceType) { if (distanceType == DistanceType.Hamming) { if (typeof(T) != typeof(byte)) { throw new ArgumentException("Hamming distance type requires model descriptor to be Matrix<Byte>"); } } if (typeof(T) != typeof(byte) && typeof(T) != typeof(float)) { throw new NotImplementedException(String.Format("Data type of {0} is not supported", typeof(T).ToString())); } switch (distanceType) { case (DistanceType.Hamming): _distanceType = OclMatcherDistanceType.HammingDist; break; case (DistanceType.L1): _distanceType = OclMatcherDistanceType.L1Dist; break; case (DistanceType.L2): _distanceType = OclMatcherDistanceType.L2Dist; break; default: throw new NotImplementedException(String.Format("Distance type of {0} is not implemented in GPU.", distanceType.ToString())); } _ptr = OclInvoke.oclBruteForceMatcherCreate(_distanceType); }