Search:

Type: Posts; User: codethrupain

Search: Search took 0.12 seconds.

  1. Replies
    6
    Views
    3,310

    Re: Adding two matrix together

    Remember that matrix multiplication requires that the number of rows in matrix A equal the number of columns in matrix B. The rows are the first dimension of the array and the columns are the second...
  2. Replies
    6
    Views
    3,310

    Re: Adding two matrix together

    Try this and see if it makes sense.



    public class UtilityMatrix {

    public static int[][] addMatrix(int[][] a, int[][] b) {
    int[][] bad = {{0}}; // a dummy to send back if the matrices are...
  3. Replies
    6
    Views
    3,310

    Re: Adding two matrix together

    Ted,

    You should test to ensure the matrices a and b are the same size. You may only add matrices that are the same size. There's a length method of arrays but I think you'll need to check length...
  4. Replies
    1
    Views
    1,355

    String replacement

    Every example I have found tells me the following should replace brackets with spaces


    String lineIn = "[10/Feb/2011 15:56:27 -0000]";
    lineIn.replace('[', ' ');
    lineIn.replace(']', ' ');...
Results 1 to 4 of 4