Ultra Geile Studenten Benutzer Oberfläche (UGSBO)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.3 KiB

  1. package com.ugsbo.matrixcalc;
  2. /**
  3. * Contains all basic matrix math calculations.
  4. */
  5. public class MatrixCalcMath {
  6. /**
  7. * Mutliplys matrixA and matrixB.
  8. *
  9. * @param matrixA The Inputmatrix A (right TextArea in the GUI)
  10. * @param matrixB The Inputmatrix B (left TextArea in the GUI)
  11. * @return The Matrixproduct of the matricies A and B
  12. */
  13. public Double[][] matrixMultiplication(Double[][] matrixA, Double[][] matrixB) {
  14. // TODO Matrix Multiplication
  15. return null;
  16. }
  17. /**
  18. * checks if matrixA and matrixB are linked to know if it is possible to
  19. * multiply them. If they are linked it is possible.
  20. *
  21. * @param matrixA The Inputmatrix A (right TextArea in the GUI)
  22. * @param matrixB The Inputmatrix B (left TextArea in the GUI)
  23. * @return true if you can Muliply A with B false if not.
  24. */
  25. public boolean checkIfMatriciesAreLinked(Double[][] matrixA, Double[][] matrixB) {
  26. // TODO Check if the number of Rows of Matrix A equal to the coulums of Matrix B
  27. if (matrixA != null) {
  28. if (matrixA[0].length == matrixB.length) {
  29. return true;
  30. } else {
  31. return false;
  32. }
  33. } else {
  34. return false;
  35. }
  36. }
  37. /**
  38. * Adds two matroices A and B. Adding matrix A to matrix B is the same as adding
  39. * B to A.
  40. *
  41. * @param matrixA The Inputmatrix A (right TextArea in the GUI)
  42. * @param matrixB The Inputmatrix B (left TextArea in the GUI)
  43. * @return The Matrixsum of matrix A and matrix B
  44. */
  45. public Double[][] matrixAddition(Double[][] matrixA, Double[][] matrixB) {
  46. // TODO Sum each Element of matrix A to the corrosponding elem in B
  47. return null;
  48. }
  49. /**
  50. * In order to adding two Matricies they must have the same Dimensions. This
  51. * Methode checks if this is the case.
  52. *
  53. * @param matrixA The Inputmatrix A (right TextArea in the GUI)
  54. * @param matrixB The Inputmatrix B (left TextArea in the GUI)
  55. * @return true if the Dimensions of Matrix A equals the Dimensions Matrix B
  56. */
  57. public boolean checkIfMatriciesAreTheSameDimension(Double[][] matrixA, Double[][] matrixB) {
  58. // TODO Dimension check.
  59. return false;
  60. }
  61. }