Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SusanDoggie committed Sep 15, 2021
1 parent 4b6ab12 commit 5130096
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ let package = Package(
.library(name: "Doggie", targets: ["Doggie"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-numerics", from: "0.1.0"),
.package(url: "https://github.com/apple/swift-algorithms", from: "0.2.1"),
.package(url: "https://github.com/apple/swift-collections", from: "0.0.2"),
.package(url: "https://github.com/SusanDoggie/Float16", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-algorithms", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0"),
.package(url: "https://github.com/SusanDoggie/Float16", from: "1.1.0"),
.package(url: "https://github.com/SusanDoggie/brotli", from: "1.0.0"),
.package(url: "https://github.com/SusanDoggie/libwebp", from: "1.0.0"),
.package(url: "https://github.com/SusanDoggie/libjpeg", from: "1.0.0"),
Expand Down
6 changes: 3 additions & 3 deletions Sources/DoggieCore/Swift/CollectionExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,23 @@ extension MutableCollection {
extension Sequence {

@inlinable
public func appended(_ newElement: Element) -> Chain2<Self, CollectionOfOne<Element>> {
public func appended(_ newElement: Element) -> Chain2Sequence<Self, CollectionOfOne<Element>> {
return chain(self, CollectionOfOne(newElement))
}
}

extension Collection {

@inlinable
public func rotated(at index: Index) -> Chain2<SubSequence, SubSequence> {
public func rotated(at index: Index) -> Chain2Sequence<SubSequence, SubSequence> {
return chain(self.suffix(from: index), self.prefix(upTo: index))
}
}

extension Collection {

@inlinable
public func rotated(_ n: Int) -> Chain2<SubSequence, SubSequence> {
public func rotated(_ n: Int) -> Chain2Sequence<SubSequence, SubSequence> {
let count = self.count
if count == 0 {
return chain(self[...], self[...])
Expand Down
2 changes: 1 addition & 1 deletion Sources/DoggieGeometry/ShapeRegion/PathBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private let ShapeCacheInterscetionResultKey = "ShapeCacheInterscetionResultKey"

extension Collection {

func rotateZip() -> Zip2Sequence<Self, Chain2<SubSequence, SubSequence>> {
func rotateZip() -> Zip2Sequence<Self, Chain2Sequence<SubSequence, SubSequence>> {
return zip(self, self.rotated(1))
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/DoggieGeometry/ShapeRegion/ShapeRegion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ extension ShapeRegion.Solid {
return ShapeRegion.Solid(solid: solid.reversed(), holes: holes)
}

fileprivate func components(_ sign: FloatingPointSign) -> Chain2<CollectionOfOne<Shape.Component>, [Shape.Component]> {
fileprivate func components(_ sign: FloatingPointSign) -> Chain2Sequence<CollectionOfOne<Shape.Component>, [Shape.Component]> {
return chain(CollectionOfOne(solid.area.sign == sign ? solid : solid.reversed()), holes.components(sign == .plus ? .minus : .plus))
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/DoggieMath/Maths.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
//

@inlinable
public func FactorialList<T: UnsignedInteger>(_ n: T) -> ExclusiveReductions<T, LazySequence<Slice<ClosedRange<T>>>> {
public func FactorialList<T: UnsignedInteger>(_ n: T) -> ExclusiveReductionsSequence<LazySequence<Slice<ClosedRange<T>>>.Elements, T> {
return (0...n).dropFirst().lazy.reductions(1, *)
}
@inlinable
public func PermutationList<T: UnsignedInteger>(_ n: T) -> ExclusiveReductions<T, LazySequence<ReversedCollection<Slice<ClosedRange<T>>>>> {
public func PermutationList<T: UnsignedInteger>(_ n: T) -> ExclusiveReductionsSequence<LazySequence<ReversedCollection<Slice<ClosedRange<T>>>>.Elements, T> {
return (0...n).dropFirst().reversed().lazy.reductions(1, *)
}
@inlinable
public func CombinationList<T: UnsignedInteger>(_ n: T) -> LazyMapSequence<LazySequence<Zip2Sequence<ExclusiveReductions<T, LazySequence<ReversedCollection<Slice<ClosedRange<T>>>>>, ExclusiveReductions<T, LazySequence<Slice<ClosedRange<T>>>>>>.Elements, T> where T.Stride : SignedInteger {
public func CombinationList<T: UnsignedInteger>(_ n: T) -> LazyMapSequence<LazySequence<Zip2Sequence<ExclusiveReductionsSequence<ReversedCollection<Slice<ClosedRange<T>>>, T>, ExclusiveReductionsSequence<Slice<ClosedRange<T>>, T>>>.Elements, T> where T.Stride : SignedInteger {
return zip(PermutationList(n), FactorialList(n)).lazy.map(/)
}

Expand Down

0 comments on commit 5130096

Please sign in to comment.