1 /* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 public class Main { main(String[] args)18 public static void main(String[] args) { 19 new Main().run(); 20 System.out.println("finish"); 21 } 22 run()23 public void run() { 24 double a[][] = new double[200][201]; 25 double b[] = new double[200]; 26 int n = 100; 27 28 foo1(a, n, b); 29 } 30 foo1(double a[][], int n, double b[])31 void foo1(double a[][], int n, double b[]) { 32 double t; 33 int i,k; 34 35 for (i = 0; i < n; i++) { 36 k = n - (i + 1); 37 b[k] /= a[k][k]; 38 t = -b[k]; 39 foo2(k + 1000, t, b); 40 } 41 } 42 foo2(int n, double c, double b[])43 void foo2(int n, double c, double b[]) { 44 try { 45 foo3(n, c, b); 46 } catch (Exception e) { 47 } 48 } 49 foo3(int n, double c, double b[])50 void foo3(int n, double c, double b[]) { 51 int i = 0; 52 for (i = 0; i < n; i++) { 53 b[i + 1] += c * b[i + 1]; 54 } 55 } 56 } 57 58