diff --git a/CHANGELOG.md b/CHANGELOG.md index e14568e..c36094b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ units - CHANGELOG ================= +version 0.1.0 +------------- + +* General: **Renamed the main package from `stasiak.karol.units` to `io.github.karols.units`.** + +* General: added `power4`, `power5`, `inverseSquare`, `inverseCube`, `inversePower4` and `inversePower5` to `io.github.karols.units` + +* General: Redesigned `WithU` and `WithA`. + version 0.0.9 ------------- diff --git a/LICENSE b/LICENSE index a2fc973..cb05983 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 30ec039..2841731 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ units Published under MIT License. -Current version: 0.0.9 +Current version: 0.1.0 ---------------------- [Changelog.](CHANGELOG.md) @@ -41,16 +41,16 @@ Quick showcase ============== ``` scala -import stasiak.units._ -import stasiak.units.defining._ +import io.github.karols.units._ +import io.github.karols.units.defining._ type USD = DefineUnit[_U~:_S~:_D] type EUR = DefineUnit[_E~:_U~:_R] implicit val EUR_to_USD = one[EUR].contains(1.25)[USD] -import stasiak.units.SI._ -import stasiak.units.USCustomary._ +import io.github.karols.units.SI._ +import io.github.karols.units.USCustomary._ val priceInUSA = 200.of[USD/square[foot]] val priceInGermany = 1500.of[EUR/square[metre]] @@ -85,8 +85,8 @@ Defining units You define a unit using `DefineUnit` type constructor with a type-level string as a parameter. ``` scala -import stasiak.units._ -import stasiak.units.defining._ +import io.github.karols.units._ +import io.github.karols.units.defining._ type metre = DefineUnit[_m] type second = DefineUnit[_s] @@ -125,14 +125,16 @@ Note that this does not define a conversion from kilometres to centimetres. You ``` scala implicit val km_to_cm = km_to_m >> m_to_cm ``` -You can also quickly generate conversions for kg×m→kg×cm or m/s→cm/s: +You can also quickly generate conversions for kg×m→kg×cm, m/s→cm/s, J/m→J/cm, N/m²→N/cm²: ``` scala implicit val kgm_to_kgcm = m_to_cm.times[kilogram] implicit val mps_to_cmps = m_to_cm.dividedBy[second] +implicit val Jpm_to_Jpcm = m_to_cm.dividing[joule] +implicit val Npm2_to_Npcm2 = m_to_cm.pow2.dividing[newton] ``` -See sources for `stasiak.units.SI` and `stasiak.units.USCustomary` objects for more examples. +See sources for `io.github.karols.units.SI` and `io.github.karols.units.USCustomary` objects for more examples. Using values with units @@ -141,7 +143,7 @@ Using values with units All code below assumes the following is imported: ``` scala -import stasiak.units._ +import io.github.karols.units._ ``` You can create a value with a unit: @@ -313,8 +315,8 @@ AffineSpace is defined as a pair containing a zero point and a unit. ``` scala -import stasiak.units._ -import stasiak.units.defining._ +import io.github.karols.units._ +import io.github.karols.units.defining._ type celsius_deg = DefineUnit[_deg~:_C] sealed trait CelsiusZero diff --git a/doc/ARRAYS.md b/doc/ARRAYS.md index 1252aad..79a491c 100644 --- a/doc/ARRAYS.md +++ b/doc/ARRAYS.md @@ -1,7 +1,7 @@ Using arrays ============ -Sadly, Scala 2.10's arrays of value classes are boxed. As an alternative, `stasiak.units.arrays` package provides classes `DoubleUArray[U]`, `DoubleAArray[A]`, `IntUArray[U]`, and `IntAArray[A]`. +Sadly, Scala 2.10's arrays of value classes are boxed. As an alternative, `io.github.karols.units.arrays` package provides classes `DoubleUArray[U]`, `DoubleAArray[A]`, `IntUArray[U]`, and `IntAArray[A]`. All of them implement `IndexedSeq` and can be used like standard collection classes: diff --git a/doc/BINDINGS.md b/doc/BINDINGS.md index 7b97447..546f0b6 100644 --- a/doc/BINDINGS.md +++ b/doc/BINDINGS.md @@ -26,14 +26,14 @@ Artefact `units-scalaz` provides implementations of following typeclasses: * for `Vector3A`: `Equal`, `Show` -Usage: `import stasiak.units.scalazSupport._` +Usage: `import io.github.karols.units.scalazSupport._` Spire ----- [Spire project page.](https://github.com/non/spire) -Currently, only Spire 0.3.x is supported. +Currently, only Spire 0.6.x is supported. Artefact `units-spire` provides implementations of following typeclasses: @@ -45,7 +45,7 @@ Artefact `units-spire` provides implementations of following typeclasses: * for `Vector3U`: `VectorSpace[Vector3U[U], Double]` -Usage: `import stasiak.units.spireSupport._` +Usage: `import io.github.karols.units.spireSupport._` Scalacheck ---------- @@ -56,7 +56,7 @@ Currently, only Scalacheck 1.10.x is supported. Artefact `units-scalacheck` provides implementations of `Choose[IntU[U]]`, `Choose[DoubleU[U]]`, `Choose[IntA[A]]` and `Choose[DoubleA[A]]`. -Usage: `import stasiak.units.scalacheckSupport._` +Usage: `import io.github.karols.units.scalacheckSupport._` Joda Time --------- @@ -67,18 +67,18 @@ Currently, only Joda Time 2.1 and above is supported. Artefact `units-joda` provides implicit conversions from and to `Duration`, `Seconds`, `Minutes`, and `Hours` classes. -Usage: `import stasiak.units.jodaSupport._` +Usage: `import io.github.karols.units.jodaSupport._` Algebird -------- [Algebird project page.](https://github.com/twitter/algebird) -Currently, only Algebird 0.1.13 is supported. +Currently, only Algebird 0.3.x is supported. Artefact `units-algebird` provides implementations of `Monoid`, `Group` and `VectorSpace` for `IntU`, `DoubleU`, `Vector2U` and `Vector3U` (except for `VectorSpace` for `IntU`). -Usage: `import stasiak.units.algebirdSupport._` +Usage: `import io.github.karols.units.algebirdSupport._` Slick ----- @@ -89,4 +89,4 @@ Currently, only Slick 1.0.x is supported. Support for Slick 2.0 will follow afte Artefact `units-slick` provides implementations of column mappings for `IntU`, `IntA`, `DoubleU` and `DoubleA`. -Usage: `import stasiak.units.slick1Support` +Usage: `import io.github.karols.units.slick1Support` diff --git a/doc/CUSTOM.md b/doc/CUSTOM.md index 710c51f..10d6699 100644 --- a/doc/CUSTOM.md +++ b/doc/CUSTOM.md @@ -6,8 +6,8 @@ Custom types with units Since 0.0.8, you can create add units to any type `N` you want. It will support arithmetic operations if there is an implementation of `Numeric[N]` and comparisons if there's `Ordering[N]`. ```scala -import stasiak.units._ -import stasiak.units.SI._ +import io.github.karols.units._ +import io.github.karols.units.SI._ val x: WithU[BigInt, metre] = BigInt(100).of[metre] val y: WithU[BigInt, metre] = BigInt(50).of[metre] diff --git a/doc/POLYMORPHISM.md b/doc/POLYMORPHISM.md index 978a820..1756581 100644 --- a/doc/POLYMORPHISM.md +++ b/doc/POLYMORPHISM.md @@ -85,11 +85,11 @@ val workday = 8.of[hour] MKS[T](workday.convert[second]) // explicit conversion required ``` -A subset of generic units is defined in `stasiak.units.Mechanical`. By using it, the example above could be rewritten as: +A subset of generic units is defined in `io.github.karols.units.Mechanical`. By using it, the example above could be rewritten as: ``` scala -import stasiak.units.Mechanical._ -import stasiak.units.SI._ +import io.github.karols.units.Mechanical._ +import io.github.karols.units.SI._ def position(x0: DoubleU[length], v0: DoubleU[speed], a: DoubleU[acceleration], t:DoubleU[time]) = x0 + v0*t + a*t*t/2 diff --git a/doc/TODO.md b/doc/TODO.md index 96c1ac5..4ff5b25 100644 --- a/doc/TODO.md +++ b/doc/TODO.md @@ -1,43 +1,35 @@ TODO: ===== -For 0.1: +For 0.1.x (all 0.1.x are going to be backward-compatible up to 0.1.0): -* **move everything from `stasiak.karol.units` package to `stasiak.units`** +* add instances for `WithU` and `WithA` -* provide partial Scala 2.11 support - -* rearrange `TChar`s, so that lexical sorting of unit names yields natural-looking compound units - -* write more documentation +* fix found bugs --- -For 0.2 and beyond: +For 0.2: * provide full Scala 2.11 support -* improve explicit polymorphism +* add [Pickling](https://github.com/scala/pickling) integration * improve two-way affine space conversions -* figure out what to do with `WithU` and `WithA` and their incompatibility with typeclasses - * optimize compilation times * test Proguard compatibility -* add [Pickling](https://github.com/scala/pickling) integration - -* add `java.time` integration (JDK 8) - * add more units of measure * write more tests * write more benchmarks -* optionally: add [Breeze](https://github.com/dlwh/breeze), [Saddle](https://github.com/saddle/saddle), [Shapeless](https://github.com/milessabin/shapeless), [Slick 2](https://github.com/slick/slick) and [Squeryl](https://github.com/max-l/Squeryl) integration +* write more documentation + +* optionally: rearrange `TChar`s, so that lexical sorting of unit names yields natural-looking compound units * optionally: add runtime dynamic units @@ -45,5 +37,14 @@ For 0.2 and beyond: * optionally: consider removing unnecessary features -* and finally: add more new features +--- + +For 0.3 and beyond: + +* improve explicit polymorphism +* add `java.time` integration (JDK 8) + +* optionally: add [Breeze](https://github.com/dlwh/breeze), [Saddle](https://github.com/saddle/saddle), [Shapeless](https://github.com/milessabin/shapeless), [Slick 2](https://github.com/slick/slick) and [Squeryl](https://github.com/max-l/Squeryl) integration + +* and finally: add more new features diff --git a/doc/VECTORS.md b/doc/VECTORS.md index 6f206e8..e376ec1 100644 --- a/doc/VECTORS.md +++ b/doc/VECTORS.md @@ -63,7 +63,7 @@ All of the array classes implement `IndexedSeq` and can be used like standard co They can be created in several ways: ``` scala -import stasiak.units.arrays._ +import io.github.karols.units.arrays._ Vector2UArray.of[metre]((1,2), (4,5)) diff --git a/generateSystem.scala.py b/generateSystem.scala.py index d1c1a92..5f0de46 100755 --- a/generateSystem.scala.py +++ b/generateSystem.scala.py @@ -1,5 +1,25 @@ #!/usr/bin/env python +# Copyright (c) 2013-2014 Karol M. Stasiak + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + F = None def output(line): @@ -96,7 +116,7 @@ def generate_system(size): if(__name__=='__main__'): F = open("units/src/main/scala/System.scala", "w") output('''/* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -120,13 +140,13 @@ def generate_system(size): // This file is generated automatically, don't bother modifying. // Modify generateSystem.scala.py instead. -package stasiak.karol.units +package io.github.karols.units -import stasiak.karol.units._ -import stasiak.karol.units.internal.Integers._ -import stasiak.karol.units.internal.Strings._ -import stasiak.karol.units.internal.UnitImpl._ -import stasiak.karol.units.internal.SingleUnits._ +import io.github.karols.units._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.SingleUnits._ ''') diff --git a/project/Build.scala b/project/Build.scala index d7ae712..88eb6ca 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1,4 +1,4 @@ -package stasiak.units +package io.github.karols.units import sbt._ import Keys._ @@ -7,36 +7,38 @@ import sbt.Defaults._ object UnitsBuild extends Build { - val VERSION = "0.0.9-SNAPSHOT" - + val VERSION = "0.1.0" + type Sett = Project.Setting[_] // settings common for all projects lazy val baseSettings: Seq[Sett] = Defaults.defaultSettings ++ Seq[Sett]( - organization := "stasiak.karol", + organization := "io.github.karols", version := VERSION, scalaVersion := "2.10.0", crossScalaVersions := Seq("2.10.0"), - pomIncludeRepository := { + publishMavenStyle := true, + pomIncludeRepository := { x => false }, + licenses := Seq("MIT License" -> url("http://opensource.org/licenses/MIT")), + homepage := Some(url("http://www.github.com/KarolS/units")), pomExtra := ( - - - MIT License - http://opensource.org/licenses/MIT - - + + git@github.com:KarolS/units.git + scm:git:git@github.com:KarolS/units.git + KarolS Karol Stasiak - http://github.com/KarolS + karol.m.stasiak+units@gmail.com + http://karols.github.io - ) + ) ) // dependencies @@ -45,17 +47,17 @@ object UnitsBuild extends Build { lazy val SCALAZ = "org.scalaz" %% "scalaz-core" % "[7.0.0,7.1)" - lazy val SPIRE = "org.spire-math" %% "spire" % "[0.3.0,0.4)" + lazy val SPIRE = "org.spire-math" %% "spire" % "[0.6,0.7)" - lazy val ALGEBIRD = "com.twitter" %% "algebird-core" % "0.1.13" + lazy val ALGEBIRD = "com.twitter" %% "algebird-core" % "[0.3.0,0.4)" lazy val SLICK = "com.typesafe.slick" %% "slick" % "[1.0.0,1.1)" lazy val JODA_TIME = "joda-time" % "joda-time" % "[2.1,3)" - lazy val JODA_CONVERT = "org.joda" % "joda-convert" % "[1.2,2)" % "provided" + lazy val JODA_CONVERT = "org.joda" % "joda-convert" % "1.2" % "provided" - lazy val SCALATEST_TEST = "org.scalatest" % "scalatest_2.10" % "[2.0.M5b,2.1)" % "test" + lazy val SCALATEST_TEST = "org.scalatest" % "scalatest_2.10" % "2.0" % "test" lazy val CALIPER_TEST = "com.google.caliper" % "caliper" % "0.5-rc1" % "test" diff --git a/units-algebird/src/main/scala/algebirdSupport.scala b/units-algebird/src/main/scala/algebirdSupport.scala index 5cc7fc0..16470aa 100644 --- a/units-algebird/src/main/scala/algebirdSupport.scala +++ b/units-algebird/src/main/scala/algebirdSupport.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units -import stasiak.units.SI._ -import stasiak.units.SI.Short._ +import io.github.karols.units.SI._ +import io.github.karols.units.SI.Short._ import com.twitter.algebird._ import language.implicitConversions diff --git a/units-joda/src/main/scala/jodaSupport.scala b/units-joda/src/main/scala/jodaSupport.scala index e41ea4c..847d79e 100644 --- a/units-joda/src/main/scala/jodaSupport.scala +++ b/units-joda/src/main/scala/jodaSupport.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units -import stasiak.units.SI._ -import stasiak.units.SI.Short._ +import io.github.karols.units.SI._ +import io.github.karols.units.SI.Short._ import org.joda.time._ import language.implicitConversions diff --git a/units-scalacheck/src/main/scala/ScalacheckSupport.scala b/units-scalacheck/src/main/scala/ScalacheckSupport.scala index 54c4438..6a18801 100644 --- a/units-scalacheck/src/main/scala/ScalacheckSupport.scala +++ b/units-scalacheck/src/main/scala/ScalacheckSupport.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import org.scalacheck._ import language.implicitConversions diff --git a/units-scalaz/src/main/scala/ScalazSupport.scala b/units-scalaz/src/main/scala/ScalazSupport.scala index bc90fdc..c76d5df 100644 --- a/units-scalaz/src/main/scala/ScalazSupport.scala +++ b/units-scalaz/src/main/scala/ScalazSupport.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import scalaz.{Ordering, Monoid, Show, Order, Equal} diff --git a/units-scalaz/src/test/scala/ScalazSupportSuite.scala b/units-scalaz/src/test/scala/ScalazSupportSuite.scala index ee4b716..7f5291b 100644 --- a/units-scalaz/src/test/scala/ScalazSupportSuite.scala +++ b/units-scalaz/src/test/scala/ScalazSupportSuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20,10 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import org.scalatest.FunSuite -import stasiak.units.scalazSupport._ +import io.github.karols.units.scalazSupport._ import SI._ import USCustomary._ import scalaz._ diff --git a/units-slick/src/main/scala/Slick1Support.scala b/units-slick/src/main/scala/Slick1Support.scala index 33fedf5..cfd0980 100644 --- a/units-slick/src/main/scala/Slick1Support.scala +++ b/units-slick/src/main/scala/Slick1Support.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units -import stasiak.units.SI._ -import stasiak.units.SI.Short._ +import io.github.karols.units.SI._ +import io.github.karols.units.SI.Short._ import scala.slick.lifted._ import language.implicitConversions diff --git a/units-slick/src/test/scala/Slick1SupportSuite.scala b/units-slick/src/test/scala/Slick1SupportSuite.scala index 6f42c83..bdbee70 100644 --- a/units-slick/src/test/scala/Slick1SupportSuite.scala +++ b/units-slick/src/test/scala/Slick1SupportSuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20,10 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import org.scalatest._ -import stasiak.units.slick1Support._ +import io.github.karols.units.slick1Support._ import SI._ import USCustomary._ import scala.slick.driver.H2Driver.simple._ diff --git a/units-spire/src/main/scala/SpireSupport.scala b/units-spire/src/main/scala/SpireSupport.scala index 0fcf873..572ceb8 100644 --- a/units-spire/src/main/scala/SpireSupport.scala +++ b/units-spire/src/main/scala/SpireSupport.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20,11 +20,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import spire.algebra._ import spire.math._ -import stasiak.units._ +import io.github.karols.units._ import language.implicitConversions package object spireSupport { diff --git a/units/src/main/scala/AffineSpace.scala b/units/src/main/scala/AffineSpace.scala index ae4f237..ecc741b 100644 --- a/units/src/main/scala/AffineSpace.scala +++ b/units/src/main/scala/AffineSpace.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,17 +19,17 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.AffineSpaces._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.AffineSpaces._ /** Supertype of all affine spaces. diff --git a/units/src/main/scala/AffineSpaceConversion.scala b/units/src/main/scala/AffineSpaceConversion.scala index 4f8a91f..701accb 100644 --- a/units/src/main/scala/AffineSpaceConversion.scala +++ b/units/src/main/scala/AffineSpaceConversion.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.defining +package io.github.karols.units.defining import language.higherKinds import language.implicitConversions -import stasiak.units.{DoubleRatio=>_, _} -import stasiak.units.internal.ratios._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ -import stasiak.units.internal.SingleUnits._ +import io.github.karols.units.{DoubleRatio=>_, _} +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ +import io.github.karols.units.internal.SingleUnits._ sealed trait ReversibleDoubleAConversion[A<:AffineSpace, B<:AffineSpace]{ val forward: Double=>Double diff --git a/units/src/main/scala/DefiningUnits.scala b/units/src/main/scala/DefiningUnits.scala index e97981d..ce7bfff 100644 --- a/units/src/main/scala/DefiningUnits.scala +++ b/units/src/main/scala/DefiningUnits.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,27 +19,27 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units /** Package containing helper types and methods for defining new units and ratios between units. Usage: - `import stasiak.units.defining._` + `import io.github.karols.units.defining._` */ package object defining { import language.higherKinds import language.implicitConversions - import stasiak.units.internal.ratios._ - import stasiak.units.internal.UnitImpl._ - import stasiak.units.internal.Strings - import stasiak.units.internal.Strings._ - import stasiak.units.internal.Integers._ - import stasiak.units.internal.Conversions._ - import stasiak.units.internal.AffineSpaces - import stasiak.units.internal.AffineSpaces._ - import stasiak.units.internal.SingleUnits._ + import io.github.karols.units.internal.ratios._ + import io.github.karols.units.internal.UnitImpl._ + import io.github.karols.units.internal.Strings + import io.github.karols.units.internal.Strings._ + import io.github.karols.units.internal.Integers._ + import io.github.karols.units.internal.Conversions._ + import io.github.karols.units.internal.AffineSpaces + import io.github.karols.units.internal.AffineSpaces._ + import io.github.karols.units.internal.SingleUnits._ /** Helper for defining unit ratios. Syntax: `one[kilometre].contains(1000)[metre]` */ @inline def one[U<:MUnit] = new OneBuilder[U] diff --git a/units/src/main/scala/DoubleA.scala b/units/src/main/scala/DoubleA.scala index b21ca17..2a1fa6d 100644 --- a/units/src/main/scala/DoubleA.scala +++ b/units/src/main/scala/DoubleA.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.AffineSpaces._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.AffineSpaces._ +import io.github.karols.units.internal.UnitName object DoubleA { private type Aff = DefineAffineSpace[Nothing, _1] diff --git a/units/src/main/scala/DoubleU.scala b/units/src/main/scala/DoubleU.scala index de4c9f7..afe45b4 100644 --- a/units/src/main/scala/DoubleU.scala +++ b/units/src/main/scala/DoubleU.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions import language.existentials -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.UnionType._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.UnionType._ +import io.github.karols.units.internal.UnitName import scala.math object DoubleU { diff --git a/units/src/main/scala/IntA.scala b/units/src/main/scala/IntA.scala index f21e32d..bed2f6b 100644 --- a/units/src/main/scala/IntA.scala +++ b/units/src/main/scala/IntA.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.AffineSpaces._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.AffineSpaces._ +import io.github.karols.units.internal.UnitName object IntA { private type Aff = DefineAffineSpace[Nothing, _1] diff --git a/units/src/main/scala/IntU.scala b/units/src/main/scala/IntU.scala index c2d1cb6..32997ec 100644 --- a/units/src/main/scala/IntU.scala +++ b/units/src/main/scala/IntU.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions import language.existentials -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.UnionType._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.UnionType._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.UnitName import scala.math object IntU { diff --git a/units/src/main/scala/MUnit.scala b/units/src/main/scala/MUnit.scala index d575e51..dad629d 100644 --- a/units/src/main/scala/MUnit.scala +++ b/units/src/main/scala/MUnit.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,35 +19,35 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions import language.existentials -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ import scala.math /** Supertype of all units of measure. */ trait MUnit { /** - @see stasiak.units./ - @see [[stasiak.units._1]] + @see io.github.karols.units./ + @see [[io.github.karols.units._1]] */ type Invert <: MUnit type Get[U<:TSingleUnit] <:TInteger type MulSingle[S<:TUnitPowerPair] <: MUnit - /** @see stasiak.units.× */ + /** @see io.github.karols.units.× */ type Mul[S<:MUnit] <: MUnit type Sqrt <:MUnit type Cbrt <:MUnit - /** @see [[stasiak.units.square]] */ + /** @see [[io.github.karols.units.square]] */ type IsSquare <: TBool - /** @see [[stasiak.units.cube]] */ + /** @see [[io.github.karols.units.cube]] */ type IsCube <: TBool type ToPower[Exp<:TInteger] <: MUnit type Substitute[S<:TSingleUnit, V<:MUnit] <: MUnit diff --git a/units/src/main/scala/System.scala b/units/src/main/scala/System.scala index 65ff623..9543380 100644 --- a/units/src/main/scala/System.scala +++ b/units/src/main/scala/System.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -23,13 +23,13 @@ SOFTWARE. // This file is generated automatically, don't bother modifying. // Modify generateSystem.scala.py instead. -package stasiak.units +package io.github.karols.units -import stasiak.units._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.SingleUnits._ +import io.github.karols.units._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.SingleUnits._ object System1 { diff --git a/units/src/main/scala/Vector2A.scala b/units/src/main/scala/Vector2A.scala index 315398b..edfe671 100644 --- a/units/src/main/scala/Vector2A.scala +++ b/units/src/main/scala/Vector2A.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions import language.existentials -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.UnionType._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.UnionType._ +import io.github.karols.units.internal.UnitName import scala.math object Vector2A { diff --git a/units/src/main/scala/Vector2U.scala b/units/src/main/scala/Vector2U.scala index 257db23..bebb844 100644 --- a/units/src/main/scala/Vector2U.scala +++ b/units/src/main/scala/Vector2U.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions import language.existentials -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.UnionType._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.UnionType._ +import io.github.karols.units.internal.UnitName import scala.math object Vector2U { diff --git a/units/src/main/scala/Vector3A.scala b/units/src/main/scala/Vector3A.scala index 918758c..2e81b96 100644 --- a/units/src/main/scala/Vector3A.scala +++ b/units/src/main/scala/Vector3A.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions import language.existentials -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.UnionType._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.UnionType._ +import io.github.karols.units.internal.UnitName import scala.math object Vector3A { diff --git a/units/src/main/scala/Vector3U.scala b/units/src/main/scala/Vector3U.scala index 8ad2d7a..198f69d 100644 --- a/units/src/main/scala/Vector3U.scala +++ b/units/src/main/scala/Vector3U.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions import language.existentials -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.UnionType._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.UnionType._ +import io.github.karols.units.internal.UnitName import scala.math object Vector3U { diff --git a/units/src/main/scala/WithA.scala b/units/src/main/scala/WithA.scala index b594669..0c25b5e 100644 --- a/units/src/main/scala/WithA.scala +++ b/units/src/main/scala/WithA.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions import language.existentials -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.UnionType._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.UnionType._ +import io.github.karols.units.internal.UnitName import scala.math import scala.math.{Numeric, Fractional} diff --git a/units/src/main/scala/WithU.scala b/units/src/main/scala/WithU.scala index 5b7547c..c14e7f4 100644 --- a/units/src/main/scala/WithU.scala +++ b/units/src/main/scala/WithU.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import language.higherKinds import language.implicitConversions import language.existentials -import stasiak.units.internal.ratios._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.UnionType._ -import stasiak.units.internal.UnitName +import io.github.karols.units.internal.ratios._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.UnionType._ +import io.github.karols.units.internal.UnitName import scala.math import scala.math.{Numeric, Fractional} diff --git a/units/src/main/scala/arrays/DoubleAArray.scala b/units/src/main/scala/arrays/DoubleAArray.scala index 06887e5..b5c79cd 100644 --- a/units/src/main/scala/arrays/DoubleAArray.scala +++ b/units/src/main/scala/arrays/DoubleAArray.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,9 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.arrays +package io.github.karols.units.arrays -import stasiak.units._ +import io.github.karols.units._ import scala.collection.mutable._ object DoubleAArray { @@ -70,7 +70,7 @@ class DoubleAArrayBuilder[A<:AffineSpace] extends Builder[DoubleA[A], DoubleAArr def clear() = underlying.clear def result() = new DoubleAArray[A](underlying.result()) } -/** Mutable fixed-size array of unboxed [[stasiak.units.DoubleA]]. */ +/** Mutable fixed-size array of unboxed [[io.github.karols.units.DoubleA]]. */ final class DoubleAArray[A<:AffineSpace] private[arrays] (private[arrays] val underlying: Array[Double]) extends IndexedSeq[DoubleA[A]] with ArrayLike[DoubleA[A], DoubleAArray[A]]{ diff --git a/units/src/main/scala/arrays/DoubleUArray.scala b/units/src/main/scala/arrays/DoubleUArray.scala index afea2cd..316fd82 100644 --- a/units/src/main/scala/arrays/DoubleUArray.scala +++ b/units/src/main/scala/arrays/DoubleUArray.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,9 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.arrays +package io.github.karols.units.arrays -import stasiak.units._ +import io.github.karols.units._ import scala.collection.mutable._ object DoubleUArray { @@ -49,13 +49,13 @@ object DoubleUArray { def fill[U<:MUnit](n: Int)(elem: =>DoubleU[U]) = { new DoubleUArray(Array.fill(n)(elem.value)) } - + /** Returns an array that contains a constant element a number of times. */ def fillUniform[U<:MUnit](n: Int)(elem: DoubleU[U]) = { val elemValue = elem.value new DoubleUArray(Array.fill(n)(elemValue)) } - + def unapplySeq[U<:MUnit](arr: DoubleUArray[U]) = Some(arr) //TODO: more @@ -70,7 +70,7 @@ class DoubleUArrayBuilder[U<:MUnit] extends Builder[DoubleU[U], DoubleUArray[U]] def clear() = underlying.clear def result() = new DoubleUArray[U](underlying.result()) } -/** Mutable fixed-size array of unboxed [[stasiak.units.DoubleU]]. */ +/** Mutable fixed-size array of unboxed [[io.github.karols.units.DoubleU]]. */ final class DoubleUArray[U<:MUnit] private[arrays] (private[arrays] val underlying: Array[Double]) extends IndexedSeq[DoubleU[U]] with ArrayLike[DoubleU[U], DoubleUArray[U]]{ @@ -88,7 +88,7 @@ final class DoubleUArray[U<:MUnit] private[arrays] (private[arrays] val underlyi def update(index: Int, elem: DoubleU[U]) { underlying(index) = elem.value } - + def zip(that: DoubleUArray[U]) = { val newLength = length min that.length val array = new Array[Double](newLength*2) @@ -98,8 +98,11 @@ final class DoubleUArray[U<:MUnit] private[arrays] (private[arrays] val underlyi } new DoubleUArray[U](array) } - + /** The sum of all values in the array */ def sum = DoubleU[U](underlying.sum) + /** The average of all values in the array */ + def avg = DoubleU[U](underlying.sum/underlying.length) + } \ No newline at end of file diff --git a/units/src/main/scala/arrays/IntAArray.scala b/units/src/main/scala/arrays/IntAArray.scala index 1377a42..50b3300 100644 --- a/units/src/main/scala/arrays/IntAArray.scala +++ b/units/src/main/scala/arrays/IntAArray.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,9 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.arrays +package io.github.karols.units.arrays -import stasiak.units._ +import io.github.karols.units._ import scala.collection.mutable._ object IntAArray { @@ -70,7 +70,7 @@ class IntAArrayBuilder[A<:AffineSpace] extends Builder[IntA[A], IntAArray[A]] { def clear() = underlying.clear def result() = new IntAArray[A](underlying.result()) } -/** Mutable fixed-size array of unboxed [[stasiak.units.IntA]]. */ +/** Mutable fixed-size array of unboxed [[io.github.karols.units.IntA]]. */ final class IntAArray[A<:AffineSpace] private[arrays] (private[arrays] val underlying: Array[Long]) extends IndexedSeq[IntA[A]] with ArrayLike[IntA[A], IntAArray[A]]{ diff --git a/units/src/main/scala/arrays/IntUArray.scala b/units/src/main/scala/arrays/IntUArray.scala index 3c39cad..082d615 100644 --- a/units/src/main/scala/arrays/IntUArray.scala +++ b/units/src/main/scala/arrays/IntUArray.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,9 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.arrays +package io.github.karols.units.arrays -import stasiak.units._ +import io.github.karols.units._ import scala.collection.mutable._ object IntUArray { @@ -55,9 +55,9 @@ object IntUArray { val elemValue = elem.value new IntUArray(Array.fill(n)(elemValue)) } - + def unapplySeq[U<:MUnit](arr: IntUArray[U]) = Some(arr) - + //TODO: more } class IntUArrayBuilder[U<:MUnit] extends Builder[IntU[U], IntUArray[U]] { @@ -70,7 +70,7 @@ class IntUArrayBuilder[U<:MUnit] extends Builder[IntU[U], IntUArray[U]] { def clear() = underlying.clear def result() = new IntUArray[U](underlying.result()) } -/** Mutable fixed-size array of unboxed [[stasiak.units.IntU]]. */ +/** Mutable fixed-size array of unboxed [[io.github.karols.units.IntU]]. */ final class IntUArray[U<:MUnit] private[arrays] (private[arrays] val underlying: Array[Long]) extends IndexedSeq[IntU[U]] with ArrayLike[IntU[U], IntUArray[U]]{ @@ -88,8 +88,12 @@ final class IntUArray[U<:MUnit] private[arrays] (private[arrays] val underlying: def update(index: Int, elem: IntU[U]) { underlying(index) = elem.value } - + /** The sum of all values in the array */ def sum = IntU[U](underlying.sum) + + /** The average of all values in the array */ + def avg = DoubleU[U](underlying.sum.toDouble/underlying.length) + } \ No newline at end of file diff --git a/units/src/main/scala/arrays/Vector2AArray.scala b/units/src/main/scala/arrays/Vector2AArray.scala index d68ff64..8c001f4 100644 --- a/units/src/main/scala/arrays/Vector2AArray.scala +++ b/units/src/main/scala/arrays/Vector2AArray.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,9 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.arrays +package io.github.karols.units.arrays -import stasiak.units._ +import io.github.karols.units._ import scala.collection.mutable._ object Vector2AArray { @@ -96,7 +96,7 @@ class Vector2AArrayBuilder[A<:AffineSpace] extends Builder[Vector2A[A], Vector2A def result() = new Vector2AArray[A](underlying.result()) } -/** Mutable fixed-size array of unboxed [[stasiak.units.Vector2A]]. */ +/** Mutable fixed-size array of unboxed [[io.github.karols.units.Vector2A]]. */ final class Vector2AArray[A<:AffineSpace] private[arrays] ( private[arrays] val underlying: Array[Double] ) diff --git a/units/src/main/scala/arrays/Vector2UArray.scala b/units/src/main/scala/arrays/Vector2UArray.scala index a6e6d08..adcb7b7 100644 --- a/units/src/main/scala/arrays/Vector2UArray.scala +++ b/units/src/main/scala/arrays/Vector2UArray.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,9 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.arrays +package io.github.karols.units.arrays -import stasiak.units._ +import io.github.karols.units._ import scala.collection.mutable._ object Vector2UArray { @@ -94,7 +94,7 @@ class Vector2UArrayBuilder[U<:MUnit] extends Builder[Vector2U[U], Vector2UArray[ } def result() = new Vector2UArray[U](underlying.result()) } -/** Mutable fixed-size array of unboxed [[stasiak.units.Vector2U]]. */ +/** Mutable fixed-size array of unboxed [[io.github.karols.units.Vector2U]]. */ final class Vector2UArray[U<:MUnit] private[arrays] ( private[arrays] val underlying: Array[Double] ) diff --git a/units/src/main/scala/arrays/Vector3AArray.scala b/units/src/main/scala/arrays/Vector3AArray.scala index b8c4ec6..0bae157 100644 --- a/units/src/main/scala/arrays/Vector3AArray.scala +++ b/units/src/main/scala/arrays/Vector3AArray.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,9 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.arrays +package io.github.karols.units.arrays -import stasiak.units._ +import io.github.karols.units._ import scala.collection.mutable._ object Vector3AArray { @@ -100,7 +100,7 @@ class Vector3AArrayBuilder[A<:AffineSpace] extends Builder[Vector3A[A], Vector3A def result() = new Vector3AArray[A](underlying.result()) } -/** Mutable fixed-size array of unboxed [[stasiak.units.Vector3A]]. */ +/** Mutable fixed-size array of unboxed [[io.github.karols.units.Vector3A]]. */ final class Vector3AArray[A<:AffineSpace] private[arrays] ( private[arrays] val underlying: Array[Double] ) diff --git a/units/src/main/scala/arrays/Vector3UArray.scala b/units/src/main/scala/arrays/Vector3UArray.scala index cd4b83e..f65cba3 100644 --- a/units/src/main/scala/arrays/Vector3UArray.scala +++ b/units/src/main/scala/arrays/Vector3UArray.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,9 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.arrays +package io.github.karols.units.arrays -import stasiak.units._ +import io.github.karols.units._ import scala.collection.mutable._ object Vector3UArray { @@ -98,7 +98,7 @@ class Vector3UArrayBuilder[U<:MUnit] extends Builder[Vector3U[U], Vector3UArray[ } def result() = new Vector3UArray[U](underlying.result()) } -/** Mutable fixed-size array of unboxed [[stasiak.units.Vector3U]]. */ +/** Mutable fixed-size array of unboxed [[io.github.karols.units.Vector3U]]. */ final class Vector3UArray[U<:MUnit] private[arrays] ( private[arrays] val underlying: Array[Double] ) diff --git a/units/src/main/scala/constants/Physical.scala b/units/src/main/scala/constants/Physical.scala index fca5b4e..522dcbf 100644 --- a/units/src/main/scala/constants/Physical.scala +++ b/units/src/main/scala/constants/Physical.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,11 +19,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.constants +package io.github.karols.units.constants -import stasiak.units._ -import stasiak.units.SI._ -import stasiak.units.SI.Short._ +import io.github.karols.units._ +import io.github.karols.units.SI._ +import io.github.karols.units.SI.Short._ /** Common constants used in physics. */ object Physical { diff --git a/units/src/main/scala/internal/AffineSpaces.scala b/units/src/main/scala/internal/AffineSpaces.scala index 93ac56a..a7b1384 100644 --- a/units/src/main/scala/internal/AffineSpaces.scala +++ b/units/src/main/scala/internal/AffineSpaces.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,11 +19,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal object AffineSpaces { import UnitImpl._ - import stasiak.units._ + import io.github.karols.units._ trait DefineAffineSpace[Z, U<:MUnit] extends AffineSpace{ /** Arbitrary marker type identifying the zero point on the scale.*/ diff --git a/units/src/main/scala/internal/Bools.scala b/units/src/main/scala/internal/Bools.scala index 7ea1381..2e1e72f 100644 --- a/units/src/main/scala/internal/Bools.scala +++ b/units/src/main/scala/internal/Bools.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal object Bools { import language.higherKinds diff --git a/units/src/main/scala/internal/Conversions.scala b/units/src/main/scala/internal/Conversions.scala index 94733e4..e14bda5 100644 --- a/units/src/main/scala/internal/Conversions.scala +++ b/units/src/main/scala/internal/Conversions.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal object Conversions { import language.higherKinds @@ -29,8 +29,8 @@ object Conversions { import Strings._ import SingleUnits._ import UnitImpl._ - import stasiak.units.MUnit - import stasiak.units.internal.ratios._ + import io.github.karols.units.MUnit + import io.github.karols.units.internal.ratios._ @inline diff --git a/units/src/main/scala/internal/Integers.scala b/units/src/main/scala/internal/Integers.scala index f327a5d..a155f5c 100644 --- a/units/src/main/scala/internal/Integers.scala +++ b/units/src/main/scala/internal/Integers.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal object Integers { import Bools._ diff --git a/units/src/main/scala/internal/Lists.scala b/units/src/main/scala/internal/Lists.scala index bac18c6..8eceb43 100644 --- a/units/src/main/scala/internal/Lists.scala +++ b/units/src/main/scala/internal/Lists.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal object Lists { import language.higherKinds diff --git a/units/src/main/scala/internal/SingleUnits.scala b/units/src/main/scala/internal/SingleUnits.scala index a417b4b..f435d45 100644 --- a/units/src/main/scala/internal/SingleUnits.scala +++ b/units/src/main/scala/internal/SingleUnits.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal object SingleUnits { import language.higherKinds diff --git a/units/src/main/scala/internal/Strings.scala b/units/src/main/scala/internal/Strings.scala index 5bce173..5bf2b92 100644 --- a/units/src/main/scala/internal/Strings.scala +++ b/units/src/main/scala/internal/Strings.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal object Strings { import language.higherKinds diff --git a/units/src/main/scala/internal/UnionType.scala b/units/src/main/scala/internal/UnionType.scala index e445550..8b6360d 100644 --- a/units/src/main/scala/internal/UnionType.scala +++ b/units/src/main/scala/internal/UnionType.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal object UnionType { type NOT[A] = A => Nothing diff --git a/units/src/main/scala/internal/UnitImpl.scala b/units/src/main/scala/internal/UnitImpl.scala index 9e86122..5d20bd2 100644 --- a/units/src/main/scala/internal/UnitImpl.scala +++ b/units/src/main/scala/internal/UnitImpl.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal object UnitImpl { import language.higherKinds @@ -28,7 +28,7 @@ object UnitImpl { import Integers._ import Strings._ import SingleUnits._ - import stasiak.units.MUnit + import io.github.karols.units.MUnit sealed trait TUnitPowerPair extends MUnit { type UnitName <: TSingleUnit diff --git a/units/src/main/scala/internal/UnitName.scala b/units/src/main/scala/internal/UnitName.scala index 2dd673a..2d1376a 100644 --- a/units/src/main/scala/internal/UnitName.scala +++ b/units/src/main/scala/internal/UnitName.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal +package io.github.karols.units.internal import language.higherKinds import language.implicitConversions import Bools._ @@ -27,7 +27,7 @@ import Integers._ import Strings._ import SingleUnits._ import UnitImpl._ -import stasiak.units.MUnit +import io.github.karols.units.MUnit import scala.annotation.implicitNotFound @implicitNotFound(msg="Cannot find a human-friendly name for unit ${U}") diff --git a/units/src/main/scala/internal/ratios/BaseDoubleRatio.scala b/units/src/main/scala/internal/ratios/BaseDoubleRatio.scala index c722952..054f28d 100644 --- a/units/src/main/scala/internal/ratios/BaseDoubleRatio.scala +++ b/units/src/main/scala/internal/ratios/BaseDoubleRatio.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,55 +19,134 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ class BaseDoubleRatio[U<:MUnit, V<:MUnit](val ratio: Double) extends AnyVal { + + /** + Converts a ratio between U and V into ratio between U×Y and V×Y + */ @inline def times[Y<:MUnit] = new BaseDoubleRatio[U#Mul[Y],V#Mul[Y]](ratio) + + /** + Converts a ratio between U and V into ratio between U/Y and V/Y + */ @inline def dividedBy[Y<:MUnit] = new BaseDoubleRatio[U#Mul[Y#Invert],V#Mul[Y#Invert]](ratio) + + /** + Converts a ratio between U and V into ratio between Y/U and Y/V + */ + @inline + def dividing[Y<:MUnit] = + new BaseDoubleRatio[Y#Mul[U#Invert],Y#Mul[V#Invert]](1.0/ratio) + + /** + Converts a ratio between U and V into ratio between 1/U and 1/V + */ @inline def invert = new BaseDoubleRatio[V,U](1.0/ratio) + + /** + Converts a ratio between U and V into ratio between U^2 and V^2 + */ @inline def pow2 = this * this + + /** + Converts a ratio between U and V into ratio between U^3 and V^3 + */ @inline def pow3 = this * this * this + + /** + Converts a ratio between U and V into ratio between U^4 and V^4 + */ + @inline + def pow4 = this * this * this * this + + /** + Converts a ratio between U and V into ratio between U^5 and V^5 + */ + @inline + def pow5 = this * this * this * this * this + + /** + Converts ratios between U and V and between X and Y into ratio between U×X and V×Y + */ @inline def *[X<:MUnit, Y<:MUnit](that: BaseDoubleRatio[X,Y]) = new BaseDoubleRatio[U#Mul[X],V#Mul[Y]](ratio*that.ratio) + + /** + Converts ratios between U and V and between X and Y into ratio between U×X and V×Y + */ @inline def *[X<:MUnit, Y<:MUnit](that: BaseIntRatio[X,Y]) = new BaseDoubleRatio[U#Mul[X],V#Mul[Y]](ratio*that.ratio) + + /** + Converts ratios between U and V and between X and Y into ratio between U×X and V×Y + */ @inline def /[X<:MUnit, Y<:MUnit](that: BaseIntRatio[X,Y]) = new BaseDoubleRatio[U#Mul[X#Invert],V#Mul[Y#Invert]](ratio/that.ratio) + + /** + Converts ratios between U and V and between X and Y into ratio between U×X and V×Y + */ @inline def /[X<:MUnit, Y<:MUnit](that: BaseDoubleRatio[X,Y]) = new BaseDoubleRatio[U#Mul[X#Invert],V#Mul[Y#Invert]](ratio/that.ratio) + + /** + Converts ratios between U and V and between Y and V into ratio between U and Y + */ @inline def ><[Y<:MUnit](that: BaseDoubleRatio[Y,V]) = new BaseDoubleRatio[U,Y](ratio/that.ratio) + + /** + Converts ratios between U and V and between Y and V into ratio between U and Y + */ @inline def ><[Y<:MUnit](that: BaseIntRatio[Y,V]) = new BaseDoubleRatio[U,Y](ratio/that.ratio) + + /** + Converts ratios between U and V and between Y and V into ratio between U and Y + */ @inline def <>[Y<:MUnit](that: BaseDoubleRatio[U,Y]) = new BaseDoubleRatio[V,Y](that.ratio/ratio) + + /** + Converts ratios between U and V and between Y and V into ratio between U and Y + */ @inline def <>[Y<:MUnit](that: BaseIntRatio[U,Y]) = new BaseDoubleRatio[V,Y](that.ratio/ratio) + + /** + Converts ratios between U and V and between V and Y into ratio between U and Y + */ @inline def >>[Y<:MUnit](that: BaseDoubleRatio[V,Y]) = new BaseDoubleRatio[U,Y](ratio*that.ratio) + + /** + Converts ratios between U and V and between V and Y into ratio between U and Y + */ @inline def >>[Y<:MUnit](that: BaseIntRatio[V,Y]) = new BaseDoubleRatio[U,Y](ratio*that.ratio) } diff --git a/units/src/main/scala/internal/ratios/BaseIntRatio.scala b/units/src/main/scala/internal/ratios/BaseIntRatio.scala index a8b20ca..93233f3 100644 --- a/units/src/main/scala/internal/ratios/BaseIntRatio.scala +++ b/units/src/main/scala/internal/ratios/BaseIntRatio.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,55 +19,134 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ class BaseIntRatio[U<:MUnit, V<:MUnit](val ratio:Long) extends AnyVal { + + /** + Converts a ratio between U and V into ratio between U×Y and V×Y + */ @inline def times[Y<:MUnit] = new BaseIntRatio[U#Mul[Y],V#Mul[Y]](ratio) + + /** + Converts a ratio between U and V into ratio between U/Y and V/Y + */ @inline def dividedBy[Y<:MUnit] = new BaseIntRatio[U#Mul[Y#Invert],V#Mul[Y#Invert]](ratio) + + /** + Converts a ratio between U and V into ratio between Y/U and Y/V + */ + @inline + def dividing[Y<:MUnit] = + new BaseDoubleRatio[Y#Mul[U#Invert],Y#Mul[V#Invert]](1.0/ratio) + + /** + Converts a ratio between U and V into ratio between 1/U and 1/V + */ @inline def invert = new BaseDoubleRatio[V,U](1.0/ratio) + + /** + Converts a ratio between U and V into ratio between U^2 and V^2 + */ @inline def pow2 = this * this + + /** + Converts a ratio between U and V into ratio between U^3 and V^3 + */ @inline def pow3 = this * this * this + + /** + Converts a ratio between U and V into ratio between U^4 and V^4 + */ + @inline + def pow4 = this * this * this * this + + /** + Converts a ratio between U and V into ratio between U^5 and V^5 + */ + @inline + def pow5 = this * this * this * this * this + + /** + Converts ratios between U and V and between X and Y into ratio between U×X and V×Y + */ @inline def *[X<:MUnit, Y<:MUnit](that: BaseIntRatio[X,Y]) = new BaseIntRatio[U#Mul[X],V#Mul[Y]](ratio*that.ratio) + + /** + Converts ratios between U and V and between X and Y into ratio between U×X and V×Y + */ @inline def *[X<:MUnit, Y<:MUnit](that: BaseDoubleRatio[X,Y]) = new BaseDoubleRatio[U#Mul[X],V#Mul[Y]](ratio*that.ratio) + + /** + Converts ratios between U and V and between X and Y into ratio between U/X and V/Y + */ @inline def /[X<:MUnit, Y<:MUnit](that: BaseIntRatio[X,Y]) = - new BaseDoubleRatio[U#Mul[X#Invert],V#Mul[Y#Invert]](ratio/that.ratio) + new BaseDoubleRatio[U#Mul[X#Invert],V#Mul[Y#Invert]](ratio.toDouble/that.ratio) + + /** + Converts ratios between U and V and between X and Y into ratio between U/X and V/Y + */ @inline def /[X<:MUnit, Y<:MUnit](that: BaseDoubleRatio[X,Y]) = new BaseDoubleRatio[U#Mul[X#Invert],V#Mul[Y#Invert]](ratio/that.ratio) + + /** + Converts ratios between U and V and between Y and V into ratio between U and Y + */ @inline def ><[Y<:MUnit](that: BaseDoubleRatio[Y,V]) = new BaseDoubleRatio[U,Y](ratio/that.ratio) + + /** + Converts ratios between U and V and between Y and V into ratio between U and Y + */ @inline def ><[Y<:MUnit](that: BaseIntRatio[Y,V]) = new BaseDoubleRatio[U,Y](ratio.toDouble/that.ratio) + + /** + Converts ratios between U and V and between U and Y into ratio between V and Y + */ @inline def <>[Y<:MUnit](that: BaseDoubleRatio[U,Y]) = new BaseDoubleRatio[V,Y](that.ratio/ratio) + + /** + Converts ratios between U and V and between U and Y into ratio between V and Y + */ @inline def <>[Y<:MUnit](that: BaseIntRatio[U,Y]) = new BaseDoubleRatio[V,Y](that.ratio.toDouble/ratio) + + /** + Converts ratios between U and V and between V and Y into ratio between U and Y + */ @inline def >>[Y<:MUnit](that: BaseIntRatio[V,Y]) = new BaseIntRatio[U,Y](ratio*that.ratio) + + /** + Converts ratios between U and V and between V and Y into ratio between U and Y + */ @inline def >>[Y<:MUnit](that: BaseDoubleRatio[V,Y]) = new BaseDoubleRatio[U,Y](ratio*that.ratio) } diff --git a/units/src/main/scala/internal/ratios/DoubleAffineSpaceConverter.scala b/units/src/main/scala/internal/ratios/DoubleAffineSpaceConverter.scala index 62dba3b..3c04239 100644 --- a/units/src/main/scala/internal/ratios/DoubleAffineSpaceConverter.scala +++ b/units/src/main/scala/internal/ratios/DoubleAffineSpaceConverter.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ import scala.annotation.implicitNotFound class DoubleAffineSpaceConverter[T1<:AffineSpace, T2<:AffineSpace](val f: Double => Double) diff --git a/units/src/main/scala/internal/ratios/DoubleRatio.scala b/units/src/main/scala/internal/ratios/DoubleRatio.scala index 6ed9e86..b57e5e8 100644 --- a/units/src/main/scala/internal/ratios/DoubleRatio.scala +++ b/units/src/main/scala/internal/ratios/DoubleRatio.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ import scala.annotation.implicitNotFound @implicitNotFound(msg="Cannot find a ratio to convert from ${U} to ${V}") diff --git a/units/src/main/scala/internal/ratios/IntAffineSpaceConverter.scala b/units/src/main/scala/internal/ratios/IntAffineSpaceConverter.scala index 8ff9301..208e3d9 100644 --- a/units/src/main/scala/internal/ratios/IntAffineSpaceConverter.scala +++ b/units/src/main/scala/internal/ratios/IntAffineSpaceConverter.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ import scala.annotation.implicitNotFound class IntAffineSpaceConverter[T1<:AffineSpace, T2<:AffineSpace](val f: Long => Long) diff --git a/units/src/main/scala/internal/ratios/IntRatio.scala b/units/src/main/scala/internal/ratios/IntRatio.scala index 6372821..f0ac4b3 100644 --- a/units/src/main/scala/internal/ratios/IntRatio.scala +++ b/units/src/main/scala/internal/ratios/IntRatio.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ import scala.annotation.implicitNotFound @implicitNotFound(msg="Cannot find an integer ratio to convert from ${U} to ${V}") diff --git a/units/src/main/scala/internal/ratios/LeftIntRatio.scala b/units/src/main/scala/internal/ratios/LeftIntRatio.scala index d932142..90cb729 100644 --- a/units/src/main/scala/internal/ratios/LeftIntRatio.scala +++ b/units/src/main/scala/internal/ratios/LeftIntRatio.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ import scala.annotation.implicitNotFound @implicitNotFound(msg="Cannot find an integer ratio to coalesce ${U} and ${V}") diff --git a/units/src/main/scala/internal/ratios/PowerDoubleRatio.scala b/units/src/main/scala/internal/ratios/PowerDoubleRatio.scala index 5137fba..c8d2a5f 100644 --- a/units/src/main/scala/internal/ratios/PowerDoubleRatio.scala +++ b/units/src/main/scala/internal/ratios/PowerDoubleRatio.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ import scala.annotation.implicitNotFound @implicitNotFound(msg="Cannot find a ratio to convert ${U} inside ${V}. Are you sure ${U} is a simple unit?") diff --git a/units/src/main/scala/internal/ratios/PowerIntRatio.scala b/units/src/main/scala/internal/ratios/PowerIntRatio.scala index f3cd342..6cd2f3d 100644 --- a/units/src/main/scala/internal/ratios/PowerIntRatio.scala +++ b/units/src/main/scala/internal/ratios/PowerIntRatio.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ import scala.annotation.implicitNotFound @implicitNotFound(msg="Cannot find an integer ratio to convert ${U} inside ${V}. Are you sure ${U} is a simple unit?") diff --git a/units/src/main/scala/internal/ratios/RightIntRatio.scala b/units/src/main/scala/internal/ratios/RightIntRatio.scala index f1d47f2..0ffd5a3 100644 --- a/units/src/main/scala/internal/ratios/RightIntRatio.scala +++ b/units/src/main/scala/internal/ratios/RightIntRatio.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ import scala.annotation.implicitNotFound @implicitNotFound(msg="Cannot find an integer ratio to coalesce ${U} and ${V}") diff --git a/units/src/main/scala/internal/ratios/UnitAlias.scala b/units/src/main/scala/internal/ratios/UnitAlias.scala index e078e48..eb750bd 100644 --- a/units/src/main/scala/internal/ratios/UnitAlias.scala +++ b/units/src/main/scala/internal/ratios/UnitAlias.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,19 +19,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.internal.ratios -import stasiak.units.internal._ -import stasiak.units.internal.Conversions._ -import stasiak.units._ -import stasiak.units.internal.UnitImpl -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Conversions -import stasiak.units.internal.Conversions._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.AffineSpaces -import stasiak.units.internal.AffineSpaces._ +package io.github.karols.units.internal.ratios +import io.github.karols.units.internal._ +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnitImpl +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Conversions +import io.github.karols.units.internal.Conversions._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.AffineSpaces +import io.github.karols.units.internal.AffineSpaces._ class UnitAlias[U<:MUnit, V<:MUnit](val unused: Int = 0) extends AnyVal{ @inline diff --git a/units/src/main/scala/package.scala b/units/src/main/scala/package.scala index bdb40df..7078d4b 100644 --- a/units/src/main/scala/package.scala +++ b/units/src/main/scala/package.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,27 +19,27 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak +package io.github.karols /** Main package of the library. - Importing `stasiak.units._` brings into scope most of its features. + Importing `io.github.karols.units._` brings into scope most of its features. */ package object units { import language.higherKinds import language.implicitConversions - import stasiak.units.internal.ratios._ - import stasiak.units.internal.UnitName - import stasiak.units.internal.UnitImpl - import stasiak.units.internal.UnitImpl._ - import stasiak.units.internal.Strings._ - import stasiak.units.internal.Conversions - import stasiak.units.internal.Conversions._ - import stasiak.units.internal.SingleUnits._ - import stasiak.units.internal.Integers._ - import stasiak.units.internal.AffineSpaces - import stasiak.units.internal.AffineSpaces._ + import io.github.karols.units.internal.ratios._ + import io.github.karols.units.internal.UnitName + import io.github.karols.units.internal.UnitImpl + import io.github.karols.units.internal.UnitImpl._ + import io.github.karols.units.internal.Strings._ + import io.github.karols.units.internal.Conversions + import io.github.karols.units.internal.Conversions._ + import io.github.karols.units.internal.SingleUnits._ + import io.github.karols.units.internal.Integers._ + import io.github.karols.units.internal.AffineSpaces + import io.github.karols.units.internal.AffineSpaces._ type @@[N, U<:MUnit] = WithU[N,U] @@ -49,19 +49,33 @@ package object units { type ×[U<:MUnit, V<:MUnit] = U#Mul[V] /** Unit multiplication.*/ type ><[U<:MUnit, V<:MUnit] = U#Mul[V] + /** Takes unit to the second power.*/ type square[U<:MUnit] = U#ToPower[P2] /** Takes unit to the third power.*/ type cube[U<:MUnit] = U#ToPower[P3] + /** Takes unit to the fourth power.*/ + type power4[U<:MUnit] = U#ToPower[P4] + /** Takes unit to the fifth power.*/ + type power5[U<:MUnit] = U#ToPower[P5] + /** Gets inverse of a unit. `inverse[second]` is equivalent to `hertz`.*/ type inverse[U<:MUnit] = U#Invert + /** Gets inverse of the second power a unit. */ + type inverseSquare[U<:MUnit] = U#ToPower[N2] + /** Gets inverse of the third power a unit. */ + type inverseCube[U<:MUnit] = U#ToPower[N3] + /** Gets inverse of the fourth power a unit. */ + type inversePower4[U<:MUnit] = U#ToPower[N4] + /** Gets inverse of the fifth power a unit. */ + type inversePower5[U<:MUnit] = U#ToPower[N5] /** Unit dimensionless values have, which is 1.*/ type _1 = TDimensionless - type DoubleRatio[U<:MUnit, V<:MUnit] = stasiak.units.internal.ratios.DoubleRatio[U,V] - type IntRatio[U<:MUnit, V<:MUnit] = stasiak.units.internal.ratios.IntRatio[U,V] - type DoubleAffineSpaceConverter[T1<:AffineSpace, T2<:AffineSpace] = stasiak.units.internal.ratios.DoubleAffineSpaceConverter[T1, T2] - type IntAffineSpaceConverter[T1<:AffineSpace, T2<:AffineSpace] = stasiak.units.internal.ratios.IntAffineSpaceConverter[T1, T2] + type DoubleRatio[U<:MUnit, V<:MUnit] = io.github.karols.units.internal.ratios.DoubleRatio[U,V] + type IntRatio[U<:MUnit, V<:MUnit] = io.github.karols.units.internal.ratios.IntRatio[U,V] + type DoubleAffineSpaceConverter[T1<:AffineSpace, T2<:AffineSpace] = io.github.karols.units.internal.ratios.DoubleAffineSpaceConverter[T1, T2] + type IntAffineSpaceConverter[T1<:AffineSpace, T2<:AffineSpace] = io.github.karols.units.internal.ratios.IntAffineSpaceConverter[T1, T2] @inline implicit class UnitNameBuilder(override val toString:String) extends AnyVal{ diff --git a/units/src/main/scala/units/Currency.scala b/units/src/main/scala/units/Currency.scala index 70c75a7..b9ae372 100644 --- a/units/src/main/scala/units/Currency.scala +++ b/units/src/main/scala/units/Currency.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,15 +19,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units /** Some of currencies of the world. */ object Currency { - import stasiak.units._ - import stasiak.units.defining._ + import io.github.karols.units._ + import io.github.karols.units.defining._ /** UAE dinar*/ type AED = DefineUnit[_A~:_E~:_D] diff --git a/units/src/main/scala/units/Information.scala b/units/src/main/scala/units/Information.scala index bf1312c..5716cd2 100644 --- a/units/src/main/scala/units/Information.scala +++ b/units/src/main/scala/units/Information.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,12 +19,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units /** Units of information. */ object Information { - import stasiak.units._ - import stasiak.units.defining._ + import io.github.karols.units._ + import io.github.karols.units.defining._ import scala.math._ type nat = DefineUnit[_n~:_a~:_t] diff --git a/units/src/main/scala/units/Mechanical.scala b/units/src/main/scala/units/Mechanical.scala index 1aca5a4..a7e205c 100644 --- a/units/src/main/scala/units/Mechanical.scala +++ b/units/src/main/scala/units/Mechanical.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units import defining._ diff --git a/units/src/main/scala/units/SI.scala b/units/src/main/scala/units/SI.scala index 1e73ceb..4a11d79 100644 --- a/units/src/main/scala/units/SI.scala +++ b/units/src/main/scala/units/SI.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units /** SI units. */ object SI { diff --git a/units/src/main/scala/units/USCustomary.scala b/units/src/main/scala/units/USCustomary.scala index 4f1ed71..b744721 100644 --- a/units/src/main/scala/units/USCustomary.scala +++ b/units/src/main/scala/units/USCustomary.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,15 +19,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units +package io.github.karols.units /** US customary and British units and their conversions to SI. */ object USCustomary { - import stasiak.units._ - import stasiak.units.defining._ - import stasiak.units.SI._ + import io.github.karols.units._ + import io.github.karols.units.defining._ + import io.github.karols.units.SI._ type thou = DefineUnit[_t~:_h] type point = DefineUnit[_p~:_t] diff --git a/units/src/main/scala/utils/TimeUtils.scala b/units/src/main/scala/utils/TimeUtils.scala index 6bf2a02..fc49284 100644 --- a/units/src/main/scala/utils/TimeUtils.scala +++ b/units/src/main/scala/utils/TimeUtils.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,13 +19,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.utils +package io.github.karols.units.utils object TimeUtils { - import stasiak.units.SI._ - import stasiak.units._ - import stasiak.units.defining._ + import io.github.karols.units.SI._ + import io.github.karols.units._ + import io.github.karols.units.defining._ import scala.concurrent.duration.{Duration=>CD} import java.util.concurrent.{TimeUnit=>TU} import language.implicitConversions diff --git a/units/src/test/scala/ArraySuite.scala b/units/src/test/scala/ArraySuite.scala index 63dbeee..619e2a8 100644 --- a/units/src/test/scala/ArraySuite.scala +++ b/units/src/test/scala/ArraySuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units_tests +package io.github.karols.units_tests import org.scalatest.FunSuite -import stasiak.units._ +import io.github.karols.units._ import defining._ import SI._ import USCustomary._ diff --git a/units/src/test/scala/QuickShowcaseSuite.scala b/units/src/test/scala/QuickShowcaseSuite.scala index 0c98d48..aa29b34 100644 --- a/units/src/test/scala/QuickShowcaseSuite.scala +++ b/units/src/test/scala/QuickShowcaseSuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units_tests +package io.github.karols.units_tests import org.scalatest.FunSuite -import stasiak.units._ +import io.github.karols.units._ import defining._ import SI._ import USCustomary._ diff --git a/units/src/test/scala/StringSuite.scala b/units/src/test/scala/StringSuite.scala index cfc3248..bb2f8b2 100644 --- a/units/src/test/scala/StringSuite.scala +++ b/units/src/test/scala/StringSuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,11 +19,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units_tests +package io.github.karols.units_tests import org.scalatest.FunSuite -import stasiak.units.internal.Strings -import stasiak.units._ +import io.github.karols.units.internal.Strings +import io.github.karols.units._ import defining._ class StringSuite extends FunSuite { diff --git a/units/src/test/scala/TypeclassSuite.scala b/units/src/test/scala/TypeclassSuite.scala index 43ae0b6..58eb93b 100644 --- a/units/src/test/scala/TypeclassSuite.scala +++ b/units/src/test/scala/TypeclassSuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units_tests +package io.github.karols.units_tests import org.scalatest.FunSuite -import stasiak.units._ +import io.github.karols.units._ import defining._ import SI._ import USCustomary._ diff --git a/units/src/test/scala/UnitConversionSuite.scala b/units/src/test/scala/UnitConversionSuite.scala index 4caceff..4a1c524 100644 --- a/units/src/test/scala/UnitConversionSuite.scala +++ b/units/src/test/scala/UnitConversionSuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,15 +19,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units_tests +package io.github.karols.units_tests import org.scalatest.FunSuite -import stasiak.units._ +import io.github.karols.units._ import defining._ import SI._ import USCustomary._ -import stasiak.units._ -import stasiak.units.internal.UnionType._ +import io.github.karols.units._ +import io.github.karols.units.internal.UnionType._ class UnitConversionSuite extends FunSuite { diff --git a/units/src/test/scala/UnitNameSuite.scala b/units/src/test/scala/UnitNameSuite.scala index 9490fa1..98b197e 100644 --- a/units/src/test/scala/UnitNameSuite.scala +++ b/units/src/test/scala/UnitNameSuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units_tests +package io.github.karols.units_tests import org.scalatest.FunSuite -import stasiak.units._ +import io.github.karols.units._ import defining._ import SI._ import USCustomary._ diff --git a/units/src/test/scala/VectorSuite.scala b/units/src/test/scala/VectorSuite.scala index 8a90adc..5204e96 100644 --- a/units/src/test/scala/VectorSuite.scala +++ b/units/src/test/scala/VectorSuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units_tests +package io.github.karols.units_tests import org.scalatest.FunSuite -import stasiak.units._ +import io.github.karols.units._ import defining._ import SI._ import USCustomary._ diff --git a/units/src/test/scala/WithASuite.scala b/units/src/test/scala/WithASuite.scala index ec4dbc9..54bda60 100644 --- a/units/src/test/scala/WithASuite.scala +++ b/units/src/test/scala/WithASuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units_tests +package io.github.karols.units_tests import org.scalatest.FunSuite -import stasiak.units._ +import io.github.karols.units._ import defining._ import SI._ import USCustomary._ diff --git a/units/src/test/scala/WithUSuite.scala b/units/src/test/scala/WithUSuite.scala index cbd392e..b24f034 100644 --- a/units/src/test/scala/WithUSuite.scala +++ b/units/src/test/scala/WithUSuite.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units_tests +package io.github.karols.units_tests import org.scalatest.FunSuite -import stasiak.units._ +import io.github.karols.units._ import defining._ import SI._ import USCustomary._ diff --git a/units/src/test/scala/benchmarks/DoubleAArrayApplyBenchmark.scala b/units/src/test/scala/benchmarks/DoubleAArrayApplyBenchmark.scala index aabfb6e..505557e 100644 --- a/units/src/test/scala/benchmarks/DoubleAArrayApplyBenchmark.scala +++ b/units/src/test/scala/benchmarks/DoubleAArrayApplyBenchmark.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21,9 +21,9 @@ SOFTWARE. */ import com.google.caliper.SimpleBenchmark -import stasiak.units._ -import stasiak.units.SI._ -import stasiak.units.arrays._ +import io.github.karols.units._ +import io.github.karols.units.SI._ +import io.github.karols.units.arrays._ class DoubleAArrayApplyBenchmark extends SimpleBenchmark { diff --git a/units/src/test/scala/benchmarks/DoubleAArrayForeachBenchmark.scala b/units/src/test/scala/benchmarks/DoubleAArrayForeachBenchmark.scala index ccf4e18..dab3469 100644 --- a/units/src/test/scala/benchmarks/DoubleAArrayForeachBenchmark.scala +++ b/units/src/test/scala/benchmarks/DoubleAArrayForeachBenchmark.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21,9 +21,9 @@ SOFTWARE. */ import com.google.caliper.SimpleBenchmark -import stasiak.units._ -import stasiak.units.SI._ -import stasiak.units.arrays._ +import io.github.karols.units._ +import io.github.karols.units.SI._ +import io.github.karols.units.arrays._ class DoubleAArrayForeachBenchmark extends SimpleBenchmark { diff --git a/units/src/test/scala/benchmarks/DoubleUArrayApplyBenchmark.scala b/units/src/test/scala/benchmarks/DoubleUArrayApplyBenchmark.scala index d140a58..b0744ff 100644 --- a/units/src/test/scala/benchmarks/DoubleUArrayApplyBenchmark.scala +++ b/units/src/test/scala/benchmarks/DoubleUArrayApplyBenchmark.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21,9 +21,9 @@ SOFTWARE. */ import com.google.caliper.SimpleBenchmark -import stasiak.units._ -import stasiak.units.SI._ -import stasiak.units.arrays._ +import io.github.karols.units._ +import io.github.karols.units.SI._ +import io.github.karols.units.arrays._ class DoubleUArrayApplyBenchmark extends SimpleBenchmark { diff --git a/units/src/test/scala/benchmarks/DoubleUArrayForeachBenchmark.scala b/units/src/test/scala/benchmarks/DoubleUArrayForeachBenchmark.scala index 6fa6175..30938f4 100644 --- a/units/src/test/scala/benchmarks/DoubleUArrayForeachBenchmark.scala +++ b/units/src/test/scala/benchmarks/DoubleUArrayForeachBenchmark.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21,9 +21,9 @@ SOFTWARE. */ import com.google.caliper.SimpleBenchmark -import stasiak.units._ -import stasiak.units.SI._ -import stasiak.units.arrays._ +import io.github.karols.units._ +import io.github.karols.units.SI._ +import io.github.karols.units.arrays._ class DoubleUArrayForeachBenchmark extends SimpleBenchmark { diff --git a/units/src/test/scala/benchmarks/IntAArrayForeachBenchmark.scala b/units/src/test/scala/benchmarks/IntAArrayForeachBenchmark.scala index 2d49046..1519b26 100644 --- a/units/src/test/scala/benchmarks/IntAArrayForeachBenchmark.scala +++ b/units/src/test/scala/benchmarks/IntAArrayForeachBenchmark.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21,9 +21,9 @@ SOFTWARE. */ import com.google.caliper.SimpleBenchmark -import stasiak.units._ -import stasiak.units.SI._ -import stasiak.units.arrays._ +import io.github.karols.units._ +import io.github.karols.units.SI._ +import io.github.karols.units.arrays._ class IntAArrayForeachBenchmark extends SimpleBenchmark { diff --git a/units/src/test/scala/benchmarks/IntUArrayApplyBenchmark.scala b/units/src/test/scala/benchmarks/IntUArrayApplyBenchmark.scala index c7143af..bfd5224 100644 --- a/units/src/test/scala/benchmarks/IntUArrayApplyBenchmark.scala +++ b/units/src/test/scala/benchmarks/IntUArrayApplyBenchmark.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21,9 +21,9 @@ SOFTWARE. */ import com.google.caliper.SimpleBenchmark -import stasiak.units._ -import stasiak.units.SI._ -import stasiak.units.arrays._ +import io.github.karols.units._ +import io.github.karols.units.SI._ +import io.github.karols.units.arrays._ class IntUArrayApplyBenchmark extends SimpleBenchmark { diff --git a/units/src/test/scala/benchmarks/IntUArrayForeachBenchmark.scala b/units/src/test/scala/benchmarks/IntUArrayForeachBenchmark.scala index 090542a..5f2af02 100644 --- a/units/src/test/scala/benchmarks/IntUArrayForeachBenchmark.scala +++ b/units/src/test/scala/benchmarks/IntUArrayForeachBenchmark.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21,9 +21,9 @@ SOFTWARE. */ import com.google.caliper.SimpleBenchmark -import stasiak.units._ -import stasiak.units.SI._ -import stasiak.units.arrays._ +import io.github.karols.units._ +import io.github.karols.units.SI._ +import io.github.karols.units.arrays._ class IntUArrayForeachBenchmark extends SimpleBenchmark { diff --git a/units/src/test/scala/benchmarks/SingleBenchmark.scala b/units/src/test/scala/benchmarks/SingleBenchmark.scala index 30c7dda..4f1fcc7 100644 --- a/units/src/test/scala/benchmarks/SingleBenchmark.scala +++ b/units/src/test/scala/benchmarks/SingleBenchmark.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21,8 +21,8 @@ SOFTWARE. */ import com.google.caliper.SimpleBenchmark -import stasiak.units._ -import stasiak.units.SI._ +import io.github.karols.units._ +import io.github.karols.units.SI._ class SingleBenchmark extends SimpleBenchmark { diff --git a/units/src/test/scala/typelevel/ArithmeticProofs.scala b/units/src/test/scala/typelevel/ArithmeticProofs.scala index 2d52aaa..c00a1f0 100644 --- a/units/src/test/scala/typelevel/ArithmeticProofs.scala +++ b/units/src/test/scala/typelevel/ArithmeticProofs.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.typelevel +package io.github.karols.units.typelevel -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ // This trait has only to compile sealed trait ArithmeticProofs{ diff --git a/units/src/test/scala/typelevel/BasicUnitArithmeticProofs.scala b/units/src/test/scala/typelevel/BasicUnitArithmeticProofs.scala new file mode 100644 index 0000000..0369787 --- /dev/null +++ b/units/src/test/scala/typelevel/BasicUnitArithmeticProofs.scala @@ -0,0 +1,51 @@ +/* +Copyright (c) 2013-2014 Karol M. Stasiak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ +package io.github.karols.units.typelevel + +import io.github.karols.units._ +import io.github.karols.units.defining._ + +// This trait has only to compile +sealed trait BasicUnitArithmeticProofs { + + type a = DefineUnit[_a] + type b = DefineUnit[_b] + type c = DefineUnit[_c] + + implicitly[inverse[inverse[a]] =:= a] + implicitly[power4[a] =:= square[square[a]]] + implicitly[power5[a] =:= (a × square[square[a]])] + + implicitly[inverseSquare[a] =:= square[inverse[a]]] + implicitly[inverseSquare[a] =:= inverse[square[a]]] + implicitly[inverseCube[a] =:= cube[inverse[a]]] + implicitly[inverseCube[a] =:= inverse[cube[a]]] + implicitly[inversePower4[a] =:= power4[inverse[a]]] + implicitly[inversePower4[a] =:= inverse[power4[a]]] + implicitly[inversePower5[a] =:= power5[inverse[a]]] + implicitly[inversePower5[a] =:= inverse[power5[a]]] + + implicitly[(inversePower4[a] × power5[a]) =:= a] + implicitly[(inverseCube[a] × power4[a]) =:= a] + implicitly[(inverseSquare[a] × cube[a]) =:= a] + implicitly[(inverse[a] × square[a]) =:= a] +} \ No newline at end of file diff --git a/units/src/test/scala/typelevel/BooleanProofs.scala b/units/src/test/scala/typelevel/BooleanProofs.scala index d4af746..bab2ac5 100644 --- a/units/src/test/scala/typelevel/BooleanProofs.scala +++ b/units/src/test/scala/typelevel/BooleanProofs.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,9 +19,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.typelevel +package io.github.karols.units.typelevel -import stasiak.units.internal.Bools._ +import io.github.karols.units.internal.Bools._ // This trait has only to compile sealed trait BooleanProofs{ diff --git a/units/src/test/scala/typelevel/CharacterEqualityProofs.scala b/units/src/test/scala/typelevel/CharacterEqualityProofs.scala index 02dbc51..c87835a 100644 --- a/units/src/test/scala/typelevel/CharacterEqualityProofs.scala +++ b/units/src/test/scala/typelevel/CharacterEqualityProofs.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,17 +19,17 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.typelevel +package io.github.karols.units.typelevel -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units._ -import stasiak.units.defining._ -import stasiak.units.SI._ -import stasiak.units.USCustomary._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units._ +import io.github.karols.units.defining._ +import io.github.karols.units.SI._ +import io.github.karols.units.USCustomary._ // This trait has only to compile sealed trait CharacterEqualityProofs { diff --git a/units/src/test/scala/typelevel/OrbitingProof.scala b/units/src/test/scala/typelevel/OrbitingProof.scala index 8bc4ffb..505ff08 100644 --- a/units/src/test/scala/typelevel/OrbitingProof.scala +++ b/units/src/test/scala/typelevel/OrbitingProof.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20,10 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.typelevel +package io.github.karols.units.typelevel -import stasiak.units._ -import stasiak.units.defining._ +import io.github.karols.units._ +import io.github.karols.units.defining._ // This trait has only to compile sealed trait OrbitingProof { diff --git a/units/src/test/scala/typelevel/StringProofs.scala b/units/src/test/scala/typelevel/StringProofs.scala index e85f263..3b65ec3 100644 --- a/units/src/test/scala/typelevel/StringProofs.scala +++ b/units/src/test/scala/typelevel/StringProofs.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,17 +19,17 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.typelevel +package io.github.karols.units.typelevel -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units._ -import stasiak.units.defining._ -import stasiak.units.SI._ -import stasiak.units.USCustomary._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units._ +import io.github.karols.units.defining._ +import io.github.karols.units.SI._ +import io.github.karols.units.USCustomary._ // This trait has only to compile sealed trait StringProofs{ diff --git a/units/src/test/scala/typelevel/SystemsProof.scala b/units/src/test/scala/typelevel/SystemsProof.scala index a1f48da..be0ce74 100644 --- a/units/src/test/scala/typelevel/SystemsProof.scala +++ b/units/src/test/scala/typelevel/SystemsProof.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,12 +19,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.typelevel +package io.github.karols.units.typelevel -import stasiak.units._ -import stasiak.units.defining._ -import stasiak.units.SI._ -import stasiak.units.USCustomary._ +import io.github.karols.units._ +import io.github.karols.units.defining._ +import io.github.karols.units.SI._ +import io.github.karols.units.USCustomary._ // This trait has only to compile sealed trait SystemsProof{ @@ -53,8 +53,8 @@ sealed trait SystemsProof{ val MPS(result) = position(MPS[L](x0), MPS[L/T](v0), MPS[L/square[T]](a), MPS[T](t)) } { - import stasiak.units.Mechanical._ - import stasiak.units.SI._ + import io.github.karols.units.Mechanical._ + import io.github.karols.units.SI._ def position(x0: DoubleU[length], v0: DoubleU[speed], a: DoubleU[acceleration], t:DoubleU[time]) = x0 + v0*t + a*t*t/2 diff --git a/units/src/test/scala/typelevel/TypelevelProofs.scala b/units/src/test/scala/typelevel/TypelevelProofs.scala index 3a534c2..b811f73 100644 --- a/units/src/test/scala/typelevel/TypelevelProofs.scala +++ b/units/src/test/scala/typelevel/TypelevelProofs.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,17 +19,17 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.typelevel +package io.github.karols.units.typelevel -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units._ -import stasiak.units.defining._ -import stasiak.units.SI._ -import stasiak.units.USCustomary._ +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units._ +import io.github.karols.units.defining._ +import io.github.karols.units.SI._ +import io.github.karols.units.USCustomary._ // This trait has only to compile sealed trait TypelevelProofs{ diff --git a/units/src/test/scala/typelevel/UnitArithmeticProofs.scala b/units/src/test/scala/typelevel/UnitArithmeticProofs.scala index 8f6db9a..fe29d87 100644 --- a/units/src/test/scala/typelevel/UnitArithmeticProofs.scala +++ b/units/src/test/scala/typelevel/UnitArithmeticProofs.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,10 +19,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.typelevel +package io.github.karols.units.typelevel -import stasiak.units._ -import stasiak.units.defining._ +import io.github.karols.units._ +import io.github.karols.units.defining._ // This trait has only to compile sealed trait UnitArithmeticProofs { diff --git a/units/src/test/scala/typelevel/UnitImplProofs.scala b/units/src/test/scala/typelevel/UnitImplProofs.scala index 7945a95..f6f0430 100644 --- a/units/src/test/scala/typelevel/UnitImplProofs.scala +++ b/units/src/test/scala/typelevel/UnitImplProofs.scala @@ -1,5 +1,5 @@ /* -Copyright (c) 2013 Karol M. Stasiak +Copyright (c) 2013-2014 Karol M. Stasiak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,17 +19,17 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package stasiak.units.typelevel - -import stasiak.units.internal.Strings._ -import stasiak.units.internal.Bools._ -import stasiak.units.internal.Integers._ -import stasiak.units.internal.UnitImpl._ -import stasiak.units.internal.SingleUnits._ -import stasiak.units._ -import stasiak.units.defining._ -import stasiak.units.SI._ -import stasiak.units.USCustomary._ +package io.github.karols.units.typelevel + +import io.github.karols.units.internal.Strings._ +import io.github.karols.units.internal.Bools._ +import io.github.karols.units.internal.Integers._ +import io.github.karols.units.internal.UnitImpl._ +import io.github.karols.units.internal.SingleUnits._ +import io.github.karols.units._ +import io.github.karols.units.defining._ +import io.github.karols.units.SI._ +import io.github.karols.units.USCustomary._ // This trait has only to compile sealed trait UnitImplProofs{