graphically
The idea is to create a graphical editor for xml and processDefiniton
of Jbpm.
yuki programming - Rem tene, verba sequentur
Pubblicato da koteth 0 commenti
This is my first try to write a wavelet(ondine in Italian) transform in Scala.
Naturally i've choose Haar wavelet transform, the simplest!
This is the core of the transformation:
def waveletCalc( values: List[Double] ):List[List[Double]]=
haarCalc( values , List( ) ).reverse
def haarCalc( vals: List[Double], cc: List[List[Double]] )
:List[List[Double]] =
vals.length / 2 match {
case 1 => cc ::: List( List((vals(0) - vals(1) ) / 2 ) ,
List(( vals(0) + vals(1) ) / 2 ))
case _ => haarCalc( vals.indices.dropRight(vals.length/2)
.map(_*2).map(el=>(vals(el) + vals(el+1))/2),
cc ::: List( vals.indices.dropRight(
vals.length/2).map(2*_).map(el=>
(vals (el) - vals(el + 1))/2)))
}
Pubblicato da koteth 0 commenti
Today I started to write a class in Scala to represent a group (in the mathematical sense).
To test closure, i.e.:
the code I wrote is:
def closure( ): Boolean =
elements.forall(
el => elements.forall(
el2 => elements.exists(
el2.*(el, this).name == _.name ) ) )
el2.*(el, this)
def *( b : groupElement ,group: genericGroup ) : groupElement
Pubblicato da koteth 1 commenti
Pubblicato da koteth 1 commenti
Fast Fourier transform in Scala
http://sites.google.com/site/snakelemma/snippets/fftShort.scala?attredirects=0
Pubblicato da koteth 0 commenti
simple Complex number class in Scala programming language
http://sites.google.com/site/snakelemma/snippets/complx.scala?attredirects=0
Pubblicato da koteth 0 commenti
def showRow(arra: Array[int], molt: int, mod: int ,unitari : boolean ):Array[int] = {
val a2 = arra.map( s => ( s * molt ) % mod )
if ( unitari )
println ( a2.map( s => if ( s == 1 s == ( mod -1 ) ) 1 else 0 ).toString )
else
println( a2.toString )
a2
}
def shoMatr( mod: int , unitari : boolean ) {
println( if ( unitari ) "elementi unitari" else "tabella moltiplicativa" )
val array = new Array[int]( mod - 1 ).indices.map( s => s + 1 )
array.foreach( p => showRow( array , ( array indexOf p ) + 1 , mod , unitari ) )
}
Pubblicato da koteth 0 commenti