Skip to content

Commit

Permalink
Update for Xcode 7.3
Browse files Browse the repository at this point in the history
* Remove build warnings (typealias declared in protocol will be deprecated. var parameter will be deprecated).
* Update .travis.yml file.
  • Loading branch information
dboyliao authored and alejandro-isaza committed Apr 4, 2016
1 parent 245358f commit 915b7cb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
language: objective-c
xcode_workspace: Upsurge.xcworkspace
xcode_scheme: Upsurge OSX
osx_image: xcode7
osx_image: xcode7.3
12 changes: 8 additions & 4 deletions Source/1D/LinearOperators.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public func +=<ML: MutableLinearType where ML.Element == Double>(inout lhs: ML,
}
}

public func +<ML: LinearType where ML.Element == Double>(lhs: ML, var rhs: Double) -> ValueArray<Double> {
public func +<ML: LinearType where ML.Element == Double>(lhs: ML, rhs: Double) -> ValueArray<Double> {
var rhs = rhs
let results = ValueArray<Double>(count: lhs.count)
withPointer(lhs) { lhsp in
vDSP_vsaddD(lhsp + lhs.startIndex, lhs.step, &rhs, results.mutablePointer + results.startIndex, results.step, vDSP_Length(lhs.count))
Expand Down Expand Up @@ -132,7 +133,8 @@ public func /<ML: LinearType where ML.Element == Double>(lhs: ML, rhs: Double) -
return results
}

public func /<ML: LinearType where ML.Element == Double>(var lhs: Double, rhs: ML) -> ValueArray<Double> {
public func /<ML: LinearType where ML.Element == Double>(lhs: Double, rhs: ML) -> ValueArray<Double> {
var lhs = lhs
let results = ValueArray<Double>(count: rhs.count)
withPointer(rhs) { rhsp in
vDSP_svdivD(&lhs, rhsp + rhs.startIndex, rhs.step, results.mutablePointer + results.startIndex, results.step, vDSP_Length(rhs.count))
Expand All @@ -154,13 +156,15 @@ public func *<ML: LinearType, MR: LinearType where ML.Element == Double, MR.Elem
return results
}

public func *=<ML: MutableLinearType where ML.Element == Double>(inout lhs: ML, var rhs: Double) {
public func *=<ML: MutableLinearType where ML.Element == Double>(inout lhs: ML, rhs: Double) {
var rhs = rhs
withPointer(&lhs) { lhsp in
vDSP_vsmulD(lhsp + lhs.startIndex, lhs.step, &rhs, lhsp + lhs.startIndex, lhs.step, vDSP_Length(lhs.count))
}
}

public func *<ML: LinearType where ML.Element == Double>(lhs: ML, var rhs: Double) -> ValueArray<Double> {
public func *<ML: LinearType where ML.Element == Double>(lhs: ML, rhs: Double) -> ValueArray<Double> {
var rhs = rhs
let results = ValueArray<Double>(count: lhs.count)
withPointer(lhs) { lhsp in
vDSP_vsmulD(lhsp + lhs.startIndex, lhs.step, &rhs, results.mutablePointer + results.startIndex, results.step, vDSP_Length(lhs.count))
Expand Down
2 changes: 1 addition & 1 deletion Source/1D/LinearType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/// The `LinearType` protocol should be implemented by any collection that stores its values in a contiguous memory block. This is the building block for one-dimensional operations that are single-instruction, multiple-data (SIMD).
public protocol LinearType: CollectionType, TensorType {
typealias Element
associatedtype Element

/// The index of the first valid element
var startIndex: Int { get }
Expand Down
2 changes: 1 addition & 1 deletion Source/2D/QuadraticType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public enum QuadraticArrangement {
}

public protocol QuadraticType: TensorType {
typealias Element
associatedtype Element

/// The arrangement of rows and columns
var arrangement: QuadraticArrangement { get }
Expand Down
4 changes: 2 additions & 2 deletions Source/ND/TensorType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// THE SOFTWARE.

public protocol TensorType {
typealias Element
typealias Slice
associatedtype Element
associatedtype Slice

/// A description of the dimensions over which the TensorType spans
var span: Span { get }
Expand Down

0 comments on commit 915b7cb

Please sign in to comment.