Skip to content

Commit ff88fb2

Browse files
Clean Mathematics-Sets package
1 parent afe9dd8 commit ff88fb2

File tree

10 files changed

+42
-15
lines changed

10 files changed

+42
-15
lines changed

Mathematics-Groups/QuotientGroup.class.st

+9-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,15 @@ QuotientGroup >> relation [
105105
| inv op |
106106
op := self base operation.
107107
inv := self base inverseMap.
108-
^ EquivalenceRelation on: self base evaluating: [:x :y| self relations includes: (op value: {x. inv value: y})]
108+
^ EquivalenceRelation
109+
on: self base
110+
evaluating: [ :x :y |
111+
self relations
112+
includes:
113+
(op
114+
value:
115+
{x.
116+
(inv value: y)}) ]
109117
]
110118

111119
{ #category : #accessing }

Mathematics-Kernel-Support/Aleph.class.st

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ Aleph >> order: anInteger [
7777
{ #category : #printing }
7878
Aleph >> printOn: aStream [
7979
aStream
80-
nextPutAll: 'aleph';
81-
nextPutAll: order printString sub
80+
nextPutAll: 'Aleph-';
81+
nextPutAll: order asString
8282
]
8383

8484
{ #category : #arithmetic }

Mathematics-Kernel/Domain.class.st

+9-3
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,11 @@ Domain >> , aDomain [
168168
{ #category : #operations }
169169
Domain >> / anEquivalenceRelation [
170170
"Answer the categorical quotient of the receiver by an equivalence relation."
171+
171172
| relation |
172-
relation := anEquivalenceRelation isBlock ifTrue: [EquivalenceRelation on: self evaluating: anEquivalenceRelation] ifFalse: [anEquivalenceRelation].
173+
relation := anEquivalenceRelation isBlock
174+
ifTrue: [ EquivalenceRelation on: self evaluating: anEquivalenceRelation ]
175+
ifFalse: [ anEquivalenceRelation ].
173176
^ QuotientSet mod: relation
174177
]
175178

@@ -723,7 +726,7 @@ Domain >> product: aBlock [
723726

724727
{ #category : #properties }
725728
Domain >> properties [
726-
^ properties ifNil: [properties := IdentityDictionary new]
729+
^ properties ifNil: [ properties := IdentityDictionary new ]
727730
]
728731

729732
{ #category : #properties }
@@ -763,7 +766,10 @@ Domain >> raisedTo: anInteger [
763766
Domain >> select: aBlock [
764767
| elements |
765768
elements := Set new.
766-
self do: [:each| (aBlock value: each) ifTrue: [elements add: each]].
769+
self
770+
do: [ :each |
771+
(aBlock value: each)
772+
ifTrue: [ elements add: each ] ].
767773
^ elements as: Domain
768774
]
769775

Mathematics-Kernel/Function.class.st

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ Function class >> example3Frobenius1 [
7878
{ #category : #examples }
7979
Function class >> example3Frobenius2 [
8080
"The Frobenius ring homomorphism defined by a polynomial."
81+
8182
| R x |
8283
R := ZZ / 6.
8384
x := R polynomials x.
84-
^ R endomorphisms evaluating: x raiseTo: 6
85+
^ R endomorphisms evaluating: (x raisedTo: 6)
8586
]
8687

8788
{ #category : #'instance creation' }

Mathematics-Modules-Free/QuotientSpace.class.st

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ QuotientSpace >> rank [
9494

9595
{ #category : #accessing }
9696
QuotientSpace >> relation [
97-
^ EquivalenceRelation on: self base evaluating: [:x :y| self relations includes: x - y]
97+
^ EquivalenceRelation
98+
on: self base
99+
evaluating: [ :x :y | self relations includes: x - y ]
98100
]
99101

100102
{ #category : #accessing }

Mathematics-Modules/QuotientModule.class.st

+3-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ QuotientModule >> projection [
121121

122122
{ #category : #accessing }
123123
QuotientModule >> relation [
124-
^ EquivalenceRelation on: self base evaluating: [:x :y| self relations includes: x - y]
124+
^ EquivalenceRelation
125+
on: self base
126+
evaluating: [ :x :y | self relations includes: x - y ]
125127
]
126128

127129
{ #category : #accessing }

Mathematics-Rings/QuotientRing.class.st

+3-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ QuotientRing >> projection [
254254

255255
{ #category : #accessing }
256256
QuotientRing >> relation [
257-
^ EquivalenceRelation on: self base evaluating: [:a :b| self relations includes: a - b]
257+
^ EquivalenceRelation
258+
on: self base
259+
evaluating: [ :a :b | self relations includes: a - b ]
258260
]
259261

260262
{ #category : #accessing }

Mathematics-Sets/CartesianProduct.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ CartesianProduct >> at: anInteger [
5757

5858
{ #category : #random }
5959
CartesianProduct >> atRandom: aRandom [
60-
^ components collect: [:each| each atRandom: aRandom]
60+
^ components collect: [ :each | each atRandom: aRandom ]
6161
]
6262

6363
{ #category : #random }
@@ -120,7 +120,8 @@ CartesianProduct >> projection: i [
120120

121121
{ #category : #accessing }
122122
CartesianProduct >> size [
123-
^ components product: [:each| each size]
123+
^ (components collect: [:each | each size])
124+
fold: [ :a :b | a * b ]
124125
]
125126

126127
{ #category : #enumerating }

Mathematics-Sets/EquivalenceRelation.class.st

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ Class {
1717

1818
{ #category : #'instance creation' }
1919
EquivalenceRelation class >> on: aDomain evaluating: aBlock [
20-
^ self new domain: aDomain; block: aBlock
20+
^ self new
21+
domain: aDomain;
22+
block: aBlock
2123
]
2224

2325
{ #category : #'accessing-private' }

Mathematics-Sets/QuotientSet.class.st

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ QuotientSet >> isQuotient [
3434

3535
{ #category : #printing }
3636
QuotientSet >> printOn: aStream [
37-
aStream print: self relation domain; nextPut: $/; print: self relation
38-
" | domain |
37+
aStream
38+
print: self relation domain;
39+
nextPut: $/;
40+
print: self relation
41+
" | domain |
3942
domain := self relation domain.
4043
(domain printString allSatisfy: [:each|each isAlphaNumeric])
4144
ifTrue: [aStream print: domain]

0 commit comments

Comments
 (0)