File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Linear algebra protocol and extensions for the Vector struct.
44
55import Accelerate
66
7+ @_documentation ( visibility: private)
78public protocol Algebra {
89 static func dot( _ a: Vector < Self > , _ b: Vector < Self > ) -> Self
910 static func norm( _ a: Vector < Self > ) -> Self
@@ -14,6 +15,7 @@ public protocol Algebra {
1415 static func swapValues( a: inout Vector < Self > , b: inout Vector < Self > )
1516}
1617
18+ @_documentation ( visibility: private)
1719extension Int : Algebra {
1820
1921 public static func swapValues( a: inout Vector < Int > , b: inout Vector < Int > ) {
@@ -71,6 +73,7 @@ extension Int: Algebra {
7173 }
7274}
7375
76+ @_documentation ( visibility: private)
7477extension Float : Algebra {
7578
7679 public static func swapValues( a: inout Vector < Float > , b: inout Vector < Float > ) {
@@ -110,6 +113,7 @@ extension Float: Algebra {
110113 }
111114}
112115
116+ @_documentation ( visibility: private)
113117extension Double : Algebra {
114118
115119 public static func swapValues( a: inout Vector < Double > , b: inout Vector < Double > ) {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Arithmetic protocol and extensions for the Vector struct.
44
55import Accelerate
66
7+ @_documentation ( visibility: private)
78public protocol Arithmetic {
89 static func add( _ a: Vector < Self > , _ k: Self ) -> Vector < Self >
910 static func add( _ a: Vector < Self > , _ b: Vector < Self > ) -> Vector < Self >
@@ -17,6 +18,7 @@ public protocol Arithmetic {
1718 static func divide( _ a: Vector < Self > , _ b: Vector < Self > ) -> Vector < Self >
1819}
1920
21+ @_documentation ( visibility: private)
2022extension Int : Arithmetic {
2123
2224 public static func add( _ a: Vector < Int > , _ k: Int ) -> Vector < Int > {
@@ -100,6 +102,7 @@ extension Int: Arithmetic {
100102 }
101103}
102104
105+ @_documentation ( visibility: private)
103106extension Float : Arithmetic {
104107
105108 public static func add( _ a: Vector < Float > , _ k: Float ) -> Vector < Float > {
@@ -171,6 +174,7 @@ extension Float: Arithmetic {
171174 }
172175}
173176
177+ @_documentation ( visibility: private)
174178extension Double : Arithmetic {
175179
176180 public static func add( _ a: Vector < Double > , _ k: Double ) -> Vector < Double > {
Original file line number Diff line number Diff line change 1+ # Linear Algebra
2+
3+ Linear algebra vector operations.
4+
5+ ## Overview
6+
7+ Numerix implements linear algebra operations using the Accelerate framework and BLAS routines. See the home page of the documentation for more information about the supported BLAS routines.
8+
9+ ## Topics
10+
11+ - `` Vector/dot(_:) ``
12+ - `` Vector/norm() ``
13+ - `` Vector/scale(by:) ``
14+ - `` Vector/sum() ``
15+ - `` Vector/absoluteSum() ``
16+ - `` Vector/cumulativeSum() ``
Original file line number Diff line number Diff line change 1+ # Trigonometry
2+
3+ Trigonometic vector operations.
4+
5+ ## Overview
6+
7+ Numerix provides several element-wise trigometric functions for vectors. The Accelerate framework is utilized for efficient element-by-element vector operations.
8+
9+ ## Topics
10+
11+ - `` sin(_:) ``
12+ - `` cos(_:) ``
13+ - `` tan(_:) ``
Original file line number Diff line number Diff line change @@ -7,3 +7,6 @@ One-dimensional vector operations.
77This module provides the `` Vector `` structure for working with one-dimensional numerical data. Arithmetic and several linear algebra operations are supported. See the topics below for more details. Scalar values can be Float or Double and limited support is provided for Int values.
88
99## Topics
10+
11+ - < doc:LinearAlgebra >
12+ - < doc:Trigonometry >
Original file line number Diff line number Diff line change @@ -4,12 +4,14 @@ Vector extension for exponential functions.
44
55import Accelerate
66
7+ @_documentation ( visibility: private)
78public protocol Exponential {
89 static func exp( a: Vector < Self > ) -> Vector < Self >
910 static func exp2( a: Vector < Self > ) -> Vector < Self >
1011 static func expm1( a: Vector < Self > ) -> Vector < Self >
1112}
1213
14+ @_documentation ( visibility: private)
1315extension Float : Exponential {
1416 public static func exp( a: Vector < Float > ) -> Vector < Float > {
1517 var mat = Vector ( like: a)
@@ -30,6 +32,7 @@ extension Float: Exponential {
3032 }
3133}
3234
35+ @_documentation ( visibility: private)
3336extension Double : Exponential {
3437 public static func exp( a: Vector < Double > ) -> Vector < Double > {
3538 var mat = Vector ( like: a)
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Vector extension for logarithm functions.
44
55import Accelerate
66
7+ @_documentation ( visibility: private)
78public protocol Logarithm {
89 static func log( a: Vector < Self > ) -> Vector < Self >
910 static func log1p( a: Vector < Self > ) -> Vector < Self >
@@ -12,6 +13,7 @@ public protocol Logarithm {
1213 static func logb( a: Vector < Self > ) -> Vector < Self >
1314}
1415
16+ @_documentation ( visibility: private)
1517extension Float : Logarithm {
1618 public static func log( a: Vector < Float > ) -> Vector < Float > {
1719 var result = Vector ( like: a)
@@ -44,6 +46,7 @@ extension Float: Logarithm {
4446 }
4547}
4648
49+ @_documentation ( visibility: private)
4750extension Double : Logarithm {
4851 public static func log( a: Vector < Double > ) -> Vector < Double > {
4952 var result = Vector ( like: a)
Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ Vector extension for power functions.
44
55import Accelerate
66
7+ @_documentation ( visibility: private)
78public protocol Power {
89 static func power( a: Vector < Self > , exp: Self ) -> Vector < Self >
910 static func power( a: Vector < Self > , exp: [ Self ] ) -> Vector < Self >
1011}
1112
13+ @_documentation ( visibility: private)
1214extension Float : Power {
1315 public static func power( a: Vector < Float > , exp: Float ) -> Vector < Float > {
1416 let output = Vector ( like: a)
@@ -28,6 +30,7 @@ extension Float: Power {
2830 }
2931}
3032
33+ @_documentation ( visibility: private)
3134extension Double : Power {
3235 public static func power( a: Vector < Double > , exp: Double ) -> Vector < Double > {
3336 let output = Vector ( like: a)
Original file line number Diff line number Diff line change 44
55import Accelerate
66
7+ @_documentation ( visibility: private)
78public protocol RandomDistribution {
89 static func randomDist( size: Int , dist: Int ) -> Vector < Self >
910}
1011
12+ @_documentation ( visibility: private)
1113extension Float : RandomDistribution {
1214
1315 public static func randomDist( size: Int , dist: Int ) -> Vector < Float > {
@@ -25,6 +27,7 @@ extension Float: RandomDistribution {
2527 }
2628}
2729
30+ @_documentation ( visibility: private)
2831extension Double : RandomDistribution {
2932
3033 public static func randomDist( size: Int , dist: Int ) -> Vector < Double > {
Original file line number Diff line number Diff line change 44
55import Accelerate
66
7+ @_documentation ( visibility: private)
78public protocol Trigonometry {
89 static func sin( _ a: Vector < Self > ) -> Vector < Self >
910 static func cos( _ a: Vector < Self > ) -> Vector < Self >
1011 static func tan( _ a: Vector < Self > ) -> Vector < Self >
1112}
1213
14+ @_documentation ( visibility: private)
1315extension Float : Trigonometry {
1416
1517 public static func sin( _ a: Vector < Float > ) -> Vector < Float > {
@@ -31,6 +33,7 @@ extension Float: Trigonometry {
3133 }
3234}
3335
36+ @_documentation ( visibility: private)
3437extension Double : Trigonometry {
3538
3639 public static func sin( _ a: Vector < Double > ) -> Vector < Double > {
You can’t perform that action at this time.
0 commit comments