1
package joey;
2
3
public class Fraction
4
Gauss_JordanElimination 类:2
3
4
1
package joey;
2
3
import java.util.*;
4
5
public class Gauss_JordanElimination
6
2
3
4
5
6
GaussianElimination 类:
1
package joey;
2
3
import java.util.*;
4
5
public class GaussianElimination
6
2
3
4
5
6
Matrix 类:
1
package joey;
2
3
import java.util.*;
4
5
public class Matrix
6
2
3
4
5
6
input.jsp:
1
<%@ page language="java" contentType="text/html; charset=utf8"%>
2
<%@ page import="java.util.*"%>
3
<%@ page import="Joey.*"%>
4
<%
5
String content="";
6
int row=0;
7
int column=0;
8
if(request.getQueryString()!=null)
9
%>
2
3
4
5
6
7
8
9
1
<form action="calculate.jsp" method=post>
2
<table>
3
<%=content%>
4
<input name="Row" type="hidden" id="Row" value="<%=row%>"/>
5
<input name="Column" type="hidden" id="Column" value="<%=column%>"/>
6
</table>
7
<input type="submit" value="Submit"> <input type="reset"
8
value="Reset">
9
</form>
2
3
4
5
6
7
8
9
calculate.jsp:
1
<%@ page language="java" contentType="text/html; charset=utf8"%>
2
<%@ page import="java.util.*"%>
3
<%@ page import="joey.*"%>
4
<%
5
String[] array=request.getParameterValues("TextBox");
6
ArrayList<ArrayList<Fraction>> table=new ArrayList<ArrayList<Fraction>>();
7
ArrayList<Fraction> al;
8
int row = Integer.parseInt(request.getParameter("Row"));
9
int column = Integer.parseInt(request.getParameter("Column"));
10
int pointer = 0;
11
for(int i=0;i<row;i++)
12
%>
2
3
4
5
6
7
8
9
10
11
12
1
<table>
2
<%=content%>
3
</table>
2
3