GithubHelp home page GithubHelp logo

axel-angel / scala-blitzview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scala-blitz/scala-blitz

0.0 2.0 0.0 2.89 MB

Scala framework for efficient sequential and data-parallel collections -

Home Page: http://scala-blitz.github.io/

License: Other

Scala 100.00%

scala-blitzview's Introduction

Scala BlitzView

Prototype of BlitzView: Lightweight, non-strict and parallel-efficient views.

  • Guarantee 1 single access per element, O(t) memory and O(tn) computation for transformer operations.
  • Based on Scala Blitz for configurable parallelism.

See the paper at: https://github.com/axel-angel/blitzview-report . Automatic dependency on ScalaBlitz.

Compile and REPL:

$ sbt
> compile
> console

Code examples:

Necessary imports:

import scala.collection.views.BlitzView
import scala.collection.views.BlitzView._
import scala.collection.views.BlitzViewImpl._
import scala.collection.par.Scheduler.Implicits.sequential

Some examples:

val v = (0 to 10).bview
val u = v.map(_ + 10)
val v = Array(1,2,3,4).bview
val v2 = v.flatMap{x => Array(x, x+10)}
v.toArray // Array(1, 2, 3, 4)
val v3 = v.flatMap{x => v2.filter{_ % x == 0}}
v3.toArray // Array(1,11,2,12,3,13,4,14,2,12,4,14,12,3,12,4)
import collection.mutable.HashMap
val m = HashMap((1,2))
val v = m.bview.map{case (x,y) => x+y}
v.toArray // Array(3)
v.sum // 3
m += ((3,4))
v.toArray // Array(7, 3)
v.sum // 10

See the tests

scala-blitzview's People

Contributors

axel-angel avatar axel22 avatar darkdimius avatar geheiner avatar xeno-by avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.