diff --git a/com.oracle.truffle.r.native/builtinlibs/src/fft.c b/com.oracle.truffle.r.native/builtinlibs/src/fft.c index 42e83b603c23ce066a57693b5ce46baf540b0bf7..5837f86b35255518fb6a4cbfbc8835f64f86c568 100644 --- a/com.oracle.truffle.r.native/builtinlibs/src/fft.c +++ b/com.oracle.truffle.r.native/builtinlibs/src/fft.c @@ -5,8 +5,8 @@ * * Copyright (c) 1995, 1996, 1997 Robert Gentleman and Ross Ihaka * Copyright (c) 1995-2014, The R Core Team - * Copyright (c) 2003, The R Foundation - * Copyright (c) 2014, Oracle and/or its affiliates + * Copyright (c) 2002-2008, The R Foundation + * Copyright (c) 2014, 2015, Oracle and/or its affiliates * * All rights reserved. */ diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LoadFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LoadFunctions.java index 185796521eb0ca6c5724c6f627d630048e582a7b..2ecb03f9d64d07969923ef9bee9bb152eb6c7f70 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LoadFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/LoadFunctions.java @@ -5,7 +5,7 @@ * * Copyright (c) 1995, 1996, 1997 Robert Gentleman and Ross Ihaka * Copyright (c) 1995-2014, The R Core Team - * Copyright (c) 2003, The R Foundation + * Copyright (c) 2002-2008, The R Foundation * Copyright (c) 2014, 2015, Oracle and/or its affiliates * * All rights reserved. diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Order.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Order.java index 1245d533fc30ebee852e45920a0d423d5c23e6e3..af28f1116d6a71a77cdabf927caa937e5642028f 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Order.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Order.java @@ -5,7 +5,7 @@ * * Copyright (c) 1995, 1996, 1997 Robert Gentleman and Ross Ihaka * Copyright (c) 1995-2014, The R Core Team - * Copyright (c) 2004, The R Foundation + * Copyright (c) 2002-2008, The R Foundation * Copyright (c) 2015, Oracle and/or its affiliates * * All rights reserved. diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java index a321b5f89579570328ca944dbb9619d88886cd73..0febac69e4f7c643ab8ef3bb526d7a0310874acd 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java @@ -1,24 +1,14 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This material is distributed under the GNU General Public License + * Version 2. You may review the terms of this license at + * http://www.gnu.org/licenses/gpl-2.0.html * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. + * Copyright (c) 1995, 1996, 1997 Robert Gentleman and Ross Ihaka + * Copyright (c) 1995-2014, The R Core Team + * Copyright (c) 2002-2008, The R Foundation + * Copyright (c) 2015, Oracle and/or its affiliates * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. + * All rights reserved. */ package com.oracle.truffle.r.nodes.builtin.base; @@ -27,6 +17,7 @@ import static com.oracle.truffle.r.runtime.RBuiltinKind.*; import com.oracle.truffle.api.dsl.*; import com.oracle.truffle.api.frame.*; +import com.oracle.truffle.api.utilities.*; import com.oracle.truffle.r.nodes.*; import com.oracle.truffle.r.nodes.access.*; import com.oracle.truffle.r.nodes.builtin.*; @@ -93,19 +84,15 @@ public abstract class Transpose extends RBuiltinNode { return performAbstractIntVector(vector, vector.isMatrix() ? vector.getDimensions() : new int[]{vector.getLength(), 1}); } - private static RIntVector performAbstractIntVector(RAbstractIntVector vector, int[] dim) { - int firstDim = dim[0]; + private RIntVector performAbstractIntVector(RAbstractIntVector vector, int[] dim) { + int firstDim = dim[0]; // rows int secondDim = dim[1]; int[] result = new int[vector.getLength()]; - int pos = 0; - int pos2 = 0; - for (int y = 0; y < secondDim; y++) { - pos2 = y; - for (int x = 0; x < firstDim; x++) { - int value = vector.getDataAt(pos++); - result[pos2] = value; - pos2 += secondDim; + for (int i = 0, j = 0; i < result.length; i++, j += firstDim) { + if (j > (result.length - 1)) { + j -= (result.length - 1); } + result[i] = vector.getDataAt(j); } int[] newDim = new int[]{secondDim, firstDim}; RIntVector r = RDataFactory.createIntVector(result, vector.isComplete()); @@ -121,19 +108,15 @@ public abstract class Transpose extends RBuiltinNode { return performAbstractDoubleVector(vector, vector.isMatrix() ? vector.getDimensions() : new int[]{vector.getLength(), 1}); } - private static RDoubleVector performAbstractDoubleVector(RAbstractDoubleVector vector, int[] dim) { + private RDoubleVector performAbstractDoubleVector(RAbstractDoubleVector vector, int[] dim) { int firstDim = dim[0]; int secondDim = dim[1]; double[] result = new double[vector.getLength()]; - int pos = 0; - int pos2 = 0; - for (int y = 0; y < secondDim; y++) { - pos2 = y; - for (int x = 0; x < firstDim; x++) { - double value = vector.getDataAt(pos++); - result[pos2] = value; - pos2 += secondDim; + for (int i = 0, j = 0; i < result.length; i++, j += firstDim) { + if (j > (result.length - 1)) { + j -= (result.length - 1); } + result[i] = vector.getDataAt(j); } int[] newDim = new int[]{secondDim, firstDim}; RDoubleVector r = RDataFactory.createDoubleVector(result, vector.isComplete()); @@ -149,19 +132,15 @@ public abstract class Transpose extends RBuiltinNode { return performAbstractStringVector(vector, vector.isMatrix() ? vector.getDimensions() : new int[]{vector.getLength(), 1}); } - private static RStringVector performAbstractStringVector(RAbstractStringVector vector, int[] dim) { + private RStringVector performAbstractStringVector(RAbstractStringVector vector, int[] dim) { int firstDim = dim[0]; int secondDim = dim[1]; String[] result = new String[vector.getLength()]; - int pos = 0; - int pos2 = 0; - for (int y = 0; y < secondDim; y++) { - pos2 = y; - for (int x = 0; x < firstDim; x++) { - String value = vector.getDataAt(pos++); - result[pos2] = value; - pos2 += secondDim; + for (int i = 0, j = 0; i < result.length; i++, j += firstDim) { + if (j > (result.length - 1)) { + j -= (result.length - 1); } + result[i] = vector.getDataAt(j); } int[] newDim = new int[]{secondDim, firstDim}; RStringVector r = RDataFactory.createStringVector(result, vector.isComplete()); diff --git a/mx.fastr/copyrights/gnu_r_gentleman_ihaka.copyright.star b/mx.fastr/copyrights/gnu_r_gentleman_ihaka.copyright.star index 776e6ca7698b663301b7635b9bc64a9a3dd40612..1f63306d3e56f45ba550d59f4dbf95411e2a2a83 100644 --- a/mx.fastr/copyrights/gnu_r_gentleman_ihaka.copyright.star +++ b/mx.fastr/copyrights/gnu_r_gentleman_ihaka.copyright.star @@ -5,7 +5,7 @@ * * Copyright (c) 1995, 1996, 1997 Robert Gentleman and Ross Ihaka * Copyright (c) 1995-2014, The R Core Team - * Copyright (c) 2003, The R Foundation + * Copyright (c) 2002-2008, The R Foundation * Copyright (c) 2013, Oracle and/or its affiliates * * All rights reserved. diff --git a/mx.fastr/copyrights/gnu_r_gentleman_ihaka.copyright.star.regex b/mx.fastr/copyrights/gnu_r_gentleman_ihaka.copyright.star.regex index fe3d1f11b2f4a9d5c982eb628aee376384f8ca09..cb3253bc671a233344c6f111f9dad8602675eadf 100644 --- a/mx.fastr/copyrights/gnu_r_gentleman_ihaka.copyright.star.regex +++ b/mx.fastr/copyrights/gnu_r_gentleman_ihaka.copyright.star.regex @@ -1 +1 @@ -/\*\n \* This material is distributed under the GNU General Public License\n \* Version 2. You may review the terms of this license at\n \* http://www.gnu.org/licenses/gpl-2.0.html\n \*\n \* Copyright \(c\) 1995, 1996, 1997 Robert Gentleman and Ross Ihaka\n \* Copyright \(c\) 1995-2014, The R Core Team\n \* Copyright \(c\) 200[3-4], The R Foundation\n \* Copyright \(c\) (?:(20[0-9][0-9]), )?(20[0-9][0-9]), Oracle and/or its affiliates\n \*\n \* All rights reserved.\n \*/\n.* \ No newline at end of file +/\*\n \* This material is distributed under the GNU General Public License\n \* Version 2. You may review the terms of this license at\n \* http://www.gnu.org/licenses/gpl-2.0.html\n \*\n \* Copyright \(c\) 1995, 1996, 1997 Robert Gentleman and Ross Ihaka\n \* Copyright \(c\) 1995-2014, The R Core Team\n \* Copyright \(c\) 2002-2008, The R Foundation\n \* Copyright \(c\) (?:(20[0-9][0-9]), )?(20[0-9][0-9]), Oracle and/or its affiliates\n \*\n \* All rights reserved.\n \*/\n.* \ No newline at end of file diff --git a/mx.fastr/copyrights/overrides b/mx.fastr/copyrights/overrides index e602e30b64a1244c3c5cab160e19514159cfe9ff..1624c486ddd8b2b92db1c8c702216b44d60cabba 100644 --- a/mx.fastr/copyrights/overrides +++ b/mx.fastr/copyrights/overrides @@ -63,6 +63,7 @@ com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/R com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Sample.java,gnu_r_sample.copyright com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Scan.java,gnu_r_scan.copyright com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Tabulate.java,purdue.copyright +com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java,gnu_r_gentleman_ihaka.copyright com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UnClass.java,purdue.copyright com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Unlist.java,gnu_r.copyright com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateClass.java,purdue.copyright