Hi
I have across a Scala numerical library called Scalala[] with plotting capabilities.
I plan to experiment using this along with OptiML to make some simple data plots. So far, I have managed to compile Scalala and modified OptiML build settings to take Scalala as a library dependency.Running sbt update on OptiML after this works without errors.
Now, I am attempting to test this setup with a simple plotting code-snippet from Scalala, now wrapped inside an OptiML application.
// OptiML includes
import optiml.library._
import optiml.shared._
import optiml.compiler._
// Scalala includes
import scalala.scalar._;
import scalala.tensor.::;
import scalala.tensor.mutable._;
import scalala.tensor.dense._;
import scalala.tensor.sparse._;
import scalala.library.Library._;
import scalala.library.LinearAlgebra._;
import scalala.library.Statistics._;
import scalala.library.Plotting._;
import scalala.operators.Implicits._;
object MyScalalaInterpreter extends OptiMLApplicationInterpreter with MyScalala
object MyScalalaCompiler extends OptiMLApplicationCompiler with MyScalala
trait MyScalala extends OptiMLApplication
{
def main =
{
print("Hello! This is my first OptiML Application :)\n")
val x = DenseVector.range(0,100) / 100.0;
plot.hold = true
plot(x, x :^ 2)
plot(x, x :^ 3, '.')
xlabel("x axis")
ylabel("y axis")
saveas("lines.png") // save current figure as a .png
}
}
I cannot successfully compile this code.
In principle, before dealing with the error messages I am getting, should this OptiML-Scalala arrangement work?
Please advise.
[1]
https://github.com/scalala/Scalala
--
Khobatha Setetemela
Software Defined Radio Group (SDRG)
University of Cape Town
phone(cell): 0725239593
phone(office): 021-650-3756
skype: oksetetemela
twitter: @khobatha
"But seek ye first the kingdom of God, and His righteousness; and all these things shall be added unto you" (Matt 6:33)