#-------------------------------------------------------------
#
# 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.
#
#-------------------------------------------------------------

test = function(matrix[Double] n, matrix[Double] m)
                        return (matrix[Double] k) {
    if (sum(n) > 1){
      k = n;
    } else {
      k = n * m;
    }
    k = k * m * n;
}
W1 = rand(rows=1000, cols=1000, seed=1);
W2 = rand(rows=10000, cols=10000, seed=2);

test_result1 = test(W1, W2);
test_result2 = test(W2, W1);

sum_result1 = sum(test_result1);
sum_result2 = sum(test_result2);

print("Test1: " + sum_result1);
print("Test2: " + sum_result2);