Skip to content

Commit

Permalink
Release version 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PoslavskySV committed Oct 19, 2017
1 parent 170c696 commit a21ad5d
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 20 deletions.
23 changes: 22 additions & 1 deletion rings.scaladsl/build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import sbt.Keys._

organization := "cc.redberry"

name := "rings.scaladsl"

version := "2.0"

scalaVersion := "2.12.3"

crossScalaVersions := Seq("2.11.11", "2.12.3")

moduleName := name.value

resolvers += Resolver.mavenLocal
Expand All @@ -14,4 +20,19 @@ libraryDependencies ++= Seq(
"com.novocode" % "junit-interface" % "0.11" % Test exclude("junit", "junit-dep")
)

crossScalaVersions := Seq("2.11.11", "2.12.3")
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
)

import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._

releaseCrossBuild := true // true if you cross-build the project for multiple Scala versions
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
runClean,
runTest,
releaseStepCommand("publishSigned")
)
5 changes: 5 additions & 0 deletions rings.scaladsl/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.6")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1")


24 changes: 24 additions & 0 deletions rings.scaladsl/sonatype.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

// Your profile name of the sonatype account. The default is the same with the organization value
sonatypeProfileName := "cc.redberry"

// To sync with Maven central, you need to supply the following information:
publishMavenStyle := true

// License of your choice
licenses := Seq("APL2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
homepage := Some(url("https://github.com/PoslavskySV/rings"))
scmInfo := Some(
ScmInfo(
url("https://github.com/PoslavskySV/rings"),
"scm:[email protected]:PoslavskySV/rings.git"
)
)
developers := List(
Developer(
id = "PoslavskySV",
name = "Stanislav Poslavsky",
email = "[email protected]",
url = url("http://redberry.cc")
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -717,23 +717,4 @@ class Examples {
assert(r1 == r2 * div + rem)
}
}


@Test
def test1111 = {

import cc.redberry.rings.poly.univar.UnivariateGCD._
import syntax._

// The ring Z/17[x]
implicit val ring = UnivariateRingZp64(17, "x")

val x = ring("x")

val (gcd, s, t) = PolynomialExtendedGCD(1 + x + x.pow(2) + x.pow(3), 1 + 2 * x + 9 * x.pow(2)).tuple3

println(s)
println(t)
println(gcd)
}
}
34 changes: 34 additions & 0 deletions rings/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<groupId>cc.redberry</groupId>
<artifactId>rings</artifactId>
<version>2.0</version>
<packaging>jar</packaging>
<name>rings</name>
<url>https://github.com/PoslavskySV/rings/</url>
<description>
Rings: efficient Java/Scala library for polynomial rings
</description>

<parent>
<groupId>org.sonatype.oss</groupId>
Expand All @@ -15,6 +21,34 @@
<relativePath/>
</parent>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<id>PoslavskySV</id>
<email>[email protected]</email>
<name>Stanislav Poslavsky</name>
<roles>
<role>architect</role>
<role>developer</role>
<role>tester</role>
<role>documentation</role>
</roles>
<timezone>UTC+04:00</timezone>
<url>https://github.com/PoslavskySV</url>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/PoslavskySV/rings.git</connection>
</scm>

<build>
<plugins>
<plugin>
Expand Down
3 changes: 3 additions & 0 deletions rings/src/main/java/cc/redberry/rings/Ring.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ default boolean isFiniteField() {
* @param elements elements to sum
* @return sum of the array
*/
@SuppressWarnings("unchecked")
default E add(E... elements) {
E r = elements[0];
for (int i = 1; i < elements.length; i++)
Expand Down Expand Up @@ -156,6 +157,7 @@ default E decrement(E element) {
* @param elements the elements
* @return product of the array
*/
@SuppressWarnings("unchecked")
default E multiply(E... elements) {
E r = elements[0];
for (int i = 1; i < elements.length; i++)
Expand Down Expand Up @@ -326,6 +328,7 @@ default E lcm(E a, E b) {
* @param elements the elements
* @return gcd
*/
@SuppressWarnings("unchecked")
default E gcd(E... elements) {
return gcd(Arrays.asList(elements));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public static <E> UnivariatePolynomial<E> parse(String string, Ring<E> ring) {
* @param data the coefficients
* @return new univariate polynomial over specified ring with specified coefficients
*/
@SuppressWarnings("unchecked")
public static <E> UnivariatePolynomial<E> create(Ring<E> ring, E... data) {
ring.setToValueOf(data);
return new UnivariatePolynomial<>(ring, data);
Expand Down

0 comments on commit a21ad5d

Please sign in to comment.