Skip to content

Latest commit

 

History

History
110 lines (89 loc) · 3.48 KB

README.md

File metadata and controls

110 lines (89 loc) · 3.48 KB

MooseAlgos

Moose Algos contains generic libraries for various analysis algorithms.

Install MooseAlgo

To install MooseAlgo on your Pharo image you can just execute the following script:

Metacello new
    githubUser: 'moosetechnology' project: 'MooseAlgos' commitish: 'master' path: 'src';
    baseline: 'MooseAlgos';
    load

To add MooseAlgo to your baseline just add this:

    spec
    	baseline: 'MooseAlgos'
    	with: [ spec repository: 'github://moosetechnology/MooseAlgos:master/src' ]

Note that you can replace the #master by another branch as #development or a tag as #v1.0.0, #v1.? or #v1.2.? .

Graph algorithms

Example:

dijkstra := MalDijkstra new.
nodes := $a to: $h.
edges := #(($a $b) ($b $a) ($b $c) ($b $d) ($c $d) ($c $f) 
           ($d $b) ($d $e) ($e $a) ($f $g) ($g $h) ($h $g)).
dijkstra nodes: nodes.
dijkstra edges: edges from: #first to: #second.
dijkstra runFrom: $a to: $h

Clustering

see https://en.wikipedia.org/wiki/Hierarchical_clustering

Example:

input := #(#(1 2 3 5) #(11 12 15) #(21 22 23 25) #(31 32 35) #(41 42 43 45 47)).
clusty := MalClusterEngine with: input flatten shuffle.
clusty hierarchicalClusteringUsing: #centroid.
clusters := clusty dendrogram breakInto: 5.

Word compacting

Example:

(MalKontractor reduce: 'Hello' upTo: 3) >>> 'Hlo'

Latice

Example

data := #(#(#Cat #(#fourlegs #hair)) 
  #(#Dog #(#smart #fourlegs #hair)) 
  #(#Dolphin #(#smart #marine)) 
  #(#Gibbon #(#hair #smart #thumbed)) 
  #(#Man #(#smart #thumbed)) 
  #(#Whale #(#smart #marine))).
formalContext := MalFormalContext new.
formalContext with: data using: #first using: #last.
lattice := MalLattice on: formalContext.
patterns := MalLatticePatterns on: lattice.
patterns grey "
	N {{#Dog, #Dolphin, #Gibbon, #Man, #Whale}, {#smart}} 
	N {{#Cat, #Dog, #Gibbon}, {#hair}}"

Linear algebra

  • operations with matrices

Version management

This project use semantic versionning to define the releases. This mean that each stable release of the project will get associate a version number of the form vX.Y.Z.

  • X define the major version number
  • Y define the minor version number
  • Z define the patch version number

When a release contains only bug fixes, the patch number increase. When the release contains new features backward compatibles, the minor version increase. When the release contains breaking changes, the major version increase.

Thus, it should be safe to depend on a fixed major version and moving minor version of this project.