-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed InSynth core for dealing with HOFs, restructured reconstruction…
… code and corresponding tests
- Loading branch information
Showing
20 changed files
with
7,825 additions
and
384 deletions.
There are no files selected for viewing
Binary file modified
BIN
+11.5 KB
(100%)
ch.epfl.insynth.build/ch.epfl.insynth.library/ch.epfl.insynth.library_2.10-1.3.jar
Binary file not shown.
322 changes: 163 additions & 159 deletions
322
....build/ch.epfl.insynth.tests/src/ch/epfl/insynth/reconstruction/CodeGenerationTests.scala
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
ch.epfl.insynth.build/ch.epfl.insynth/src/ch/epfl/insynth/Config.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 0 additions & 76 deletions
76
ch.epfl.insynth.build/ch.epfl.insynth/src/ch/epfl/insynth/reconstruction/Config.scala
This file was deleted.
Oops, something went wrong.
88 changes: 44 additions & 44 deletions
88
...synth.build/ch.epfl.insynth/src/ch/epfl/insynth/reconstruction/OrderedStreamFactory.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
package ch.epfl.insynth.reconstruction | ||
|
||
import insynth.reconstruction.stream._ | ||
import insynth.streams._ | ||
import insynth.streams.ordered._ | ||
|
||
import insynth.util.logging.HasLogger | ||
|
||
class OrderedStreamFactory extends StreamFactory[Node] with HasLogger { | ||
|
||
override def makeEmptyStreamable = Empty | ||
|
||
override def makeSingleton[U <: Node](element: U) = Singleton(element) | ||
|
||
override def makeSingletonList[U <: Node](element: List[U]) = Singleton(element) | ||
|
||
// override def makeSingleStream[U <: T](stream: => Stream[U], isInfiniteFlag: Boolean) = | ||
// SingleStream(stream, isInfiniteFlag) | ||
|
||
override def makeUnaryStream[X, Y <: Node](streamable: Streamable[X], modify: X => Y, modifyVal: Option[Int => Int] = None) = | ||
UnaryStream(streamable.asInstanceOf[OrderedStreamable[X]], modify, modifyVal) | ||
|
||
override def makeUnaryStreamList[X, Y <: Node](streamable: Streamable[X], modify: X => List[Y]) = | ||
UnaryStream(streamable.asInstanceOf[OrderedStreamable[X]], modify) | ||
|
||
override def makeBinaryStream[X, Y, Z <: Node](s1: Streamable[X], s2: Streamable[Y])(combine: (X, Y) => List[Z]) = | ||
BinaryStream(s1.asInstanceOf[OrderedStreamable[X]], s2.asInstanceOf[OrderedStreamable[Y]])(combine) | ||
|
||
override def makeRoundRobbin[U <: Node](streams: Seq[Streamable[U]]) = | ||
RoundRobbin(streams.asInstanceOf[Seq[OrderedStreamable[Node]]]) | ||
|
||
override def makeLazyRoundRobbin[U <: Node](initStreams: List[Streamable[U]]) = | ||
LazyRoundRobbin[Node](initStreams.asInstanceOf[List[OrderedStreamable[Node]]]) | ||
|
||
def getFinalStream(streamable: Streamable[Node]) = | ||
streamable match { | ||
case os: OrderedStreamable[_] => | ||
fine("returning ordered streamable") | ||
os.getStream zip os.getValues.map(_.toFloat) | ||
case _: Streamable[_] => | ||
fine("returning unordered streamable") | ||
streamable.getStream zip Stream.continually(0f) | ||
} | ||
} | ||
//package ch.epfl.insynth.reconstruction | ||
// | ||
//import insynth.reconstruction.stream._ | ||
//import insynth.streams._ | ||
//import insynth.streams.ordered._ | ||
// | ||
//import insynth.util.logging.HasLogger | ||
// | ||
//class OrderedStreamFactory extends StreamFactory[Node] with HasLogger { | ||
// | ||
// override def makeEmptyStreamable = Empty | ||
// | ||
// override def makeSingleton[U <: Node](element: U) = Singleton(element) | ||
// | ||
// override def makeSingletonList[U <: Node](element: List[U]) = Singleton(element) | ||
// | ||
//// override def makeSingleStream[U <: T](stream: => Stream[U], isInfiniteFlag: Boolean) = | ||
//// SingleStream(stream, isInfiniteFlag) | ||
// | ||
// override def makeUnaryStream[X, Y <: Node](streamable: Streamable[X], modify: X => Y, modifyVal: Option[Int => Int] = None) = | ||
// UnaryStream(streamable.asInstanceOf[OrderedStreamable[X]], modify, modifyVal) | ||
// | ||
// override def makeUnaryStreamList[X, Y <: Node](streamable: Streamable[X], modify: X => List[Y]) = | ||
// UnaryStream(streamable.asInstanceOf[OrderedStreamable[X]], modify) | ||
// | ||
// override def makeBinaryStream[X, Y, Z <: Node](s1: Streamable[X], s2: Streamable[Y])(combine: (X, Y) => List[Z]) = | ||
// BinaryStream(s1.asInstanceOf[OrderedStreamable[X]], s2.asInstanceOf[OrderedStreamable[Y]])(combine) | ||
// | ||
// override def makeRoundRobbin[U <: Node](streams: Seq[Streamable[U]]) = | ||
// RoundRobbin(streams.asInstanceOf[Seq[OrderedStreamable[Node]]]) | ||
// | ||
// override def makeLazyRoundRobbin[U <: Node](initStreams: List[Streamable[U]]) = | ||
// LazyRoundRobbin[Node](initStreams.asInstanceOf[List[OrderedStreamable[Node]]]) | ||
// | ||
// def getFinalStream(streamable: Streamable[Node]) = | ||
// streamable match { | ||
// case os: OrderedStreamable[_] => | ||
// fine("returning ordered streamable") | ||
// os.getStream zip os.getValues.map(_.toFloat) | ||
// case _: Streamable[_] => | ||
// fine("returning unordered streamable") | ||
// streamable.getStream zip Stream.continually(0f) | ||
// } | ||
//} |
Oops, something went wrong.