blob: b8d026b216337a348e0d7f60cce02addc2cd3021 [file] [log] [blame]
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#-------------------------------------------------------------
X = matrix(seq(1,1500), 150, 10);
P = matrix(2, nrow(X), 2);
Y0 = matrix(1, nrow(X), 1);
max_y = max(Y0)+1;
while(FALSE){}
Y = table(seq(1,nrow(Y0)), Y0, nrow(Y0), max_y);
while(FALSE){} #recompile w/o knowing K
K = ncol(Y)-1;
R = t(X) %*% (P [, 1:K] - Y [, 1:K]);
write(R, $1)