@@ -12,95 +12,11 @@ Benchmarks.StringToBInt()
1212//Benchmarks.permutationsAndCombinations()
1313Benchmarks . multiplicationBalanced ( )
1414Benchmarks . multiplicationUnbalanced ( )
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26- //public struct PixelData {
27- // var a:UInt8 = 255
28- // var r:UInt8
29- // var g:UInt8
30- // var b:UInt8
31- //}
32- //
33- //private let rgbColorSpace = CGColorSpaceCreateDeviceRGB()
34- //private let bitmapInfo:CGBitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedFirst.rawValue)
35- //
36- //public func imageFromARGB32Bitmap(pixels:[PixelData], width: Int, height: Int) -> CGImage {
37- // let bitsPerComponent: Int = 8
38- // let bitsPerPixel: Int = 32
39- //
40- // assert(pixels.count == Int(width * height))
41- //
42- // var data = pixels // Copy to mutable []
43- // let providerRef = CGDataProvider(
44- // data: NSData(bytes: &data, length: data.count * MemoryLayout<PixelData>.size)
45- // )
46- //
47- // let cgim = CGImage(
48- // width: width,
49- // height: height,
50- // bitsPerComponent: bitsPerComponent,
51- // bitsPerPixel: bitsPerPixel,
52- // bytesPerRow: width * MemoryLayout<PixelData>.size,
53- // space: rgbColorSpace,
54- // bitmapInfo: bitmapInfo,
55- // provider: providerRef!,
56- // decode: nil,
57- // shouldInterpolate: true,
58- // intent: CGColorRenderingIntent.defaultIntent
59- // )
60- // return cgim!
61- //}
62- //
63- //
64- //@discardableResult
65- //func writeCGImage(_ image: CGImage, to destinationURL: URL) -> Bool {
66- // guard let destination = CGImageDestinationCreateWithURL(destinationURL as CFURL, kUTTypePNG, 1, nil) else {
67- // print("ERR")
68- // return false
69- //
70- // }
71- // CGImageDestinationAddImage(destination, image, nil)
72- // return CGImageDestinationFinalize(destination)
73- //}
74- //
75- //func makeAndSave()
76- //{
77- // let dimension = 4000
78- //
79- //
80- // var pixels = [PixelData]()
81- //
82- // for i in 1...(dimension * dimension)
83- // {
84- // if math.isPrime(i)
85- // {
86- // pixels.append(PixelData(a: 255, r: 0, g: 0, b: 0))
87- // }
88- // else
89- // {
90- // pixels.append(PixelData(a: 0, r: 255, g: 255, b: 255))
91- // }
92- // }
93- //
94- //
95- // let img = imageFromARGB32Bitmap(pixels: pixels, width: dimension, height: dimension)
96- //
97- // let writeURL = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).first!.appendingPathComponent("name.png")
98- //
99- // writeCGImage(img, to: writeURL)
100- //}
101- //
102- //benchmarkAndPrint(title: "")
103- //{
104- // makeAndSave()
105- //}
106-
15+ Benchmarks . divisionBalanced ( )
16+ Benchmarks . divisionUnbalanced ( )
17+ Benchmarks . gcdLargeNumbers ( )
18+ Benchmarks . modularExponentiation ( )
19+ Benchmarks . BDoubleDivision ( )
20+ Benchmarks . BDoubleDecimalExpansion ( )
21+ Benchmarks . radixConversion ( )
22+ Benchmarks . bitShifting ( )
0 commit comments